Mesa (main): turnip: Don't disable LRZ in subpasses after the first in the easy case.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Apr 19 19:07:29 UTC 2022
Module: Mesa
Branch: main
Commit: 550975f2298bcfbf565009e23d784cd5169a2089
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=550975f2298bcfbf565009e23d784cd5169a2089
Author: Emma Anholt <emma at anholt.net>
Date: Mon Apr 18 10:41:01 2022 -0700
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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15982>
---
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);
More information about the mesa-commit
mailing list