From 0be53b2ed87e4c5c776ff290984186c729c16216 Mon Sep 17 00:00:00 2001 From: Christian Gmeiner Date: Tue, 28 Oct 2025 11:00:35 +0100 Subject: [PATCH] anv: Fix needs_temp_copy() incorrectly matching depth/stencil formats The needs_temp_copy() function was incorrectly identifying some depth/stencil formats as needing RGB<->RGBA conversion. VK_FORMAT_D32_SFLOAT_S8_UINT maps to PIPE_FORMAT_Z32_FLOAT_S8X24_UINT, which has 3 channels (F32 depth, UP8 stencil, X24 padding). The component count check (== 3) was matching this as an RGB color format, causing depth/stencil images to incorrectly use the RGB conversion path. Add an explicit vk_format_is_depth_or_stencil() check before the component count test to ensure depth/stencil formats always use the direct copy path. Fixes: f97b51186f ("anv: intermediate RGB <-> RGBX copy for HIC") Signed-off-by: Christian Gmeiner Reviewed-by: Lionel Landwerlin Part-of: --- src/intel/vulkan/anv_image_host_copy.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/intel/vulkan/anv_image_host_copy.c b/src/intel/vulkan/anv_image_host_copy.c index d0f6d8e61b1..4b3bfce455a 100644 --- a/src/intel/vulkan/anv_image_host_copy.c +++ b/src/intel/vulkan/anv_image_host_copy.c @@ -207,6 +207,10 @@ needs_temp_copy(struct anv_image *image, VkHostImageCopyFlags flags) flags & VK_HOST_IMAGE_COPY_MEMCPY_BIT) return false; + /* Skip depth/stencil formats */ + if (vk_format_is_depth_or_stencil(image->vk.format)) + return false; + return util_format_get_nr_components(vk_format_to_pipe_format(image->vk.format)) == 3; }