diff --git a/.pick_status.json b/.pick_status.json index 5b6882f29dd..f9e52a3fbbb 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -9034,7 +9034,7 @@ "description": "glsl: fix potential crash with DisableUniformArrayResize", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "ac5af6c06d867507284121f31ddbabf07f7e29f4", "notes": null diff --git a/src/compiler/glsl/gl_nir_link_uniforms.c b/src/compiler/glsl/gl_nir_link_uniforms.c index fb032be1e72..dd92095280a 100644 --- a/src/compiler/glsl/gl_nir_link_uniforms.c +++ b/src/compiler/glsl/gl_nir_link_uniforms.c @@ -1526,7 +1526,7 @@ gl_nir_link_uniforms(const struct gl_constants *consts, /* Iterate through all linked shaders */ struct nir_link_uniforms_state state = {0,}; - if (!prog->data->spirv && !consts->DisableUniformArrayResize) { + if (!prog->data->spirv) { /* Gather information on uniform use */ for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) { struct gl_linked_shader *sh = prog->_LinkedShaders[stage]; @@ -1541,14 +1541,16 @@ gl_nir_link_uniforms(const struct gl_constants *consts, add_var_use_shader(nir, state.referenced_uniforms[stage]); } - /* Resize uniform arrays based on the maximum array index */ - for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) { - struct gl_linked_shader *sh = prog->_LinkedShaders[stage]; - if (!sh) - continue; + if(!consts->DisableUniformArrayResize) { + /* Resize uniform arrays based on the maximum array index */ + for (unsigned stage = 0; stage < MESA_SHADER_STAGES; stage++) { + struct gl_linked_shader *sh = prog->_LinkedShaders[stage]; + if (!sh) + continue; - nir_foreach_gl_uniform_variable(var, sh->Program->nir) - update_array_sizes(prog, var, state.referenced_uniforms, stage); + nir_foreach_gl_uniform_variable(var, sh->Program->nir) + update_array_sizes(prog, var, state.referenced_uniforms, stage); + } } }