From: Jason Ekstrand Date: Tue, 7 Jan 2020 20:13:43 +0000 (-0600) Subject: nir: Handle barriers with more granularity in combine_stores X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3498ab98f5ae9332d0ea8f312ecbc411ff1843c8;p=mesa.git nir: Handle barriers with more granularity in combine_stores Reviewed-by: Caio Marcelo de Oliveira Filho Part-of: --- diff --git a/src/compiler/nir/nir_opt_combine_stores.c b/src/compiler/nir/nir_opt_combine_stores.c index c59f3ed9936..6bd2c534971 100644 --- a/src/compiler/nir/nir_opt_combine_stores.c +++ b/src/compiler/nir/nir_opt_combine_stores.c @@ -306,16 +306,20 @@ combine_stores_block(struct combine_stores_state *state, nir_block *block) case nir_intrinsic_barrier: case nir_intrinsic_group_memory_barrier: case nir_intrinsic_memory_barrier: - case nir_intrinsic_memory_barrier_atomic_counter: - case nir_intrinsic_memory_barrier_buffer: - case nir_intrinsic_memory_barrier_image: - case nir_intrinsic_memory_barrier_shared: - /* TODO: Be more granular depending on the barrier. */ combine_stores_with_modes(state, nir_var_shader_out | nir_var_mem_ssbo | nir_var_mem_shared); break; + case nir_intrinsic_memory_barrier_atomic_counter: + case nir_intrinsic_memory_barrier_buffer: + combine_stores_with_modes(state, nir_var_mem_ssbo); + break; + + case nir_intrinsic_memory_barrier_shared: + combine_stores_with_modes(state, nir_var_mem_shared); + break; + case nir_intrinsic_scoped_memory_barrier: if (nir_intrinsic_memory_semantics(intrin) & NIR_MEMORY_RELEASE) { combine_stores_with_modes(state,