mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-22 10:58:08 +02:00
Fold constant expressions in if conditionals.
Fixes up 3 more expressions in CorrectParse2.frag.
This commit is contained in:
parent
ec1949e804
commit
3fff009af1
1 changed files with 5 additions and 1 deletions
|
|
@ -127,5 +127,9 @@ ir_constant_folding_visitor::visit(ir_return *ir)
|
|||
void
|
||||
ir_constant_folding_visitor::visit(ir_if *ir)
|
||||
{
|
||||
(void) ir;
|
||||
ir_constant *const_val = ir->condition->constant_expression_value();
|
||||
if (const_val)
|
||||
ir->condition = const_val;
|
||||
else
|
||||
ir->condition->accept(this);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue