summaryrefslogtreecommitdiffstats
path: root/src/glsl/builtin_functions.cpp
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2013-11-23 12:11:34 -0800
committerKenneth Graunke <[email protected]>2013-12-01 15:33:04 -0800
commit5b331f6fcbf226f18e0c517ffdce30a39bb92982 (patch)
tree213e292ef49855ba3165f281d2ccc40c56f82126 /src/glsl/builtin_functions.cpp
parent1b557b1606ffcf05d2612d66226306e876b6b937 (diff)
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 <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/glsl/builtin_functions.cpp')
-rw-r--r--src/glsl/builtin_functions.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/glsl/builtin_functions.cpp b/src/glsl/builtin_functions.cpp
index e768685d0a6..6af587add53 100644
--- a/src/glsl/builtin_functions.cpp
+++ b/src/glsl/builtin_functions.cpp
@@ -609,8 +609,7 @@ builtin_builder::find(_mesa_glsl_parse_state *state,
* that the "no matching signature" error will list potential candidates
* from the available built-ins.
*/
- state->builtins_to_link[0] = shader;
- state->num_builtins_to_link = 1;
+ state->uses_builtin_functions = true;
ir_function *f = shader->symbols->get_function(name);
if (f == NULL)