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

Author: Caio Marcelo de Oliveira Filho <caio.olive...@intel.com>
Date:   Fri Jan 10 17:33:31 2020 -0800

nir: Filter modes of scoped memory barrier in nir_opt_load_store_vectorize

Otherwise a scoped memory barrier containing nir_var_mem_ubo (which
memoryBarrier() does lower to) would incorrectly prevent the
optimization to happen in UBOs.

Reviewed-by: Rhys Perry <pendingchao...@gmail.com>
Reviewed-by: Daniel Schürmann <dan...@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5980>

---

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

diff --git a/src/compiler/nir/nir_opt_load_store_vectorize.c 
b/src/compiler/nir/nir_opt_load_store_vectorize.c
index f9b6774aa4e..96c9eb41cee 100644
--- a/src/compiler/nir/nir_opt_load_store_vectorize.c
+++ b/src/compiler/nir/nir_opt_load_store_vectorize.c
@@ -1229,7 +1229,9 @@ handle_barrier(struct vectorize_ctx *ctx, bool *progress, 
nir_function_impl *imp
         if (nir_intrinsic_memory_scope(intrin) == NIR_SCOPE_NONE)
             break;
 
-         modes = nir_intrinsic_memory_modes(intrin);
+         modes = nir_intrinsic_memory_modes(intrin) & (nir_var_mem_ssbo |
+                                                       nir_var_mem_shared |
+                                                       nir_var_mem_global);
          acquire = nir_intrinsic_memory_semantics(intrin) & NIR_MEMORY_ACQUIRE;
          release = nir_intrinsic_memory_semantics(intrin) & NIR_MEMORY_RELEASE;
          switch (nir_intrinsic_memory_scope(intrin)) {

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to