From c5cad407f8ddb29f52b4da7ce99ac073a731339d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Tue, 14 Jan 2025 16:53:46 +0200 Subject: [PATCH] anv: handle non-wsi images in anv_layout_to_aux_state MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Transition to VK_IMAGE_LAYOUT_PRESENT_SRC_KHR with non-wsi image was seen with gfxrecon-replay case that ends up hitting weird assertions later. Signed-off-by: Tapani Pälli Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_image.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index aac3899acb3..d2ed28605a7 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -3105,6 +3105,15 @@ anv_layout_to_aux_state(const struct intel_device_info * const devinfo, case VK_IMAGE_LAYOUT_PRESENT_SRC_KHR: { assert(image->vk.aspects == VK_IMAGE_ASPECT_COLOR_BIT); + /* Handle transition to present layout for non wsi images just like + * normal images. Some apps like gfx-reconstruct incorrectly use this + * layout on non-wsi image which is against spec. It's easy enough to + * deal with it here and potentially avoid unnecessary resolve + * operations. + */ + if (!image->from_wsi) + break; + enum isl_aux_state aux_state = isl_drm_modifier_get_default_aux_state(image->vk.drm_format_mod);