glsl: make sure builtins are initialized before getting the shader
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 6 Feb 2016 22:07:59 +0000 (17:07 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Sun, 7 Feb 2016 22:23:57 +0000 (17:23 -0500)
The builtin function shader is part of the builtin state, released
when glReleaseShaderCompiler is called. We must ensure that the
builtins have been (re)initialized before attempting to link with the
builtin shader.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Timothy Arceri <timothy.arceri@collabora.com>
Tested-by: Rob Herring <robh@kernel.org>
Cc: mesa-stable@lists.freedesktop.org
src/compiler/glsl/linker.cpp

index 4776ffa6acd031361abcfdce39567a98f676c557..f1ac53abb0a354f46bdd07c20eb54ace56f4f235 100644 (file)
@@ -2125,6 +2125,7 @@ link_intrastage_shaders(void *mem_ctx,
 
       if (ok) {
          memcpy(linking_shaders, shader_list, num_shaders * sizeof(gl_shader *));
+         _mesa_glsl_initialize_builtin_functions();
          linking_shaders[num_shaders] = _mesa_glsl_get_builtin_function_shader();
 
          ok = link_function_calls(prog, linked, linking_shaders, num_shaders + 1);