diff options
author | Eric Anholt <eric@anholt.net> | 2010-07-12 19:50:01 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2010-07-12 19:50:49 -0700 |
commit | 562c3d0cb1aedbf3c9f13f206678fa3f0fa26a9f (patch) | |
tree | 7913581a9a1137f62a2745aef42bccc644f2b93d | |
parent | 94da2abfd49c6b4060544986ef68d5662b1cc292 (diff) |
glsl2: Flatten expression that appear as the parameters of ir_call as well.
-rw-r--r-- | src/glsl/ir_expression_flattening.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/glsl/ir_expression_flattening.cpp b/src/glsl/ir_expression_flattening.cpp index 66268a679d..f18659342f 100644 --- a/src/glsl/ir_expression_flattening.cpp +++ b/src/glsl/ir_expression_flattening.cpp @@ -165,11 +165,18 @@ ir_expression_flattening_visitor::visit_leave(ir_swizzle *ir) ir_visitor_status ir_expression_flattening_visitor::visit_enter(ir_call *ir) { - /* FINISHME: Why not process the call parameters? (Same behavior as original - * FINISHME: code.) - */ - (void) ir; - return visit_continue_with_parent; + /* Reminder: iterating ir_call iterates its parameters. */ + foreach_iter(exec_list_iterator, iter, *ir) { + ir_rvalue *ir = (ir_rvalue *)iter.get(); + ir_rvalue *new_ir = operand_to_temp(ir); + + if (new_ir != ir) { + ir->insert_before(new_ir); + ir->remove(); + } + } + + return visit_continue; } |