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%).
This commit is contained in:
Eric Anholt
2010-08-05 10:09:12 -07:00
parent c5b9cab499
commit 2e853ca23c
6 changed files with 160 additions and 1 deletions

View File

@@ -1286,6 +1286,7 @@ link_shaders(struct gl_shader_program *prog)
progress = false;
progress = do_function_inlining(ir) || progress;
progress = do_dead_functions(ir) || progress;
progress = do_if_simplification(ir) || progress;
progress = do_copy_propagation(ir) || progress;
progress = do_dead_code_local(ir) || progress;