Mesa (staging/21.0): nir/lower_clip_disable: Fix store writemask

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Apr 27 16:37:52 UTC 2021


Module: Mesa
Branch: staging/21.0
Commit: 54c43b140068e8851798b89ba61cec68f77e5421
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=54c43b140068e8851798b89ba61cec68f77e5421

Author: Connor Abbott <cwabbott0 at gmail.com>
Date:   Thu Apr 22 11:58:35 2021 +0200

nir/lower_clip_disable: Fix store writemask

We're storing into the array element, not the whole variable.

Fixes: fb2fe80 ("nir: add lowering pass for clip plane enabling")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7274>
(cherry picked from commit 77fcb01f7f0e9301c994fbae71f8019b32e012db)

---

 .pick_status.json                         | 2 +-
 src/compiler/nir/nir_lower_clip_disable.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 144c28002e7..eacfb84573a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -607,7 +607,7 @@
         "description": "nir/lower_clip_disable: Fix store writemask",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "master_sha": null,
         "because_sha": "fb2fe802f638d7a70f0d00ec1d496f317d241765"
     },
diff --git a/src/compiler/nir/nir_lower_clip_disable.c b/src/compiler/nir/nir_lower_clip_disable.c
index 6c5958e51de..19f818eff7c 100644
--- a/src/compiler/nir/nir_lower_clip_disable.c
+++ b/src/compiler/nir/nir_lower_clip_disable.c
@@ -101,7 +101,8 @@ lower_clip_plane_store(nir_intrinsic_instr *instr, unsigned clip_plane_enable, n
       if (clip_plane_enable & (1 << plane))
          return false;
 
-      nir_store_deref(b, deref, nir_imm_int(b, 0), 1 << plane);
+      assert(nir_intrinsic_write_mask(instr) == 1);
+      nir_store_deref(b, deref, nir_imm_int(b, 0), 1);
    } else {
       /* storing using a variable index */
       nir_ssa_def *index = nir_ssa_for_src(b, deref->arr.index, 1);



More information about the mesa-commit mailing list