From dba29a33a1b4dbb79fcc7a4014147076730c9fca Mon Sep 17 00:00:00 2001 From: antonino Date: Tue, 4 Apr 2023 12:20:37 +0200 Subject: [PATCH] zink: fix pv mode lowring index calculation The provoking vertex mode pass was calculating an offset and then using it directly instead of adding it to the base index. Fixes: 5a4083349f3 ("zink: add provoking vertex mode lowering") Reviewed-by: Erik Faye-Lund Part-of: (cherry picked from commit 436dacf75410144589abb835c2906e1a149abffb) --- .pick_status.json | 2 +- src/gallium/drivers/zink/zink_compiler.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.pick_status.json b/.pick_status.json index 2ab965494ee..fe0070360a9 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -256,7 +256,7 @@ "description": "zink: fix pv mode lowring index calculation", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "5a4083349f36ef6db36a962327de6952a30d0c92" }, diff --git a/src/gallium/drivers/zink/zink_compiler.c b/src/gallium/drivers/zink/zink_compiler.c index c98c851bf3a..8f5e8058029 100644 --- a/src/gallium/drivers/zink/zink_compiler.c +++ b/src/gallium/drivers/zink/zink_compiler.c @@ -470,6 +470,7 @@ lower_pv_mode_emit_rotated_prim(nir_builder *b, else if (state->prim == ZINK_PVE_PRIMITIVE_FAN) rotated_i = nir_imod(b, nir_iadd_imm(b, rotated_i, 2), three); + rotated_i = nir_iadd(b, rotated_i, current_vertex); nir_foreach_variable_with_modes(var, b->shader, nir_var_shader_out) { gl_varying_slot location = var->data.location; if (state->varyings[location]) {