From: Timothy Arceri Date: Fri, 9 Nov 2018 22:20:10 +0000 (+1100) Subject: st/mesa: make use of nir_link_constant_varyings() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=590fcb50e745a2d8a62dafa157f06d2bb7c590dc;p=mesa.git 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 --- diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index dcf8c2b638e..d0475fb538a 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);