Mesa (staging/22.1): nir: fix marking XFB varyings as always active IO

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 26 16:22:28 UTC 2022


Module: Mesa
Branch: staging/22.1
Commit: add1e87c4e2b456db9560238dce71b2163b8c284
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=add1e87c4e2b456db9560238dce71b2163b8c284

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
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 <samuel.pitoiset at gmail.com>
Reviewed-by: Timothy Arceri  <tarceri at itsqueeze.com>
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 57a83ba900c..bf94a516ecd 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -643,7 +643,7 @@
         "description": "nir: fix marking XFB varyings as always active IO",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/compiler/nir/nir_linking_helpers.c b/src/compiler/nir/nir_linking_helpers.c
index 187098cafe9..b0ddb36ec7d 100644
--- a/src/compiler/nir/nir_linking_helpers.c
+++ b/src/compiler/nir/nir_linking_helpers.c
@@ -957,14 +957,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;
       }
    }
 
@@ -976,8 +976,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;
          }
       }
    }



More information about the mesa-commit mailing list