summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/glsl/opt_algebraic.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp
index 430f5cb9790..c4f883b9a8e 100644
--- a/src/glsl/opt_algebraic.cpp
+++ b/src/glsl/opt_algebraic.cpp
@@ -584,6 +584,16 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
}
break;
+ case ir_binop_all_equal:
+ case ir_binop_any_nequal:
+ if (ir->operands[0]->type->is_scalar() &&
+ ir->operands[1]->type->is_scalar())
+ return new(mem_ctx) ir_expression(ir->operation == ir_binop_all_equal
+ ? ir_binop_equal : ir_binop_nequal,
+ ir->operands[0],
+ ir->operands[1]);
+ break;
+
case ir_binop_rshift:
case ir_binop_lshift:
/* 0 >> x == 0 */