Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(210)

Unified Diff: src/gpu/vk/GrVkUtil.cpp

Issue 2238563002: Fix 4444 on Vulkan devices who don't support RGBA_4444 (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update comment Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/vk/GrVkCaps.cpp ('k') | tests/PackedConfigsTextureTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/vk/GrVkUtil.cpp
diff --git a/src/gpu/vk/GrVkUtil.cpp b/src/gpu/vk/GrVkUtil.cpp
index 760b20b4580e7f75de814d032b59cd954077aae5..ffbad25fd9a29753a5b05dc7975a20a816cbc70c 100644
--- a/src/gpu/vk/GrVkUtil.cpp
+++ b/src/gpu/vk/GrVkUtil.cpp
@@ -30,7 +30,9 @@ bool GrPixelConfigToVkFormat(GrPixelConfig config, VkFormat* format) {
*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 @@ bool GrVkFormatToPixelConfig(VkFormat format, GrPixelConfig* config) {
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:
« no previous file with comments | « src/gpu/vk/GrVkCaps.cpp ('k') | tests/PackedConfigsTextureTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698