From 6a65b5dd4de93ae84047ccba92a32a66c9f140a4 Mon Sep 17 00:00:00 2001 From: Luigi Santivetti Date: Thu, 29 Jan 2026 23:58:23 +0000 Subject: [PATCH] pvr: fix src/dst image formats for DS resolve ops This change only addresses the clear of one channel via the TQ for DS formats. This is exercised by VK_KHR_depth_stencil_resolve in two ways: resolve depth and clear stencil, or resolve stencil and clear depth. When resolving, we need to propagate source and destination format if the DS format is combined because we need either combination of both for cases where the DSMERGE and PICKD flags are set. - Resolve op + For combined DS formats 1. resolve the stencil from the source merging it with the depth of the destination. Leave source depth unchanged. 2. resolve the depth from the source merging it with the stencil of the destination. Leave the source stencil untouched. + For non-combined formats 1. we can use the source for all aspects / channels, this ensures the size to blit the source to is compatible with the destination. Note that the TQ doesn't require src/dst to be single channel formats. - Non resolve op + Not part of this change. Fix for deqp: dEQP-VK.renderpass2.depth_stencil_resolve.*.*.d24_unorm_s8_uint.compatibility* dEQP-VK.renderpass2.depth_stencil_resolve.*.*.d32_sfloat_s8_uint.compatibility* Signed-off-by: Luigi Santivetti Co-authored-by: Leon Perianu Reviewed-by: Frank Binns Part-of: --- src/imagination/ci/bxs-4-64-fails.txt | 14 +------------- src/imagination/vulkan/rogue/pvr_blit.c | 17 +++++++++-------- 2 files changed, 10 insertions(+), 21 deletions(-) diff --git a/src/imagination/ci/bxs-4-64-fails.txt b/src/imagination/ci/bxs-4-64-fails.txt index 5c64c311dfb..45c12382c39 100644 --- a/src/imagination/ci/bxs-4-64-fails.txt +++ b/src/imagination/ci/bxs-4-64-fails.txt @@ -254,16 +254,4 @@ dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed99_multiview, dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed9_multiview,Fail dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.suballocation.attachment.4.568,Fail dEQP-VK.renderpasses.renderpass1.dedicated_allocation.attachment_allocation.input_output.71,Fail -dEQP-VK.renderpasses.renderpass1.suballocation.attachment_allocation.input_output.71,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint.compatibility_depth_none_stencil_zero_testing_stencil,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint.compatibility_depth_zero_stencil_zero_testing_stencil,Crash -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint_separate_layouts.compatibility_depth_none_stencil_zero_testing_stencil,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_stencil,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.compatibility_depth_none_stencil_zero_testing_stencil,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.compatibility_depth_zero_stencil_none_testing_depth,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.compatibility_depth_zero_stencil_zero_testing_depth,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint.compatibility_depth_zero_stencil_zero_testing_stencil,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint_separate_layouts.compatibility_depth_none_stencil_zero_testing_stencil,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint_separate_layouts.compatibility_depth_zero_stencil_none_testing_depth,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_depth,Fail -dEQP-VK.renderpasses.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d32_sfloat_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_stencil,Fail +dEQP-VK.renderpasses.renderpass1.suballocation.attachment_allocation.input_output.71,Fail \ No newline at end of file diff --git a/src/imagination/vulkan/rogue/pvr_blit.c b/src/imagination/vulkan/rogue/pvr_blit.c index 00a859ab200..8cb3eb7a582 100644 --- a/src/imagination/vulkan/rogue/pvr_blit.c +++ b/src/imagination/vulkan/rogue/pvr_blit.c @@ -598,19 +598,20 @@ pvr_copy_or_resolve_image_region(struct pvr_cmd_buffer *cmd_buffer, } if (src->vk.samples > dst->vk.samples) { - /* Resolve op needs to know the actual format. */ - dst_format = - vk_format_get_plane_aspect_format(dst->vk.format, - region->dstSubresource.aspectMask); + src_format = src->vk.format; + if (pvr_vk_format_is_combined_ds(src->vk.format) && + dst->vk.format != VK_FORMAT_X8_D24_UNORM_PACK32) { + dst_format = dst->vk.format; + } else { + dst_format = src_format; + } } else { /* We don't care what format dst is as it's guaranteed to be size * compatible with src. */ - dst_format = pvr_get_raw_copy_format( - vk_format_get_plane_aspect_format(src->vk.format, - region->srcSubresource.aspectMask)); + dst_format = pvr_get_raw_copy_format(src->vk.format); + src_format = dst_format; } - src_format = dst_format; src_layers = vk_image_subresource_layer_count(&src->vk, ®ion->srcSubresource);