aco: Skip TCS s_barrier when VS outputs are not stored in the LDS.
authorTimur Kristóf <timur.kristof@gmail.com>
Mon, 23 Nov 2020 08:42:25 +0000 (09:42 +0100)
committerMarge Bot <eric+marge@anholt.net>
Thu, 10 Dec 2020 17:23:16 +0000 (17:23 +0000)
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@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7727>

src/amd/compiler/aco_instruction_selection.cpp

index 2bf1c1d..9b73626 100644 (file)
@@ -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) {