Mesa (main): aco: don't skip VS->TCS barrier if TCS output vertices doesn't match input

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 23 10:42:58 UTC 2022


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

Author: Rhys Perry <pendingchaos02 at gmail.com>
Date:   Tue Jun 21 18:34:44 2022 +0100

aco: don't skip VS->TCS barrier if TCS output vertices doesn't match input

TCS invocations correspond to output patch vertices, not input. If they
differ, TCS invocations can be in a different subgroup than VS invocations
of the input patch.

Signed-off-by: Rhys Perry <pendingchaos02 at gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof at gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6564
Fixes: 152092b8ead ("aco: skip s_barrier if TCS patches are within subgroup")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17174>

---

 src/amd/compiler/aco_instruction_selection.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/amd/compiler/aco_instruction_selection.cpp b/src/amd/compiler/aco_instruction_selection.cpp
index bd027fadda6..e0a8a7b0821 100644
--- a/src/amd/compiler/aco_instruction_selection.cpp
+++ b/src/amd/compiler/aco_instruction_selection.cpp
@@ -11554,7 +11554,8 @@ select_program(Program* program, unsigned shader_count, struct nir_shader* const
          if (!ngg_gs && !tcs_skip_barrier) {
             sync_scope scope =
                ctx.stage == vertex_tess_control_hs &&
-                     program->wave_size % ctx.options->key.tcs.tess_input_vertices == 0
+                     program->wave_size % ctx.options->key.tcs.tess_input_vertices == 0 &&
+                     ctx.options->key.tcs.tess_input_vertices == nir->info.tess.tcs_vertices_out
                   ? scope_subgroup
                   : scope_workgroup;
             bld.barrier(aco_opcode::p_barrier,



More information about the mesa-commit mailing list