From 5de91cfc04b4ce04ec03e0f3daac34e3334be995 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timur=20Krist=C3=B3f?= Date: Thu, 30 Sep 2021 14:09:29 +0200 Subject: [PATCH] ac/nir/nggc: Write undef to variables in non-repacked ES threads. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This helps the compiler generate a little bit more efficient code. Fossil DB stats on Sienna Cichlid with NGGC on: Totals from 4659 (3.62% of 128647) affected shaders: CodeSize: 7468320 -> 7404484 (-0.85%); split: -0.88%, +0.03% Instrs: 1423425 -> 1407454 (-1.12%); split: -1.16%, +0.03% Latency: 5250593 -> 5226163 (-0.47%); split: -0.47%, +0.00% InvThroughput: 739848 -> 733373 (-0.88%); split: -0.90%, +0.02% Copies: 200139 -> 190307 (-4.91%); split: -5.13%, +0.22% Branches: 87925 -> 85998 (-2.19%) Signed-off-by: Timur Kristóf Reviewed-by: Daniel Schürmann Part-of: --- src/amd/common/ac_nir_lower_ngg.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/amd/common/ac_nir_lower_ngg.c b/src/amd/common/ac_nir_lower_ngg.c index b2fdea1633d..9bf628381cc 100644 --- a/src/amd/common/ac_nir_lower_ngg.c +++ b/src/amd/common/ac_nir_lower_ngg.c @@ -730,6 +730,12 @@ compact_vertices_after_culling(nir_builder *b, nir_store_var(b, repacked_arg_vars[i], arg_val, 0x1u); } } + nir_push_else(b, if_packed_es_thread); + { + nir_store_var(b, position_value_var, nir_ssa_undef(b, 4, 32), 0xfu); + for (unsigned i = 0; i < max_exported_args; ++i) + nir_store_var(b, repacked_arg_vars[i], nir_ssa_undef(b, 1, 32), 0x1u); + } nir_pop_if(b, if_packed_es_thread); nir_if *if_gs_accepted = nir_push_if(b, nir_load_var(b, gs_accepted_var));