From a9a8e05b696ec756c87be7a0f5c7a0aafc310904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Mon, 23 Nov 2020 09:42:25 +0100 Subject: [PATCH] aco: Skip TCS s_barrier when VS outputs are not stored in the LDS. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When VS outputs are known to be never stored in LDS, there is no reason for HS waves to wait for all LS waves to complete. So, the s_barrier between the LS and HS can be safely skipped. Signed-off-by: Timur Kristóf Reviewed-by: Rhys Perry Part-of: --- src/amd/compiler/aco_instruction_selection.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp index 2bf1c1d79d1..9b736260a92 100644 --- a/src/amd/compiler/aco_instruction_selection.cpp +++ b/src/amd/compiler/aco_instruction_selection.cpp @@ -11793,7 +11793,11 @@ void select_program(Program *program, if (i) { Builder bld(ctx.program, ctx.block); - if (!ngg_gs) + /* Skip s_barrier from TCS when VS outputs are not stored in the LDS. */ + bool tcs_skip_barrier = ctx.stage == vertex_tess_control_hs && + ctx.tcs_temp_only_inputs == nir->info.inputs_read; + + if (!ngg_gs && !tcs_skip_barrier) create_workgroup_barrier(bld); if (ctx.stage == vertex_geometry_gs || ctx.stage == tess_eval_geometry_gs) {