diff options
author | Jason Ekstrand <[email protected]> | 2016-05-16 11:02:57 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2016-05-17 12:17:22 -0700 |
commit | b6c4d46a580df5e1c9c21adae70fc0879190d53a (patch) | |
tree | 6b64ca7832570633c809a07d3ff8675bd23b8832 /src/intel/vulkan | |
parent | 45c93384e519aefba1d28388955b2638f4d26ea3 (diff) |
anv/formats: Add support for VK_FORMAT_B4G4R4A4_UNORM pre-gen8
Diffstat (limited to 'src/intel/vulkan')
-rw-r--r-- | src/intel/vulkan/anv_formats.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index bd8d11fb2b2..b52c7ca20f4 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; } |