glsl2: Flatten expressions that appear as the children of ir_return as well.
authorEric Anholt <eric@anholt.net>
Tue, 13 Jul 2010 02:31:54 +0000 (19:31 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 13 Jul 2010 02:50:49 +0000 (19:50 -0700)
src/glsl/ir_expression_flattening.cpp

index 629194c..66268a6 100644 (file)
@@ -176,9 +176,7 @@ ir_expression_flattening_visitor::visit_enter(ir_call *ir)
 ir_visitor_status
 ir_expression_flattening_visitor::visit_enter(ir_return *ir)
 {
-   /* FINISHME: Why not process the return value? (Same behavior as original
-    * FINISHME: code.)
-    */
-   (void) ir;
-   return visit_continue_with_parent;
+   if (ir->value)
+      ir->value = operand_to_temp(ir->value);
+   return visit_continue;
 }