glsl2: Return a real progress value from constant folding.
This commit is contained in:
@@ -39,7 +39,7 @@ class ir_constant_folding_visitor : public ir_visitor {
|
|||||||
public:
|
public:
|
||||||
ir_constant_folding_visitor()
|
ir_constant_folding_visitor()
|
||||||
{
|
{
|
||||||
/* empty */
|
this->progress = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~ir_constant_folding_visitor()
|
virtual ~ir_constant_folding_visitor()
|
||||||
@@ -75,6 +75,8 @@ public:
|
|||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
void fold_constant(ir_rvalue **rvalue);
|
void fold_constant(ir_rvalue **rvalue);
|
||||||
|
|
||||||
|
bool progress;
|
||||||
};
|
};
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -86,6 +88,7 @@ ir_constant_folding_visitor::fold_constant(ir_rvalue **rvalue)
|
|||||||
ir_constant *constant = (*rvalue)->constant_expression_value();
|
ir_constant *constant = (*rvalue)->constant_expression_value();
|
||||||
if (constant) {
|
if (constant) {
|
||||||
*rvalue = constant;
|
*rvalue = constant;
|
||||||
|
this->progress = true;
|
||||||
} else {
|
} else {
|
||||||
(*rvalue)->accept(this);
|
(*rvalue)->accept(this);
|
||||||
}
|
}
|
||||||
@@ -178,6 +181,7 @@ ir_constant_folding_visitor::visit(ir_assignment *ir)
|
|||||||
else
|
else
|
||||||
ir->remove();
|
ir->remove();
|
||||||
}
|
}
|
||||||
|
this->progress = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -240,6 +244,5 @@ do_constant_folding(exec_list *instructions)
|
|||||||
|
|
||||||
visit_exec_list(instructions, &constant_folding);
|
visit_exec_list(instructions, &constant_folding);
|
||||||
|
|
||||||
/* FINISHME: Return real progress. */
|
return constant_folding.progress;
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user