From f24358e002de645388852dd85aee4b9b0d3d7652 Mon Sep 17 00:00:00 2001 From: Jonathan Marek Date: Thu, 3 Dec 2020 00:03:14 -0500 Subject: [PATCH] turnip: move up LRZ invalidate in CmdClearAttachments There is an early return if cmd->state.predication_active is true, so do the LRZ invalidate before that. Fixes: 2f79e0066405 ("turnip: disable LRZ on vkCmdClearAttachments()") Signed-off-by: Jonathan Marek Part-of: --- src/freedreno/vulkan/tu_clear_blit.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/freedreno/vulkan/tu_clear_blit.c b/src/freedreno/vulkan/tu_clear_blit.c index 57b0f3ea89f..8c29fb39206 100644 --- a/src/freedreno/vulkan/tu_clear_blit.c +++ b/src/freedreno/vulkan/tu_clear_blit.c @@ -2244,6 +2244,13 @@ tu_CmdClearAttachments(VkCommandBuffer commandBuffer, */ tu_emit_cache_flush_renderpass(cmd, cs); + for (uint32_t j = 0; j < attachmentCount; j++) { + if ((pAttachments[j].aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) == 0) + continue; + cmd->state.lrz.valid = false; + cmd->state.dirty |= TU_CMD_DIRTY_LRZ; + } + /* vkCmdClearAttachments is supposed to respect the predicate if active. * The easiest way to do this is to always use the 3d path, which always * works even with GMEM because it's just a simple draw using the existing @@ -2267,13 +2274,6 @@ tu_CmdClearAttachments(VkCommandBuffer commandBuffer, tu_cond_exec_start(cs, CP_COND_EXEC_0_RENDER_MODE_SYSMEM); tu_clear_sysmem_attachments(cmd, attachmentCount, pAttachments, rectCount, pRects); tu_cond_exec_end(cs); - - for (uint32_t j = 0; j < attachmentCount; j++) { - if ((pAttachments[j].aspectMask & VK_IMAGE_ASPECT_DEPTH_BIT) == 0) - continue; - cmd->state.lrz.valid = false; - cmd->state.dirty |= TU_CMD_DIRTY_LRZ; - } } static void