Mesa (main): aco/gfx10: Emit barrier at the start of NGG VS and TES.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Jun 22 14:52:11 UTC 2021
Module: Mesa
Branch: main
Commit: e6bf5cfe59bfc19124785d39ab25584bfbf07f5e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e6bf5cfe59bfc19124785d39ab25584bfbf07f5e
Author: Timur Kristóf <timur.kristof at gmail.com>
Date: Sat Jun 19 14:36:15 2021 +0200
aco/gfx10: Emit barrier at the start of NGG VS and TES.
The Navi 1x NGG hardware can hang in certain conditions when
not every wave launched before s_sendmsg(GS_ALLOC_REQ).
As a workaround, to ensure this never happens, let's emit a
workgroup barrier at the beginning of NGG VS and TES.
Note that NGG GS already has a workgroup barrier so it doesn't
need this.
Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10837>
---
src/amd/compiler/aco_instruction_selection.cpp | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index 34cad69b868..06ca0910b99 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -11290,6 +11290,13 @@ void select_program(Program *program,
bool check_merged_wave_info = ctx.tcs_in_out_eq ? i == 0 : (shader_count >= 2 && !empty_shader && !(ngg_gs && i == 1));
bool endif_merged_wave_info = ctx.tcs_in_out_eq ? i == 1 : (check_merged_wave_info && !(ngg_gs && i == 1));
+ if (program->chip_class == GFX10 &&
+ program->stage.hw == HWStage::NGG &&
+ program->stage.num_sw_stages() == 1) {
+ /* Workaround for Navi 1x HW bug to ensure all NGG waves launch before s_sendmsg(GS_ALLOC_REQ). */
+ Builder(ctx.program, ctx.block).sopp(aco_opcode::s_barrier, -1u, 0u);
+ }
+
if (check_merged_wave_info) {
Temp cond = merged_wave_info_to_mask(&ctx, i);
begin_divergent_if_then(&ctx, &ic_merged_wave_info, cond);
More information about the mesa-commit
mailing list