Mesa (staging/22.0): zink: unconditionally set line width on rasterizer state change

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Apr 21 22:22:06 UTC 2022


Module: Mesa
Branch: staging/22.0
Commit: 6e45a23b69f17aa6142074f975f7192232cf1f92
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6e45a23b69f17aa6142074f975f7192232cf1f92

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Thu Apr 14 16:18:10 2022 -0400

zink: unconditionally set line width on rasterizer state change

the pipe cap is used for gating wideline support, so this will always
be 1.0 when not supported

furthermore, the previous code wasn't accurately checking line width
for tess shaders, breaking tests

cc: mesa-stable

fixes (nv):
KHR-GL46.tessellation_shader.tessellation_control_to_tessellation_evaluation.gl_PatchVerticesIn

Reviewed-by: Dave Airlie <airlied at redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15960>
(cherry picked from commit d8b66fcbf9aba2ad2f69de8e45af4c3c8f2a8323)

---

 .pick_status.json                      |  2 +-
 src/gallium/drivers/zink/zink_draw.cpp | 26 +-------------------------
 2 files changed, 2 insertions(+), 26 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index f8f4a31ba03..93c780bd024 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -1372,7 +1372,7 @@
         "description": "zink: unconditionally set line width on rasterizer state change",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "because_sha": null
     },
     {
diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp
index 51d80a66844..ddd2e5e9a1e 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -240,25 +240,6 @@ update_gfx_program(struct zink_context *ctx)
    ctx->dirty_shader_stages &= ~bits;
 }
 
-static bool
-line_width_needed(enum pipe_prim_type reduced_prim,
-                  unsigned polygon_mode)
-{
-   switch (reduced_prim) {
-   case PIPE_PRIM_POINTS:
-      return false;
-
-   case PIPE_PRIM_LINES:
-      return true;
-
-   case PIPE_PRIM_TRIANGLES:
-      return polygon_mode == VK_POLYGON_MODE_LINE;
-
-   default:
-      unreachable("unexpected reduced prim");
-   }
-}
-
 ALWAYS_INLINE static void
 update_drawid(struct zink_context *ctx, unsigned draw_id)
 {
@@ -741,12 +722,7 @@ zink_draw(struct pipe_context *pctx,
          unreachable("unexpected reduced prim");
       }
 
-      if (line_width_needed(reduced_prim, rast_state->hw_state.polygon_mode)) {
-         if (screen->info.feats.features.wideLines || rast_state->line_width == 1.0f)
-            VKCTX(CmdSetLineWidth)(batch->state->cmdbuf, rast_state->line_width);
-         else
-            debug_printf("BUG: wide lines not supported, needs fallback!");
-      }
+      VKCTX(CmdSetLineWidth)(batch->state->cmdbuf, rast_state->line_width);
       if (depth_bias)
          VKCTX(CmdSetDepthBias)(batch->state->cmdbuf, rast_state->offset_units, rast_state->offset_clamp, rast_state->offset_scale);
       else



More information about the mesa-commit mailing list