summaryrefslogtreecommitdiffstats
path: root/src/glsl/main.cpp
diff options
context:
space:
mode:
authorIan Romanick <[email protected]>2010-07-20 11:29:46 -0700
committerIan Romanick <[email protected]>2010-07-21 15:52:58 -0700
commitd5be2acae379783c4aa31243e0a88a9e67e6ca7e (patch)
tree91ebf30796116f1b4d20b6f2fe420a085a59d59e /src/glsl/main.cpp
parent4ccd3c548b9b9a2fee79342445f68d73525bfcdb (diff)
linker: Link built-in functions instead of including them in every shader
This is an invasive set of changes. Each user shader tracks a set of other shaders that contain built-in functions. During compilation, function prototypes are imported from these shaders. During linking, the shaders are linked with these built-in-function shaders just like with any other shader.
Diffstat (limited to 'src/glsl/main.cpp')
-rw-r--r--src/glsl/main.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index cf9a5157857..2ecf57f8ce2 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -219,6 +219,9 @@ compile_shader(struct gl_shader *shader)
shader->symbols = state->symbols;
shader->CompileStatus = !state->error;
shader->Version = state->language_version;
+ memcpy(shader->builtins_to_link, state->builtins_to_link,
+ sizeof(shader->builtins_to_link[0]) * state->num_builtins_to_link);
+ shader->num_builtins_to_link = state->num_builtins_to_link;
if (shader->InfoLog)
talloc_free(shader->InfoLog);
@@ -305,6 +308,7 @@ main(int argc, char **argv)
talloc_free(whole_program);
_mesa_glsl_release_types();
+ _mesa_glsl_release_functions();
return status;
}