From cc6399de31e31169e4db83a2a711d32bbbe18fea Mon Sep 17 00:00:00 2001 From: Mark Collins Date: Thu, 15 Feb 2024 15:49:51 +0000 Subject: [PATCH] tu: Update CCU layout selection logic for seperate stencil stores The CCU layout logic needed to match the full `use_fast_path` case in `tu_store_gmem_attachment`, not just unaligned but also for the stencil storage logic. The current code works since depth/stencil formats are forced to use the slow path by `blit_can_resolve`. However, that will be removed since only seperate stencil stores are unable to use the fast path while combined stores can use it without any issues. This change prevents a regression due to no longer choosing the sysmem CCU layout for seperate stencil stores when fast-path resolves are allowed for DS formats. Fixes VK-CTS cases (when fast-path stores for DS formats are enabled): dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint.compatibility_depth_zero_stencil_zero_testing_stencil dEQP-VK.renderpass2.depth_stencil_resolve.image_2d_32_32.samples_2.d24_unorm_s8_uint_separate_layouts.compatibility_depth_zero_stencil_zero_testing_stencil Signed-off-by: Mark Collins Part-of: --- src/freedreno/vulkan/tu_clear_blit.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/freedreno/vulkan/tu_clear_blit.cc b/src/freedreno/vulkan/tu_clear_blit.cc index 4f8961ac043..cc5a581c7ab 100644 --- a/src/freedreno/vulkan/tu_clear_blit.cc +++ b/src/freedreno/vulkan/tu_clear_blit.cc @@ -3861,7 +3861,7 @@ tu_attachment_store_unaligned(struct tu_cmd_buffer *cmd, uint32_t a) * current attachments will need. This has to happen at vkBeginRenderPass() * time because tu_attachment_store_unaligned() looks at the image views, which * are only available at that point. This should match the logic for the - * !unaligned case in tu_store_gmem_attachment(). + * !use_fast_path case in tu_store_gmem_attachment(). */ void tu_choose_gmem_layout(struct tu_cmd_buffer *cmd) @@ -3877,6 +3877,11 @@ tu_choose_gmem_layout(struct tu_cmd_buffer *cmd) if ((att->store || att->store_stencil) && tu_attachment_store_unaligned(cmd, i)) cmd->state.gmem_layout = TU_GMEM_LAYOUT_AVOID_CCU; + if (att->store && att->format == VK_FORMAT_S8_UINT) + /* We cannot pick out S8 from D24S8/D32S8, so we conservatively disable + * blit events for the S8_UINT format. + */ + cmd->state.gmem_layout = TU_GMEM_LAYOUT_AVOID_CCU; if (att->will_be_resolved && !blit_can_resolve(att->format)) cmd->state.gmem_layout = TU_GMEM_LAYOUT_AVOID_CCU; }