glsl2: Add a pass to simplify if statements returning from both sides.

This allows function inlining making the following tests work even
without function calls implemented:
glsl-fs-functions-2
glsl-fs-functions-3
glsl-vs-functions
glsl-vs-functions-2
glsl-vs-functions-3
glsl-vs-vec4-indexing-5

(Note that those tests were designed to trigger actual function calls,
and this defeats them.  However, those testcases ended up catching the
bug in the previous commit.)
This commit is contained in:
Eric Anholt
2010-07-06 18:09:39 -07:00
parent 6de882334a
commit d674ebcee0
4 changed files with 126 additions and 0 deletions

View File

@@ -39,6 +39,7 @@ bool do_dead_code_unlinked(struct _mesa_glsl_parse_state *state,
exec_list *instructions);
bool do_div_to_mul_rcp(exec_list *instructions);
bool do_function_inlining(exec_list *instructions);
bool do_if_return(exec_list *instructions);
bool do_if_simplification(exec_list *instructions);
bool do_mod_to_fract(exec_list *instructions);
bool do_swizzle_swizzle(exec_list *instructions);