mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-28 08:10:09 +01:00
nir: Support use_scoped_barrier in nir_lower_atomics_to_ssbo
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Acked-by: Rob Clark <robclark@freedesktop.org> Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
This commit is contained in:
parent
e45bbcf649
commit
1db7e6a261
1 changed files with 9 additions and 1 deletions
|
|
@ -65,7 +65,15 @@ lower_instr(nir_intrinsic_instr *instr, unsigned ssbo_offset, nir_builder *b, un
|
|||
/* Atomic counters are now SSBOs so memoryBarrierAtomicCounter() is now
|
||||
* memoryBarrierBuffer().
|
||||
*/
|
||||
instr->intrinsic = nir_intrinsic_memory_barrier_buffer;
|
||||
if (b->shader->options->use_scoped_barrier) {
|
||||
instr->intrinsic = nir_intrinsic_scoped_barrier;
|
||||
nir_intrinsic_set_execution_scope(instr, NIR_SCOPE_NONE);
|
||||
nir_intrinsic_set_memory_scope(instr, NIR_SCOPE_DEVICE);
|
||||
nir_intrinsic_set_memory_semantics(instr, NIR_MEMORY_ACQ_REL);
|
||||
nir_intrinsic_set_memory_modes(instr, nir_var_mem_ssbo);
|
||||
} else {
|
||||
instr->intrinsic = nir_intrinsic_memory_barrier_buffer;
|
||||
}
|
||||
return true;
|
||||
|
||||
case nir_intrinsic_atomic_counter_inc:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue