Mesa (main): zink: stop flagging pipeline dirty for line width changes

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Jul 20 00:37:34 UTC 2021


Module: Mesa
Branch: main
Commit: c6d268d1a0f1a1bed8603e711b4562443803602a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6d268d1a0f1a1bed8603e711b4562443803602a

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue May 11 16:04:35 2021 -0400

zink: stop flagging pipeline dirty for line width changes

this is a dynamic state, it's already out of the pipeline hash

also don't store to ctx

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11964>

---

 src/gallium/drivers/zink/zink_context.h | 1 -
 src/gallium/drivers/zink/zink_draw.cpp  | 4 ++--
 src/gallium/drivers/zink/zink_state.c   | 4 ----
 3 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/zink/zink_context.h b/src/gallium/drivers/zink/zink_context.h
index bff7f1ac381..f017ea6d2b7 100644
--- a/src/gallium/drivers/zink/zink_context.h
+++ b/src/gallium/drivers/zink/zink_context.h
@@ -234,7 +234,6 @@ struct zink_context {
    bool vp_state_changed;
    bool scissor_changed;
 
-   float line_width;
    float blend_constants[4];
 
    bool sample_locations_changed;
diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp
index 8d0cbb1c208..cfeffd741b7 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -620,8 +620,8 @@ zink_draw_vbo(struct pipe_context *pctx,
       }
 
       if (line_width_needed(reduced_prim, rast_state->hw_state.polygon_mode)) {
-         if (screen->info.feats.features.wideLines || ctx->line_width == 1.0f)
-            vkCmdSetLineWidth(batch->state->cmdbuf, ctx->line_width);
+         if (screen->info.feats.features.wideLines || rast_state->line_width == 1.0f)
+            vkCmdSetLineWidth(batch->state->cmdbuf, rast_state->line_width);
          else
             debug_printf("BUG: wide lines not supported, needs fallback!");
       }
diff --git a/src/gallium/drivers/zink/zink_state.c b/src/gallium/drivers/zink/zink_state.c
index 3953d4b5cc5..3fc7fde9b71 100644
--- a/src/gallium/drivers/zink/zink_state.c
+++ b/src/gallium/drivers/zink/zink_state.c
@@ -550,10 +550,6 @@ zink_bind_rasterizer_state(struct pipe_context *pctx, void *cso)
          ctx->gfx_pipeline_state.front_face = ctx->rast_state->front_face;
          ctx->gfx_pipeline_state.dirty |= !zink_screen(pctx->screen)->info.have_EXT_extended_dynamic_state;
       }
-      if (ctx->line_width != ctx->rast_state->line_width) {
-         ctx->line_width = ctx->rast_state->line_width;
-         ctx->gfx_pipeline_state.dirty = true;
-      }
       if (ctx->rast_state->base.point_quad_rasterization != point_quad_rasterization)
          ctx->dirty_shader_stages |= BITFIELD_BIT(PIPE_SHADER_FRAGMENT);
       if (ctx->rast_state->base.scissor != scissor)



More information about the mesa-commit mailing list