From 0cb81ac38c20edf40c4aa0edcff4633d0bb6b767 Mon Sep 17 00:00:00 2001 From: antonino Date: Fri, 3 Feb 2023 15:43:09 +0100 Subject: [PATCH] zink: force line strip out when emulating stipple Fixes a bug where, whenever a primtiive that has more than 2 vertices is rendered with line stipple, the edge between the first and last vertex will have stretched out stipple. This happens because interpolation will occur between two non consecutive stipple counters for the last edge (which is between the last and first vertices). Forcing `nir_create_passthrough_gs` to generate a line strip avoids this because the last vertex will be duplicated and will have the correct stipple counter for each edge. Reviewed-by: Mike Blumenkrantz Reviewed-by: Erik Faye-Lund Part-of: --- src/gallium/drivers/zink/zink_program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 4046473..d1f4184 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -2254,7 +2254,7 @@ zink_set_primitive_emulation_keys(struct zink_context *ctx) ctx->gfx_stages[prev_vertex_stage]->nir, ctx->gfx_pipeline_state.gfx_prim_mode, lower_edge_flags, - false); + lower_line_stipple); struct zink_shader *shader = zink_shader_create(screen, nir, NULL); ctx->gfx_stages[prev_vertex_stage]->non_fs.generated_gs[ctx->gfx_pipeline_state.gfx_prim_mode] = shader; -- 2.7.4