From 9aa5c38e8d6f9414986491a4c45bb5b188849c8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Tue, 16 Jul 2024 14:02:49 +0200 Subject: [PATCH] ac/nir/tess: Don't emit VS outputs that aren't read by TCS. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is necessary to prevent a regression from a future commit, in order to allow us to map output locations differently. Signed-off-by: Timur Kristóf Reviewed-by: Alyssa Rosenzweig Reviewed-by: Marek Olšák Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/common/ac_nir_lower_tess_io_to_mem.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/amd/common/ac_nir_lower_tess_io_to_mem.c b/src/amd/common/ac_nir_lower_tess_io_to_mem.c index 1adfd8ba097..8c56e0d8cf5 100644 --- a/src/amd/common/ac_nir_lower_tess_io_to_mem.c +++ b/src/amd/common/ac_nir_lower_tess_io_to_mem.c @@ -271,6 +271,12 @@ lower_ls_output_store(nir_builder *b, lower_tess_io_state *st = (lower_tess_io_state *) state; + /* When a VS output isn't read by TCS, don't emit anything. */ + if ((io_sem.no_varying || !(st->tcs_inputs_read & BITFIELD64_BIT(io_sem.location)))) { + nir_instr_remove(&intrin->instr); + return true; + } + /* If this is a temp-only TCS input, we don't need to use shared memory at all. */ if (st->tcs_temp_only_inputs & BITFIELD64_BIT(io_sem.location)) return false;