[Mesa-dev] [PATCH 23/23] anv/formats: Add support for VK_FORMAT_B4G4R4A4_UNORM pre-gen8

Jason Ekstrand jason at jlekstrand.net
Mon May 16 19:08:28 UTC 2016


---
 src/intel/vulkan/anv_formats.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index bd8d11f..b52c7ca 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -287,6 +287,16 @@ anv_get_format(const struct brw_device_info *devinfo, VkFormat vk_format,
       }
    }
 
+   /* The B4G4R4A4 format isn't available prior to Sky Lake so we have to fall
+    * back to a format with a more complex swizzle.
+    */
+   if (vk_format == VK_FORMAT_B4G4R4A4_UNORM_PACK16 && devinfo->gen < 9) {
+      return (struct anv_format) {
+         .isl_format = ISL_FORMAT_B4G4R4A4_UNORM,
+         .swizzle = ISL_SWIZZLE(GREEN, RED, ALPHA, BLUE),
+      };
+   }
+
    return format;
 }
 
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list