zink: don't flag rp layout check on next draw when rp optimizing
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fri, 17 Mar 2023 17:00:56 +0000 (13:00 -0400)
committerMarge Bot <emma+marge@anholt.net>
Mon, 20 Mar 2023 18:24:07 +0000 (18:24 +0000)
this will always be a no-op, so save the cpu cycles

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21988>

src/gallium/drivers/zink/zink_state.c

index 4f472a5..3bdec2b 100644 (file)
@@ -525,10 +525,12 @@ zink_bind_depth_stencil_alpha_state(struct pipe_context *pctx, void *cso)
       if (!zink_screen(ctx->base.screen)->driver_workarounds.track_renderpasses && !ctx->blitting)
          zink_parse_tc_info(ctx);
    }
-   bool zs_write = ctx->dsa_state ? ctx->dsa_state->hw_state.depth_write || ctx->dsa_state->hw_state.stencil_test : false;
-   if (prev_zswrite != zs_write) {
-      /* flag renderpass for re-check on next draw */
-      ctx->rp_layout_changed = true;
+   if (!zink_screen(ctx->base.screen)->driver_workarounds.track_renderpasses && !ctx->blitting) {
+      bool zs_write = ctx->dsa_state ? ctx->dsa_state->hw_state.depth_write || ctx->dsa_state->hw_state.stencil_test : false;
+      if (prev_zswrite != zs_write) {
+         /* flag renderpass for re-check on next draw */
+         ctx->rp_layout_changed = true;
+      }
    }
 }