From 4655ff1f5b34d45c3d20e817488b70275c5b9c98 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Mon, 6 Jun 2022 12:29:15 -0500 Subject: [PATCH] nir/deref: Handle RESTRICT for SSBO deref bindings Tested-by: Mike Blumenkrantz Reviewed-by: M Henning Reviewed-by: Rhys Perry Cc: mesa-stable@lists.freedesktop.org Part-of: --- 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;