zink: clean up rp update tracking on dsa bind
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Thu, 8 Jun 2023 17:54:26 +0000 (13:54 -0400)
committerMarge Bot <emma+marge@anholt.net>
Wed, 21 Jun 2023 22:43:47 +0000 (22:43 +0000)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23758>

src/gallium/drivers/zink/zink_state.c

index 404d266..ebccd79 100644 (file)
@@ -514,6 +514,7 @@ zink_bind_depth_stencil_alpha_state(struct pipe_context *pctx, void *cso)
 {
    struct zink_context *ctx = zink_context(pctx);
 
+   bool prev_zsread = ctx->dsa_state ? ctx->dsa_state->hw_state.depth_test || ctx->dsa_state->hw_state.stencil_test : false;
    bool prev_zswrite = ctx->dsa_state ? ctx->dsa_state->hw_state.depth_write || ctx->dsa_state->hw_state.stencil_test : false;
    zink_flush_dgc_if_enabled(ctx);
    ctx->dsa_state = cso;
@@ -525,15 +526,12 @@ zink_bind_depth_stencil_alpha_state(struct pipe_context *pctx, void *cso)
          state->dirty |= !zink_screen(pctx->screen)->info.have_EXT_extended_dynamic_state;
          ctx->dsa_state_changed = true;
       }
-      if (!ctx->track_renderpasses && !ctx->blitting)
-         zink_parse_tc_info(ctx);
    }
    if (!ctx->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;
-      }
+      bool zs_read = ctx->dsa_state ? ctx->dsa_state->hw_state.depth_test || ctx->dsa_state->hw_state.stencil_test : false;
+      if (prev_zswrite != zs_write || prev_zsread != zs_read)
+         zink_parse_tc_info(ctx);
    }
 }