From 2a3dce1b59ae53795364e16b49d347e7316f8aab Mon Sep 17 00:00:00 2001 From: Rhys Perry Date: Thu, 20 Feb 2025 15:51:39 +0000 Subject: [PATCH] ac/nir: fix tess factor optimization when workgroup barriers are reduced MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rhys Perry Fixes: b49eab68a867 ("ac/nir: use s_sendmsg(HS_TESSFACTOR) to optimize writing tess factors for gfx11") Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12632 Reviewed-by: Samuel Pitoiset Reviewed-by: Marek Olšák Part-of: --- src/amd/common/nir/ac_nir_lower_tess_io_to_mem.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/amd/common/nir/ac_nir_lower_tess_io_to_mem.c b/src/amd/common/nir/ac_nir_lower_tess_io_to_mem.c index f535a1a705f..9e2468db53b 100644 --- a/src/amd/common/nir/ac_nir_lower_tess_io_to_mem.c +++ b/src/amd/common/nir/ac_nir_lower_tess_io_to_mem.c @@ -832,9 +832,10 @@ hs_msg_group_vote_use_memory(nir_builder *b, lower_tess_io_state *st, nir_pop_if(&top_b, thread0); /* Insert a barrier to wait for initialization above if there hasn't been any other barrier - * in the shader. + * in the shader. If tcs_out_patch_fits_subgroup=true, then TCS barriers don't have a scope + * larger than a subgroup. */ - if (!st->tcs_info.always_executes_barrier) { + if (!st->tcs_info.always_executes_barrier || st->tcs_out_patch_fits_subgroup) { nir_barrier(b, .execution_scope = SCOPE_WORKGROUP, .memory_scope = SCOPE_WORKGROUP, .memory_semantics = NIR_MEMORY_ACQ_REL, .memory_modes = nir_var_mem_shared); }