Mesa (master): st/mesa: make use of nir_link_constant_varyings()

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Nov 10 00:43:40 UTC 2018


Module: Mesa
Branch: master
Commit: 590fcb50e745a2d8a62dafa157f06d2bb7c590dc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=590fcb50e745a2d8a62dafa157f06d2bb7c590dc

Author: Timothy Arceri <tarceri at itsqueeze.com>
Date:   Sat Nov 10 09:20:10 2018 +1100

st/mesa: make use of nir_link_constant_varyings()

Shader-db results radeonsi (VEGA):

Totals from affected shaders:
SGPRS: 161464 -> 161368 (-0.06 %)
VGPRS: 86904 -> 86292 (-0.70 %)
Spilled SGPRs: 296 -> 314 (6.08 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 3618596 -> 3573852 (-1.24 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 26189 -> 26276 (0.33 %)
Wait states: 0 -> 0 (0.00 %)

Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/state_tracker/st_glsl_to_nir.cpp | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp
index dcf8c2b638..d0475fb538 100644
--- a/src/mesa/state_tracker/st_glsl_to_nir.cpp
+++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp
@@ -588,6 +588,9 @@ st_nir_link_shaders(nir_shader **producer, nir_shader **consumer, bool scalar)
 {
    nir_lower_io_arrays_to_elements(*producer, *consumer);
 
+   if (nir_link_constant_varyings(*producer, *consumer))
+      st_nir_opts(*consumer, scalar);
+
    NIR_PASS_V(*producer, nir_remove_dead_variables, nir_var_shader_out);
    NIR_PASS_V(*consumer, nir_remove_dead_variables, nir_var_shader_in);
 




More information about the mesa-commit mailing list