diff --git a/src/amd/common/ac_nir.c b/src/amd/common/ac_nir.c index 2503f5acd0c..d06207804bd 100644 --- a/src/amd/common/ac_nir.c +++ b/src/amd/common/ac_nir.c @@ -250,10 +250,11 @@ ac_nir_export_position(nir_builder *b, * the pixel shader starts. */ if (gfx_level >= GFX10 && no_param_export && b->shader->info.writes_memory) { - nir_intrinsic_instr *wait_instr = - nir_intrinsic_instr_create(b->shader, nir_intrinsic_memory_barrier_buffer); - - nir_instr_insert_before(&final_exp->instr, &wait_instr->instr); + nir_cursor cursor = b->cursor; + b->cursor = nir_before_instr(&final_exp->instr); + nir_scoped_memory_barrier(b, NIR_SCOPE_DEVICE, NIR_MEMORY_RELEASE, + nir_var_mem_ssbo | nir_var_mem_global | nir_var_image); + b->cursor = cursor; } } diff --git a/src/amd/common/ac_nir_lower_ngg.c b/src/amd/common/ac_nir_lower_ngg.c index a5ab1d4c184..0799dbc9956 100644 --- a/src/amd/common/ac_nir_lower_ngg.c +++ b/src/amd/common/ac_nir_lower_ngg.c @@ -2012,6 +2012,7 @@ ngg_build_streamout_vertex(nir_builder *b, nir_xfb_info *info, vtx_buffer_offsets[out->buffer], zero, zero, .base = out->offset, + .memory_modes = nir_var_mem_ssbo, .access = ACCESS_NON_TEMPORAL); } } @@ -2071,7 +2072,7 @@ ngg_nogs_build_streamout(nir_builder *b, lower_ngg_nogs_state *s) * TODO: not sure if we need this barrier when late prim export, as I * can't observe test fail without this barrier. */ - nir_memory_barrier_buffer(b); + nir_scoped_memory_barrier(b, NIR_SCOPE_DEVICE, NIR_MEMORY_RELEASE, nir_var_mem_ssbo); } static unsigned