From 2e853ca23c8670246dd4efcee0706f68097652f7 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 5 Aug 2010 10:09:12 -0700 Subject: glsl2: Add a pass for removing unused functions. For a shader involving many small functions, this avoids running optimization across all of them after they've been inlined post-linking. Reduces the runtime of linking and running a fragment shader from Yo Frankie from 1.6 seconds to 0.9 seconds (-44.9%, +/- 3.3%). --- src/glsl/glsl_symbol_table.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/glsl/glsl_symbol_table.h') diff --git a/src/glsl/glsl_symbol_table.h b/src/glsl/glsl_symbol_table.h index 27e825597c..02e4542cf3 100644 --- a/src/glsl/glsl_symbol_table.h +++ b/src/glsl/glsl_symbol_table.h @@ -133,6 +133,12 @@ public: return _mesa_symbol_table_add_symbol(table, glsl_function_name_space, name, f) == 0; } + + bool remove_function(const char *name, ir_function *f) + { + return _mesa_symbol_table_add_symbol(table, glsl_function_name_space, + name, f) == 0; + } /*@}*/ /** -- cgit v1.2.3