From: Timothy Arceri Date: Tue, 11 Dec 2018 04:06:37 +0000 (+1100) Subject: st/glsl_to_nir: call nir_lower_load_const_to_scalar() in the st X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0a4378ce562dbf68b7b58165f2dcfc94f831559f;p=mesa.git st/glsl_to_nir: call nir_lower_load_const_to_scalar() in the st This will help the new opt introduced in the following patches allowing us to remove extra duplicate varyings. Tested-by: Dieter Nützel Reviewed-by: Marek Olšák Reviewed-by: Eric Anholt --- diff --git a/src/gallium/drivers/radeonsi/si_shader_nir.c b/src/gallium/drivers/radeonsi/si_shader_nir.c index 37fa81f3f40..4c6eb8ec808 100644 --- a/src/gallium/drivers/radeonsi/si_shader_nir.c +++ b/src/gallium/drivers/radeonsi/si_shader_nir.c @@ -816,8 +816,6 @@ si_lower_nir(struct si_shader_selector* sel) ac_lower_indirect_derefs(sel->nir, sel->screen->info.chip_class); - NIR_PASS_V(sel->nir, nir_lower_load_const_to_scalar); - bool progress; do { progress = false; diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 14927c8a4a9..dce96ab58b6 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -702,8 +702,10 @@ st_link_nir(struct gl_context *ctx, nir_shader *nir = shader->Program->nir; - if (is_scalar[i]) + if (is_scalar[i]) { NIR_PASS_V(nir, nir_lower_io_to_scalar_early, mask); + NIR_PASS_V(nir, nir_lower_load_const_to_scalar); + } st_nir_opts(nir, is_scalar[i]); }