diff --git a/src/compiler/glsl/gl_nir_linker.c b/src/compiler/glsl/gl_nir_linker.c index d5ed4b10e44..35eb9c26c97 100644 --- a/src/compiler/glsl/gl_nir_linker.c +++ b/src/compiler/glsl/gl_nir_linker.c @@ -102,23 +102,6 @@ gl_nir_opts(nir_shader *nir) NIR_PASS(progress, nir, nir_opt_algebraic); NIR_PASS(progress, nir, nir_opt_constant_folding); - if (!nir->info.flrp_lowered) { - unsigned lower_flrp = - (nir->options->lower_flrp16 ? 16 : 0) | - (nir->options->lower_flrp32 ? 32 : 0) | - (nir->options->lower_flrp64 ? 64 : 0); - - if (lower_flrp) { - NIR_PASS(progress, nir, nir_lower_flrp, - lower_flrp, false /* always_precise */); - } - - /* Nothing should rematerialize any flrps, so we only need to do this - * lowering once. - */ - nir->info.flrp_lowered = true; - } - NIR_PASS(progress, nir, nir_opt_undef); peephole_select_options = (nir_opt_peephole_select_options){ @@ -133,6 +116,16 @@ gl_nir_opts(nir_shader *nir) } } while (progress); + unsigned lower_flrp = + (nir->options->lower_flrp16 ? 16 : 0) | + (nir->options->lower_flrp32 ? 32 : 0) | + (nir->options->lower_flrp64 ? 64 : 0); + + if (lower_flrp) { + NIR_PASS(progress, nir, nir_lower_flrp, + lower_flrp, false /* always_precise */); + } + NIR_PASS(_, nir, nir_lower_var_copies); }