From 6fc2622abd3c4d66742437e6fd4d8757ff65d74d Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Tue, 21 Jun 2022 18:34:44 +0100 Subject: [PATCH] aco: don't skip VS->TCS barrier if TCS output vertices doesn't match input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-by: Timur Kristóf Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6564 Fixes: 152092b8ead ("aco: skip s_barrier if TCS patches are within subgroup") Part-of: --- 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,