Fix 4444 on Vulkan devices who don't support RGBA_4444
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2238563002
Committed: https://skia.googlesource.com/skia/+/637b3bf2b9c10398d823bd015a722842d4f2f971
Review-Url: https://codereview.chromium.org/2238563002
diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp
index 760b20b..ffbad25 100644
--- a/src/gpu/vk/GrVkUtil.cpp
+++ b/src/gpu/vk/GrVkUtil.cpp
@@ -30,7 +30,9 @@
*format = VK_FORMAT_R5G6B5_UNORM_PACK16;
break;
case kRGBA_4444_GrPixelConfig:
- *format = VK_FORMAT_R4G4B4A4_UNORM_PACK16;
+ // R4G4B4A4 is not required to be supported so we actually
+ // store the data is if it was B4G4R4A4 and swizzle in shaders
+ *format = VK_FORMAT_B4G4R4A4_UNORM_PACK16;
break;
case kIndex_8_GrPixelConfig:
// No current vulkan support for this config
@@ -88,7 +90,9 @@
case VK_FORMAT_R5G6B5_UNORM_PACK16:
*config = kRGB_565_GrPixelConfig;
break;
- case VK_FORMAT_R4G4B4A4_UNORM_PACK16:
+ case VK_FORMAT_B4G4R4A4_UNORM_PACK16:
+ // R4G4B4A4 is not required to be supported so we actually
+ // store RGBA_4444 data as B4G4R4A4.
*config = kRGBA_4444_GrPixelConfig;
break;
case VK_FORMAT_R8_UNORM: