Mesa (main): ac/nir/nggc: Write undef to variables in non-repacked ES threads.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 12 16:54:24 UTC 2021


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

Author: Timur Kristóf <timur.kristof at gmail.com>
Date:   Thu Sep 30 14:09:29 2021 +0200

ac/nir/nggc: Write undef to variables in non-repacked ES threads.

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 <timur.kristof at gmail.com>
Reviewed-by: Daniel Schürmann <daniel at schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13121>

---

 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));



More information about the mesa-commit mailing list