mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
agx: handle cross-workgroup memory barriers
there's no prior art for this, but experimentally this seems to do the right thing. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29179>
This commit is contained in:
parent
c22ce3cab9
commit
a948244058
1 changed files with 13 additions and 1 deletions
|
|
@ -1341,9 +1341,21 @@ agx_emit_intrinsic(agx_builder *b, nir_intrinsic_instr *instr)
|
|||
if (nir_intrinsic_memory_scope(instr) != SCOPE_NONE) {
|
||||
nir_variable_mode modes = nir_intrinsic_memory_modes(instr);
|
||||
|
||||
if (modes & (nir_var_mem_global | nir_var_image))
|
||||
if (modes & (nir_var_mem_global | nir_var_image)) {
|
||||
agx_memory_barrier(b);
|
||||
|
||||
/* Pull out all the big hammers to make cross-workgroup memory
|
||||
* barriers work. Found experimentally, seems to work on G13G at
|
||||
* least.
|
||||
*
|
||||
* TODO: check on other models, we may need more barriers for G13D.
|
||||
*/
|
||||
if (nir_intrinsic_memory_scope(instr) >= SCOPE_QUEUE_FAMILY) {
|
||||
agx_memory_barrier_2(b);
|
||||
agx_unknown_barrier_1(b);
|
||||
}
|
||||
}
|
||||
|
||||
if (modes & nir_var_image) {
|
||||
agx_image_barrier_1(b);
|
||||
agx_image_barrier_2(b);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue