From 351eee05d346a8d226ecb6a5ab0a0e7d5b49aa66 Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 14 Dec 2017 14:48:49 +1100 Subject: st/glsl_to_nir: call post opt functions after opts have finished MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/mesa/state_tracker/st_glsl_to_nir.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') 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); -- cgit v1.2.3