Module: Mesa Branch: main Commit: 7b84c8d6ea1f66e0c637db962f49ecd2f977bd48 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7b84c8d6ea1f66e0c637db962f49ecd2f977bd48
Author: Chia-I Wu <[email protected]> Date: Thu Sep 28 10:29:52 2023 -0700 anv: fix up image views for emulated formats When the view format is the same as the image format, and the format is emulated, change the format to the decompressed format. Signed-off-by: Chia-I Wu <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25467> --- src/intel/vulkan/anv_image.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 6a27a1d6a3a..036d0bb0b5f 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -3167,9 +3167,14 @@ anv_image_view_init(struct anv_device *device, anv_foreach_image_aspect_bit(iaspect_bit, image, iview->vk.aspects) { const uint32_t vplane = anv_aspect_to_plane(iview->vk.aspects, 1UL << iaspect_bit); - struct anv_format_plane format; - format = anv_get_format_plane(device->info, iview->vk.view_format, - vplane, image->vk.tiling); + + VkFormat view_format = iview->vk.view_format; + if (anv_is_format_emulated(device->physical, view_format)) { + assert(image->emu_plane_format != VK_FORMAT_UNDEFINED); + view_format = vk_texcompress_astc_emulation_format(view_format); + } + const struct anv_format_plane format = anv_get_format_plane( + device->info, view_format, vplane, image->vk.tiling); iview->planes[vplane].isl = (struct isl_view) { .format = format.isl_format,
