Mesa (staging/22.1): nir/deref: Handle RESTRICT for SSBO deref bindings

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 16 21:43:16 UTC 2022


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

Author: Jason Ekstrand <jason.ekstrand at collabora.com>
Date:   Mon Jun  6 12:29:15 2022 -0500

nir/deref: Handle RESTRICT for SSBO deref bindings

Tested-by: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Reviewed-by: M Henning <drawoc at darkrefraction.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Cc: mesa-stable at lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16894>
(cherry picked from commit 4655ff1f5b34d45c3d20e817488b70275c5b9c98)

---

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

diff --git a/.pick_status.json b/.pick_status.json
index 568f24a7164..fcfc5b8836a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -3973,7 +3973,7 @@
         "description": "nir/deref: Handle RESTRICT for SSBO deref bindings",
         "nominated": true,
         "nomination_type": 0,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": null
     },
diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 7864ae3198f..640a751cc6a 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -612,7 +612,9 @@ nir_compare_deref_paths(nir_deref_path *a_path,
          /* If the binding derefs can't alias and at least one is RESTRICT,
           * then we know they can't alias.
           */
-         if (!(binding_compare & nir_derefs_may_alias_bit))
+         if (!(binding_compare & nir_derefs_may_alias_bit) &&
+             ((a_var->data.access & ACCESS_RESTRICT) ||
+              (b_var->data.access & ACCESS_RESTRICT)))
             return nir_derefs_do_not_alias;
 
          return nir_derefs_may_alias_bit;



More information about the mesa-commit mailing list