summaryrefslogtreecommitdiffstats
path: root/src/glsl/glsl_symbol_table.h
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-08-05 10:09:12 -0700
committerEric Anholt <[email protected]>2010-08-05 10:18:31 -0700
commit2e853ca23c8670246dd4efcee0706f68097652f7 (patch)
tree9b5e1f32cf565e3367f574d4c918e676e0d68060 /src/glsl/glsl_symbol_table.h
parentc5b9cab49900cbcab78911361976a3678d49e853 (diff)
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%).
Diffstat (limited to 'src/glsl/glsl_symbol_table.h')
-rw-r--r--src/glsl/glsl_symbol_table.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/glsl/glsl_symbol_table.h b/src/glsl/glsl_symbol_table.h
index 27e825597c5..02e4542cf3d 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;
+ }
/*@}*/
/**