Handle constant expressions using derefs of const values.

Fixes CorrectParse1.frag and makes for a ton of folding in
CorrectParse2.frag.
This commit is contained in:
Eric Anholt
2010-04-06 10:30:54 -07:00
parent 3fff009af1
commit 326c676236
4 changed files with 19 additions and 3 deletions
+8 -1
View File
@@ -395,8 +395,15 @@ ir_constant_visitor::visit(ir_swizzle *ir)
void
ir_constant_visitor::visit(ir_dereference *ir)
{
(void) ir;
value = NULL;
if (ir->mode == ir_dereference::ir_reference_variable) {
ir_variable *var = ir->var->as_variable();
if (var && var->constant_value) {
value = new ir_constant(ir->type, &var->constant_value->value);
}
}
/* FINISHME: Other dereference modes. */
}