From 550975f2298bcfbf565009e23d784cd5169a2089 Mon Sep 17 00:00:00 2001 From: Emma Anholt Date: Mon, 18 Apr 2022 10:41:01 -0700 Subject: [PATCH] turnip: Don't disable LRZ in subpasses after the first in the easy case. If it's the same depth/stencil attachment, then there's no need to turn off LRZ just because the subpass changed. Doesn't help gfxbench perf yet, but will with !16014. Part-of: --- src/freedreno/vulkan/tu_cmd_buffer.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index 3c0b3257fd3..e97765ccdc8 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -3374,6 +3374,7 @@ tu_CmdNextSubpass2(VkCommandBuffer commandBuffer, TU_FROM_HANDLE(tu_cmd_buffer, cmd, commandBuffer); const struct tu_render_pass *pass = cmd->state.pass; struct tu_cs *cs = &cmd->draw_cs; + const struct tu_subpass *last_subpass = cmd->state.subpass; const struct tu_subpass *subpass = cmd->state.subpass++; @@ -3382,8 +3383,10 @@ tu_CmdNextSubpass2(VkCommandBuffer commandBuffer, * TODO: Improve this tracking for keeping the state of the past depth/stencil images, * so if they become active again, we reuse its old state. */ - cmd->state.lrz.valid = false; - cmd->state.dirty |= TU_CMD_DIRTY_LRZ; + if (last_subpass->depth_stencil_attachment.attachment != subpass->depth_stencil_attachment.attachment) { + cmd->state.lrz.valid = false; + cmd->state.dirty |= TU_CMD_DIRTY_LRZ; + } tu_cond_exec_start(cs, CP_COND_EXEC_0_RENDER_MODE_GMEM);