Mesa (main): zink: unconditionally set line width on rasterizer state change
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Apr 18 22:19:31 UTC 2022
Module: Mesa
Branch: main
Commit: d8b66fcbf9aba2ad2f69de8e45af4c3c8f2a8323
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8b66fcbf9aba2ad2f69de8e45af4c3c8f2a8323
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>
---
src/gallium/drivers/zink/zink_draw.cpp | 26 +-------------------------
1 file changed, 1 insertion(+), 25 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_draw.cpp b/src/gallium/drivers/zink/zink_draw.cpp
index 8f91fa459ac..da2b53742e6 100644
--- a/src/gallium/drivers/zink/zink_draw.cpp
+++ b/src/gallium/drivers/zink/zink_draw.cpp
@@ -239,25 +239,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)
{
@@ -745,12 +726,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