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

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Jun 8 22:03:45 UTC 2022


Module: Mesa
Branch: main
Commit: 4655ff1f5b34d45c3d20e817488b70275c5b9c98
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4655ff1f5b34d45c3d20e817488b70275c5b9c98

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>

---

 src/compiler/nir/nir_deref.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index eb3a2352b3f..bb1bb91fdc7 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