Index: src/gpu/vk/GrVkCaps.cpp |
diff --git a/src/gpu/vk/GrVkCaps.cpp b/src/gpu/vk/GrVkCaps.cpp |
index cf9f4f025e0a2a8d4b53a25a3a5f9ba711256803..9027f6881557467384dd261df228250553a464ee 100644 |
--- a/src/gpu/vk/GrVkCaps.cpp |
+++ b/src/gpu/vk/GrVkCaps.cpp |
@@ -137,7 +137,16 @@ void GrVkCaps::initGLSLCaps(const VkPhysicalDeviceProperties& properties, |
glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RRRR(); |
glslCaps->fConfigOutputSwizzle[i] = GrSwizzle::AAAA(); |
} else { |
- glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RGBA(); |
+ if (kRGBA_4444_GrPixelConfig == config) { |
+ // The vulkan spec does not require R4G4B4A4 to be supported for texturing so we |
+ // store the data in a B4G4R4A4 texture and then swizzle it when doing texture reads |
+ // or writing to outputs. Since we're not actually changing the data at all, the |
+ // only extra work is the swizzle in the shader for all operations. |
+ glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::BGRA(); |
+ glslCaps->fConfigOutputSwizzle[i] = GrSwizzle::BGRA(); |
+ } else { |
+ glslCaps->fConfigTextureSwizzle[i] = GrSwizzle::RGBA(); |
+ } |
} |
} |