Module: Mesa Branch: staging/22.0 Commit: 20d9687931f5b9d9a06f685719f28e31a7753174 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=20d9687931f5b9d9a06f685719f28e31a7753174
Author: Samuel Pitoiset <[email protected]> Date: Fri Apr 22 09:50:16 2022 +0200 nir: fix marking XFB varyings as always active IO Components need to be handled, otherwise if a shader has two XFB varyings at the same location, only one will be marked as always active. Cc: mesa-stable Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Timothy Arceri <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16092> (cherry picked from commit 26f74f17d9be014e70f297a0af4143970347008e) --- .pick_status.json | 2 +- src/compiler/nir/nir_linking_helpers.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 193d0097df6..5b8697c247b 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -580,7 +580,7 @@ "description": "nir: fix marking XFB varyings as always active IO", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "because_sha": null }, { diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c index 69054398a14..50e1b372f60 100644 --- a/src/compiler/nir/nir_linking_helpers.c +++ b/src/compiler/nir/nir_linking_helpers.c @@ -955,14 +955,14 @@ nir_compact_varyings(nir_shader *producer, nir_shader *consumer, void nir_link_xfb_varyings(nir_shader *producer, nir_shader *consumer) { - nir_variable *input_vars[MAX_VARYING] = { 0 }; + nir_variable *input_vars[MAX_VARYING][4] = { 0 }; nir_foreach_shader_in_variable(var, consumer) { if (var->data.location >= VARYING_SLOT_VAR0 && var->data.location - VARYING_SLOT_VAR0 < MAX_VARYING) { unsigned location = var->data.location - VARYING_SLOT_VAR0; - input_vars[location] = var; + input_vars[location][var->data.location_frac] = var; } } @@ -974,8 +974,8 @@ nir_link_xfb_varyings(nir_shader *producer, nir_shader *consumer) continue; unsigned location = var->data.location - VARYING_SLOT_VAR0; - if (input_vars[location]) { - input_vars[location]->data.always_active_io = true; + if (input_vars[location][var->data.location_frac]) { + input_vars[location][var->data.location_frac]->data.always_active_io = true; } } }
