summaryrefslogtreecommitdiff
path: root/src/glsl/ir_if_return.cpp
AgeCommit message (Collapse)Author
2010-07-29glsl2: Do ir_if_return on the way out, not the way in.Eric Anholt
The problem with doing it on the way in is that for a function with multiple early returns, we'll move an outer block in, then restart the pass, then move the two inside returns out, then never move outer blocks in again because the remaining early returns are inside an else block and they don't know that there's a return just after their block. By going inside-out, we get the early returns stacked up so that they all move out with a series of move_returns_after_block(). Fixes (on i965): glsl-fs-raytrace-bug27060 glsl-vs-raytrace-bug26691
2010-07-29glsl2: Make sure functions end with a return before doing ir_if_return.Eric Anholt
This catches a few remaining functions that weren't getting inlined, generally operating on global or out variables and using an early return to skip work when possible. Fixes for i965: glsl1-function with early return (3)
2010-07-29glsl2: Make ir_if_return handle if () { return } else { not return }Eric Anholt
This makes many remaining functions inlinable. Fixes for i965: glsl1-function with early return (1) glsl1-function with early return (2)
2010-07-29glsl2: Refactor a bit of ir_if_return for the next changes.Eric Anholt
2010-07-21glsl2: Replace insert_before/remove pairs with exec_node::replace_with.Kenneth Graunke
2010-07-20glsl2: Add and use new variable mode ir_var_temporaryIan Romanick
This is quite a large patch because breaking it into smaller pieces would result in the tree being intermitently broken. The big changes are: * Add the ir_var_temporary variable mode * Change the ir_variable constructor to take the mode as a parameter and correctly specify the mode for all ir_varables. * Change the linker to not cross validate ir_var_temporary variables. * Change the linker to pull all ir_var_temporary variables from global scope into 'main'.
2010-07-07glsl2: Add a pass to simplify if statements returning from both sides.Eric Anholt
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.)