diff options
author | Jason Ekstrand <[email protected]> | 2020-01-07 19:22:13 -0600 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-13 17:23:47 +0000 |
commit | d3737002eed280ac6362a88f29d6c30d66a1e852 (patch) | |
tree | 51eb4726f8654b07a5e31cf7a758413950542be5 /src/compiler | |
parent | e40b11bbcb02dde1a8f989ca6545e22414c6f4ce (diff) |
nir/lower_atomics_to_ssbo: Also lower barriers
This is more correct for a pass which is supposed to completely lower
away atomic counters. It also lets us stop supporting atomic counter
barriers in most of the drivers.
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3307>
Diffstat (limited to 'src/compiler')
-rw-r--r-- | src/compiler/nir/nir_lower_atomics_to_ssbo.c | 7 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_combine_stores.c | 1 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_copy_prop_vars.c | 1 | ||||
-rw-r--r-- | src/compiler/nir/nir_opt_dead_write_vars.c | 1 |
4 files changed, 7 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_lower_atomics_to_ssbo.c b/src/compiler/nir/nir_lower_atomics_to_ssbo.c index 918f060a8df..7ff0123b7bb 100644 --- a/src/compiler/nir/nir_lower_atomics_to_ssbo.c +++ b/src/compiler/nir/nir_lower_atomics_to_ssbo.c @@ -47,6 +47,13 @@ lower_instr(nir_intrinsic_instr *instr, unsigned ssbo_offset, nir_builder *b) b->cursor = nir_before_instr(&instr->instr); switch (instr->intrinsic) { + case nir_intrinsic_memory_barrier_atomic_counter: + /* Atomic counters are now SSBOs so memoryBarrierAtomicCounter() is now + * memoryBarrierBuffer(). + */ + instr->intrinsic = nir_intrinsic_memory_barrier_buffer; + return true; + case nir_intrinsic_ssbo_atomic_add: case nir_intrinsic_ssbo_atomic_imin: case nir_intrinsic_ssbo_atomic_umin: diff --git a/src/compiler/nir/nir_opt_combine_stores.c b/src/compiler/nir/nir_opt_combine_stores.c index 791ec094c00..285a2564a95 100644 --- a/src/compiler/nir/nir_opt_combine_stores.c +++ b/src/compiler/nir/nir_opt_combine_stores.c @@ -311,7 +311,6 @@ combine_stores_block(struct combine_stores_state *state, nir_block *block) 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; diff --git a/src/compiler/nir/nir_opt_copy_prop_vars.c b/src/compiler/nir/nir_opt_copy_prop_vars.c index dbce55bfb8c..54fbad221a7 100644 --- a/src/compiler/nir/nir_opt_copy_prop_vars.c +++ b/src/compiler/nir/nir_opt_copy_prop_vars.c @@ -808,7 +808,6 @@ copy_prop_vars_block(struct copy_prop_var_state *state, break; case nir_intrinsic_memory_barrier_buffer: - case nir_intrinsic_memory_barrier_atomic_counter: if (debug) dump_instr(instr); apply_barrier_for_modes(copies, nir_var_mem_ssbo); diff --git a/src/compiler/nir/nir_opt_dead_write_vars.c b/src/compiler/nir/nir_opt_dead_write_vars.c index 578e8706818..0980647c63d 100644 --- a/src/compiler/nir/nir_opt_dead_write_vars.c +++ b/src/compiler/nir/nir_opt_dead_write_vars.c @@ -140,7 +140,6 @@ remove_dead_write_vars_local(void *mem_ctx, nir_block *block) } case nir_intrinsic_memory_barrier_buffer: - case nir_intrinsic_memory_barrier_atomic_counter: clear_unused_for_modes(&unused_writes, nir_var_mem_ssbo); break; |