Mesa (master): aco: Skip TCS s_barrier when VS outputs are not stored in the LDS.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 10 17:34:56 UTC 2020


Module: Mesa
Branch: master
Commit: a9a8e05b696ec756c87be7a0f5c7a0aafc310904
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a9a8e05b696ec756c87be7a0f5c7a0aafc310904

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Mon Nov 23 09:42:25 2020 +0100

aco: Skip TCS s_barrier when VS outputs are not stored in the LDS.

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 <timur.kristof at gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7727>

---

 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) {



More information about the mesa-commit mailing list