anv/formats: Add support for VK_FORMAT_B4G4R4A4_UNORM pre-gen8

This commit is contained in:
Jason Ekstrand 2016-05-16 11:02:57 -07:00
parent 45c93384e5
commit b6c4d46a58
1 changed files with 10 additions and 0 deletions

View File

@ -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;
}