Mesa (staging/21.2): nir/lower_vectorize_tess_levels: set num_components for vectorized loads

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 19 18:16:09 UTC 2021


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

Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date:   Tue Aug 17 14:04:16 2021 -0400

nir/lower_vectorize_tess_levels: set num_components for vectorized loads

this otherwise explodes when rewriting e.g., a single array component load to a vec4

Fixes: f5adf27fb92 ("nir,radv: add and use nir_vectorize_tess_levels()")

fixes zmike/mesa#94

Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12419>
(cherry picked from commit 649251ad4e031609dafd4034b802d292fea6131c)

---

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

diff --git a/.pick_status.json b/.pick_status.json
index 9823a8c4fe4..60ca7bedc89 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -112,7 +112,7 @@
         "description": "nir/lower_vectorize_tess_levels: set num_components for vectorized loads",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "f5adf27fb926a330a13af716f0a03da1a224656d"
     },
diff --git a/src/compiler/nir/nir_lower_io_to_vector.c b/src/compiler/nir/nir_lower_io_to_vector.c
index 433e5ccff10..13d692e72be 100644
--- a/src/compiler/nir/nir_lower_io_to_vector.c
+++ b/src/compiler/nir/nir_lower_io_to_vector.c
@@ -632,6 +632,7 @@ nir_vectorize_tess_levels_impl(nir_function_impl *impl)
          } else {
             b.cursor = nir_after_instr(instr);
             nir_ssa_def *val = &intrin->dest.ssa;
+            val->num_components = intrin->num_components;
             nir_ssa_def *comp = nir_channel(&b, val, index);
             nir_ssa_def_rewrite_uses_after(val, comp, comp->parent_instr);
          }



More information about the mesa-commit mailing list