Mesa (master): nir: Allow SSBOs and global to alias

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Jan 26 22:15:40 UTC 2019


Module: Mesa
Branch: master
Commit: 9e34781aef3611bfcc3843694576c5972f0710fb
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9e34781aef3611bfcc3843694576c5972f0710fb

Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date:   Wed Jan 23 16:47:46 2019 -0600

nir: Allow SSBOs and global to alias

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

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

diff --git a/src/compiler/nir/nir_deref.c b/src/compiler/nir/nir_deref.c
index 513e8242d7..2f5fda643c 100644
--- a/src/compiler/nir/nir_deref.c
+++ b/src/compiler/nir/nir_deref.c
@@ -293,7 +293,12 @@ nir_fixup_deref_modes(nir_shader *shader)
 static bool
 modes_may_alias(nir_variable_mode a, nir_variable_mode b)
 {
-   /* Two pointers can only alias if they have the same mode.
+   /* Generic pointers can alias with SSBOs */
+   if ((a == nir_var_mem_ssbo || a == nir_var_mem_global) &&
+       (b == nir_var_mem_ssbo || b == nir_var_mem_global))
+      return true;
+
+   /* In the general case, pointers can only alias if they have the same mode.
     *
     * NOTE: In future, with things like OpenCL generic pointers, this may not
     * be true and will have to be re-evaluated.  However, with graphics only,




More information about the mesa-commit mailing list