From: Timothy Arceri Date: Thu, 14 Dec 2017 03:48:49 +0000 (+1100) Subject: st/glsl_to_nir: call post opt functions after opts have finished X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=351eee05d346a8d226ecb6a5ab0a0e7d5b49aa66;p=mesa.git st/glsl_to_nir: call post opt functions after opts have finished We need to move this to a separate loop because nir_compact_varyings() can alter the IR of a previous stage. Fixes: 6648bd68fd27 "st/glsl_to_nir: enable NIR link time opts" Tested-by: Dieter Nützel Reviewed-by: Marek Olšák --- diff --git a/src/mesa/state_tracker/st_glsl_to_nir.cpp b/src/mesa/state_tracker/st_glsl_to_nir.cpp index 0ff8dcd68cc..b411621ab2c 100644 --- a/src/mesa/state_tracker/st_glsl_to_nir.cpp +++ b/src/mesa/state_tracker/st_glsl_to_nir.cpp @@ -617,6 +617,12 @@ st_link_nir(struct gl_context *ctx, nir, ctx->API != API_OPENGL_COMPAT); } prev = i; + } + + for (unsigned i = 0; i < MESA_SHADER_STAGES; i++) { + struct gl_linked_shader *shader = shader_program->_LinkedShaders[i]; + if (shader == NULL) + continue; st_glsl_to_nir_post_opts(st, shader->Program, shader_program);