mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-22 17:50:12 +01:00
glsl: Check for zero vectors in ir_binop_dot
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
82ce93a8fd
commit
d7bef19c7f
1 changed files with 7 additions and 0 deletions
|
|
@ -309,6 +309,13 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case ir_binop_dot:
|
||||||
|
if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) {
|
||||||
|
this->progress = true;
|
||||||
|
return ir_constant::zero(mem_ctx, ir->type);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case ir_binop_logic_and:
|
case ir_binop_logic_and:
|
||||||
/* FINISHME: Also simplify (a && a) to (a). */
|
/* FINISHME: Also simplify (a && a) to (a). */
|
||||||
if (is_vec_one(op_const[0])) {
|
if (is_vec_one(op_const[0])) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue