From 5b331f6fcbf226f18e0c517ffdce30a39bb92982 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Sat, 23 Nov 2013 12:11:34 -0800 Subject: glsl: Simplify the built-in function linking code. Previously, we stored an array of up to 16 additional shaders to link, as well as a count of how many each shader actually needed. Since the built-in functions rewrite, all the built-ins are stored in a single shader. So all we need is a boolean indicating whether a shader needs to link against built-ins or not. During linking, we can avoid creating the temporary array if none of the shaders being linked need built-ins. Otherwise, it's simply a copy of the array that has one additional element. This is much simpler. This patch saves approximately 128 bytes of memory per gl_shader object. Signed-off-by: Kenneth Graunke Reviewed-by: Ian Romanick --- src/glsl/glsl_parser_extras.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/glsl/glsl_parser_extras.h') diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h index d232bb3f66d..c1f5ff58979 100644 --- a/src/glsl/glsl_parser_extras.h +++ b/src/glsl/glsl_parser_extras.h @@ -361,9 +361,7 @@ struct _mesa_glsl_parse_state { /** Extensions supported by the OpenGL implementation. */ const struct gl_extensions *extensions; - /** Shaders containing built-in functions that are used for linking. */ - struct gl_shader *builtins_to_link[16]; - unsigned num_builtins_to_link; + bool uses_builtin_functions; /** * For geometry shaders, size of the most recently seen input declaration -- cgit v1.2.3