Module: Mesa
Branch: staging/20.3
Commit: 29f1078c18ccbda104c78c46656de7b829ab4f52
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=29f1078c18ccbda104c78c46656de7b829ab4f52

Author: Marek Olšák <[email protected]>
Date:   Sat Nov 14 20:06:55 2020 -0500

nir: fix gathering patch IO usage with lowered IO

Fixes: 17af07024df - nir: gather all IO info from IO intrinsics

Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]>
Reviewed-by: Timur Kristóf <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7622>
(cherry picked from commit e78c089aae5789d2ad2698beb9f13c12736f7443)

---

 .pick_status.json                  |  2 +-
 src/compiler/nir/nir_gather_info.c | 12 ++++++++++++
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/.pick_status.json b/.pick_status.json
index 45c006b2ca9..1f6f869d2f3 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -328,7 +328,7 @@
         "description": "nir: fix gathering patch IO usage with lowered IO",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "17af07024dfc8302b37a270cea4ef3eae06fe5e2"
     },
diff --git a/src/compiler/nir/nir_gather_info.c 
b/src/compiler/nir/nir_gather_info.c
index c12dc0f6939..4f763f9029c 100644
--- a/src/compiler/nir/nir_gather_info.c
+++ b/src/compiler/nir/nir_gather_info.c
@@ -313,7 +313,19 @@ gather_intrinsic_info(nir_intrinsic_instr *instr, 
nir_shader *shader,
    if 
(nir_intrinsic_infos[instr->intrinsic].index_map[NIR_INTRINSIC_IO_SEMANTICS] > 
0) {
       nir_io_semantics semantics = nir_intrinsic_io_semantics(instr);
 
+      if (semantics.location >= VARYING_SLOT_PATCH0) {
+         /* Generic per-patch I/O. */
+         assert((shader->info.stage == MESA_SHADER_TESS_EVAL &&
+                 instr->intrinsic == nir_intrinsic_load_input) ||
+                (shader->info.stage == MESA_SHADER_TESS_CTRL &&
+                 (instr->intrinsic == nir_intrinsic_load_output ||
+                  instr->intrinsic == nir_intrinsic_store_output)));
+
+         semantics.location -= VARYING_SLOT_PATCH0;
+      }
+
       slot_mask = BITFIELD64_RANGE(semantics.location, semantics.num_slots);
+      assert(util_bitcount64(slot_mask) == semantics.num_slots);
    }
 
    switch (instr->intrinsic) {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to