From 0fabf8e8dc96a0eb8a9fbbac760d4faceee3af48 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Mon, 19 Sep 2011 18:30:15 -0700 Subject: glsl: Defer initialization of built-in functions until they're needed. Very simple shaders don't actually use GLSL built-ins. For example: - gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; - gl_FragColor = vec4(0.0); Both of the shaders used by _mesa_meta_glsl_Clear() also qualify. By waiting to initialize the built-ins until the first time we need to look for a signature, we can avoid the overhead entirely in these cases. Makes piglit run roughly 18% faster (255 vs. 312 seconds). Signed-off-by: Kenneth Graunke Reviewed-by: Eric Anholt --- src/glsl/ast_to_hir.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'src/glsl/ast_to_hir.cpp') diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index ce29d5a87aa..91a2231605d 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -60,7 +60,6 @@ void _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state) { _mesa_glsl_initialize_variables(instructions, state); - _mesa_glsl_initialize_functions(state); state->symbols->language_version = state->language_version; -- cgit v1.2.3