diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index a2e381ec917..c6a45d82f31 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -5087,7 +5087,8 @@ nir_shader * nir_create_passthrough_tcs(const nir_shader_compiler_options *optio nir_shader * nir_create_passthrough_gs(const nir_shader_compiler_options *options, const nir_shader *prev_stage, enum shader_prim primitive_type, - bool emulate_edgeflags); + bool emulate_edgeflags, + bool force_line_strip_out); bool nir_lower_fragcolor(nir_shader *shader, unsigned max_cbufs); bool nir_lower_fragcoord_wtrans(nir_shader *shader); diff --git a/src/compiler/nir/nir_passthrough_gs.c b/src/compiler/nir/nir_passthrough_gs.c index c53e8f42971..c6b24ff6dec 100644 --- a/src/compiler/nir/nir_passthrough_gs.c +++ b/src/compiler/nir/nir_passthrough_gs.c @@ -129,18 +129,20 @@ nir_shader * nir_create_passthrough_gs(const nir_shader_compiler_options *options, const nir_shader *prev_stage, enum shader_prim primitive_type, - bool emulate_edgeflags) + bool emulate_edgeflags, + bool force_line_strip_out) { unsigned int vertices_out = vertices_for_prim(primitive_type); emulate_edgeflags = emulate_edgeflags && (prev_stage->info.outputs_written & VARYING_BIT_EDGE); - bool needs_closing = emulate_edgeflags && vertices_out >= 3; + bool needs_closing = (force_line_strip_out || emulate_edgeflags) && vertices_out >= 3; nir_builder b = nir_builder_init_simple_shader(MESA_SHADER_GEOMETRY, options, "gs passthrough"); nir_shader *nir = b.shader; nir->info.gs.input_primitive = gs_in_prim_for_topology(primitive_type); - nir->info.gs.output_primitive = emulate_edgeflags ? SHADER_PRIM_LINE_STRIP : gs_out_prim_for_topology(primitive_type); + nir->info.gs.output_primitive = (force_line_strip_out || emulate_edgeflags) ? + SHADER_PRIM_LINE_STRIP : gs_out_prim_for_topology(primitive_type); nir->info.gs.vertices_in = vertices_out; nir->info.gs.vertices_out = needs_closing ? vertices_out + 1 : vertices_out; nir->info.gs.invocations = 1; diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index 34f64a99db5..4046473ddf0 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -2253,7 +2253,8 @@ zink_set_primitive_emulation_keys(struct zink_context *ctx) &screen->nir_options, ctx->gfx_stages[prev_vertex_stage]->nir, ctx->gfx_pipeline_state.gfx_prim_mode, - lower_edge_flags); + lower_edge_flags, + false); 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; @@ -2287,7 +2288,8 @@ zink_create_primitive_emulation_gs(struct zink_context *ctx) &screen->nir_options, ctx->gfx_stages[prev_vertex_stage]->nir, ctx->gfx_pipeline_state.gfx_prim_mode, - lower_edge_flags); + lower_edge_flags, + false); 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;