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:
@@ -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
|
/* Atomic counters are now SSBOs so memoryBarrierAtomicCounter() is now
|
||||||
* memoryBarrierBuffer().
|
* 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;
|
return true;
|
||||||
|
|
||||||
case nir_intrinsic_atomic_counter_inc:
|
case nir_intrinsic_atomic_counter_inc:
|
||||||
|
Reference in New Issue
Block a user