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 <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26461>
This commit is contained in:
Mark Collins 2024-02-15 15:49:51 +00:00 committed by Marge Bot
parent b44474407d
commit cc6399de31

View file

@ -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;
}