glsl: fix MESA_GLSL_DISABLE_IO_OPT env var

It should be handled after nir_lower_io_passes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36018>
This commit is contained in:
Marek Olšák 2025-07-10 11:04:56 -04:00 committed by Marge Bot
parent 2ba2a61101
commit ff9abae31e

View file

@ -1471,9 +1471,6 @@ gl_nir_lower_optimize_varyings(const struct gl_constants *consts,
unsigned max_ubos = UINT_MAX;
unsigned max_uniform_comps = UINT_MAX;
if (debug_get_bool_option("MESA_GLSL_DISABLE_IO_OPT", false))
return;
for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) {
struct gl_linked_shader *shader = prog->_LinkedShaders[i];
@ -1496,6 +1493,9 @@ gl_nir_lower_optimize_varyings(const struct gl_constants *consts,
for (unsigned i = 0; i < num_shaders; i++)
nir_lower_io_passes(shaders[i], true);
if (debug_get_bool_option("MESA_GLSL_DISABLE_IO_OPT", false))
return;
/* There is nothing to optimize for only 1 shader. */
if (num_shaders == 1) {
nir_shader *nir = shaders[0];