radv/llvm: Emit s_barrier at the beginning of NGG non-GS shaders.

This is to fix a hang that can potentially happen when not every
wave had launched when a gs_alloc_req is executed.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10837>
This commit is contained in:
Timur Kristóf
2021-05-17 14:00:58 +02:00
committed by Marge Bot
parent d970fe2e9d
commit 25314996d0

View File

@@ -3077,6 +3077,10 @@ ac_translate_nir_to_llvm(struct ac_llvm_compiler *ac_llvm, struct nir_shader *co
LLVMSetInitializer(ctx.gs_ngg_scratch, LLVMGetUndef(asi32));
LLVMSetAlignment(ctx.gs_ngg_scratch, 4);
}
/* GFX10 hang workaround - there needs to be an s_barrier before gs_alloc_req always */
if (ctx.ac.chip_class == GFX10 && shader_count == 1)
ac_build_s_barrier(&ctx.ac);
}
for (int shader_idx = 0; shader_idx < shader_count; ++shader_idx) {