mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 02:10:11 +01:00
glsl: Optimize ir_triop_lrp(x, y, a) with a = 0.0f or 1.0f
Reviewed-by: Eric Anholt <eric@anholt.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
93066ce129
commit
af2c64063e
1 changed files with 11 additions and 0 deletions
|
|
@ -415,6 +415,17 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
|||
|
||||
break;
|
||||
|
||||
case ir_triop_lrp:
|
||||
/* Operands are (x, y, a). */
|
||||
if (is_vec_zero(op_const[2])) {
|
||||
this->progress = true;
|
||||
return swizzle_if_required(ir, ir->operands[0]);
|
||||
} else if (is_vec_one(op_const[2])) {
|
||||
this->progress = true;
|
||||
return swizzle_if_required(ir, ir->operands[1]);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue