From 38cf44a7330db312683f5d84c5c85c6d0e63f08d Mon Sep 17 00:00:00 2001 From: Icenowy Zheng Date: Mon, 20 Apr 2026 19:30:21 +0800 Subject: [PATCH] pvr: ignore DS attachment's D or S when it's unused in dynamic rendering Dynamic rendering codepath allows binding an attachment with a depth+stencil format, but only depth or stencil active. The corresponding test should be disable in such case. Ignore the attachment's depth or stencil according to the rendering attachment info's is_depth and is_stencil variables. Fixes the following CTS testcases: dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.static_enable.d24_unorm_s8_uint dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.static_enable.d32_sfloat_s8_uint dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.dynamic_enable.d24_unorm_s8_uint dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.dynamic_enable.d32_sfloat_s8_uint Signed-off-by: Icenowy Zheng Reviewed-by: Luigi Santivetti Part-of: --- src/imagination/ci/bxs-4-64-fails.txt | 5 ----- src/imagination/vulkan/pvr_arch_cmd_buffer.c | 10 +++++++++- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/imagination/ci/bxs-4-64-fails.txt b/src/imagination/ci/bxs-4-64-fails.txt index 142935d92f7..f81f3acd705 100644 --- a/src/imagination/ci/bxs-4-64-fails.txt +++ b/src/imagination/ci/bxs-4-64-fails.txt @@ -14,11 +14,6 @@ dEQP-VK.binding_model.unused_invalid_descriptor.write.unused.uniform_buffer,Cras dEQP-VK.graphicsfuzz.cov-two-nested-loops-switch-case-matrix-array-increment,Fail dEQP-VK.graphicsfuzz.stable-binarysearch-tree-false-if-discard-loop,Fail dEQP-VK.memory.concurrent_access.shader_and_host,Crash -dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.dynamic_enable.d24_unorm_s8_uint,Fail -dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.dynamic_enable.d32_sfloat_s8_uint,Fail -dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.static_enable.d24_unorm_s8_uint,Fail -dEQP-VK.pipeline.monolithic.stencil.no_stencil_att.dynamic_rendering.static_enable.d32_sfloat_s8_uint,Fail -dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.basic.partial_binding_depth_stencil,Fail dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed0_multiview,Fail dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed10_multiview,Fail dEQP-VK.renderpasses.dynamic_rendering.primary_cmd_buff.random.seed11,Fail diff --git a/src/imagination/vulkan/pvr_arch_cmd_buffer.c b/src/imagination/vulkan/pvr_arch_cmd_buffer.c index bb59f707496..4d274ab2c0b 100644 --- a/src/imagination/vulkan/pvr_arch_cmd_buffer.c +++ b/src/imagination/vulkan/pvr_arch_cmd_buffer.c @@ -6611,12 +6611,20 @@ pvr_setup_isp_faces_and_control(struct pvr_cmd_buffer *const cmd_buffer, const enum ROGUE_TA_OBJTYPE obj_type = pvr_ta_objtype(dynamic_state->ia.primitive_topology); - const VkImageAspectFlags ds_aspects = + VkImageAspectFlags ds_aspects = (!rasterizer_discard && attachment) ? vk_format_aspects(attachment->vk_format) & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT) : VK_IMAGE_ASPECT_NONE; + /* Dynamic rendering attachments could be bound with a D+S format but only + * D or S active. + */ + if (!pass_info->pass && attachment && !attachment->is_depth) + ds_aspects &= ~VK_IMAGE_ASPECT_DEPTH_BIT; + if (!pass_info->pass && attachment && !attachment->is_stencil) + ds_aspects &= ~VK_IMAGE_ASPECT_STENCIL_BIT; + /* This is deliberately a full copy rather than a pointer because * vk_optimize_depth_stencil_state() can only be run once against any given * instance of vk_depth_stencil_state.