mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 18:40:13 +01:00
glsl: Optimize lrp(x, x, coefficient) --> x.
total instructions in shared programs: 1627754 -> 1624534 (-0.20%) instructions in affected programs: 45748 -> 42528 (-7.04%) GAINED: 3 LOST: 0 (serious sam, humus domino demo) Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
d72956790f
commit
44577c4857
1 changed files with 2 additions and 0 deletions
|
|
@ -553,6 +553,8 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
|||
return ir->operands[0];
|
||||
} else if (is_vec_one(op_const[2])) {
|
||||
return ir->operands[1];
|
||||
} else if (ir->operands[0]->equals(ir->operands[1])) {
|
||||
return ir->operands[0];
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue