From: Caio Marcelo de Oliveira Filho Date: Sat, 11 Jan 2020 01:33:31 +0000 (-0800) Subject: nir: Filter modes of scoped memory barrier in nir_opt_load_store_vectorize X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1a42e7dae944535ae63d1d5a16a015dd5524f954;p=mesa.git 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 Reviewed-by: Daniel Schürmann Part-of: --- 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)) {