Module: Mesa
Branch: main
Commit: 25314996d058629ff9d669fe917741c29222b35b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=25314996d058629ff9d669fe917741c29222b35b

Author: Timur Kristóf <[email protected]>
Date:   Mon May 17 14:00:58 2021 +0200

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 <[email protected]>
Reviewed-by: Rhys Perry <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10837>

---

 src/amd/vulkan/radv_nir_to_llvm.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/amd/vulkan/radv_nir_to_llvm.c 
b/src/amd/vulkan/radv_nir_to_llvm.c
index b2c22a37b1e..caccff0b097 100644
--- a/src/amd/vulkan/radv_nir_to_llvm.c
+++ b/src/amd/vulkan/radv_nir_to_llvm.c
@@ -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) {

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to