Mesa (glsl2): glsl2: Return a real progress value from constant folding.
Eric Anholt
anholt at kemper.freedesktop.org
Wed Aug 4 23:27:04 UTC 2010
Module: Mesa
Branch: glsl2
Commit: 6ecf62f673bf90d0969f8db032781b49a988975a
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=6ecf62f673bf90d0969f8db032781b49a988975a
Author: Eric Anholt <eric at anholt.net>
Date: Wed Aug 4 16:07:41 2010 -0700
glsl2: Return a real progress value from constant folding.
---
src/glsl/ir_constant_folding.cpp | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/src/glsl/ir_constant_folding.cpp b/src/glsl/ir_constant_folding.cpp
index 492036e..a6d82e3 100644
--- a/src/glsl/ir_constant_folding.cpp
+++ b/src/glsl/ir_constant_folding.cpp
@@ -39,7 +39,7 @@ class ir_constant_folding_visitor : public ir_visitor {
public:
ir_constant_folding_visitor()
{
- /* empty */
+ this->progress = false;
}
virtual ~ir_constant_folding_visitor()
@@ -75,6 +75,8 @@ public:
/*@}*/
void fold_constant(ir_rvalue **rvalue);
+
+ bool progress;
};
void
@@ -86,6 +88,7 @@ ir_constant_folding_visitor::fold_constant(ir_rvalue **rvalue)
ir_constant *constant = (*rvalue)->constant_expression_value();
if (constant) {
*rvalue = constant;
+ this->progress = true;
} else {
(*rvalue)->accept(this);
}
@@ -178,6 +181,7 @@ ir_constant_folding_visitor::visit(ir_assignment *ir)
else
ir->remove();
}
+ this->progress = true;
}
}
@@ -240,6 +244,5 @@ do_constant_folding(exec_list *instructions)
visit_exec_list(instructions, &constant_folding);
- /* FINISHME: Return real progress. */
- return false;
+ return constant_folding.progress;
}
More information about the mesa-commit
mailing list