From 7b2af9e15addfb130ba62e0009f28fd481ac1b30 Mon Sep 17 00:00:00 2001 From: Antonino Maniscalco Date: Fri, 29 Nov 2024 01:03:58 +0100 Subject: [PATCH] zink: don't care about generated gs output primitive Zink uses the output primitive of the last vertex stage when deciding the raster primitive. When we generate the gs the output primitive depends on the raster primitive. Not only does the generated gs output primitive have no value in chosing the raster primitive, it can also get us stuck with the last raster primitve which is of course incorrect. Ignore it for generated shaders. Cc: mesa-stable (cherry picked from commit d526bbc29b9bcdee415e93370cf81b3a1d0fb85f) Part-of: --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_program.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 96c8e2104d8..48e8ea99088 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -524,7 +524,7 @@ "description": "zink: don't care about generated gs output primitive", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/zink/zink_program.c b/src/gallium/drivers/zink/zink_program.c index ca2aa30442b..ca4a6f9d469 100644 --- a/src/gallium/drivers/zink/zink_program.c +++ b/src/gallium/drivers/zink/zink_program.c @@ -2119,6 +2119,10 @@ bind_last_vertex_stage(struct zink_context *ctx, mesa_shader_stage stage, struct ctx->last_vertex_stage ? update_rast_prim(ctx->last_vertex_stage) : MESA_PRIM_COUNT; + if (ctx->last_vertex_stage && ctx->last_vertex_stage->non_fs.is_generated) + ctx->gfx_pipeline_state.shader_rast_prim = MESA_PRIM_COUNT; + + if (old != current) { if (!zink_screen(ctx->base.screen)->optimal_keys) { if (old != MESA_SHADER_STAGES) {