summaryrefslogtreecommitdiff
path: root/src/glsl/ir_mat_op_to_vec.cpp
diff options
context:
space:
mode:
authorLuca Barbieri <luca@luca-barbieri.com>2010-09-08 01:31:39 +0200
committerIan Romanick <ian.d.romanick@intel.com>2010-09-13 17:53:04 -0700
commit4dfb89904c0a3d2166e9a3fc0253a254680e91bc (patch)
treecbdcd0ef976c8cb33d604a29caf10bec1571af3b /src/glsl/ir_mat_op_to_vec.cpp
parent2cdbced10d98214616bcc5f960b21185c433d23b (diff)
glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmps
Currently GLSL IR forbids any vector comparisons, and defines "ir_binop_equal" and "ir_binop_nequal" to compare all elements and give a single bool. This is highly unintuitive and prevents generation of optimal Mesa IR. Hence, first rename "ir_binop_equal" to "ir_binop_all_equal" and "ir_binop_nequal" to "ir_binop_any_nequal". Second, readd "ir_binop_equal" and "ir_binop_nequal" with the same semantics as less, lequal, etc. Third, allow all comparisons to acts on vectors. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Diffstat (limited to 'src/glsl/ir_mat_op_to_vec.cpp')
-rw-r--r--src/glsl/ir_mat_op_to_vec.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/glsl/ir_mat_op_to_vec.cpp b/src/glsl/ir_mat_op_to_vec.cpp
index da6de9492b..c32ca88b0f 100644
--- a/src/glsl/ir_mat_op_to_vec.cpp
+++ b/src/glsl/ir_mat_op_to_vec.cpp
@@ -307,7 +307,7 @@ ir_mat_op_to_vec_visitor::do_equal_mat_mat(ir_variable *result_var,
ir_dereference *const op1 = get_column(b_var, i);
ir_expression *const cmp =
- new(this->mem_ctx) ir_expression(ir_binop_nequal,
+ new(this->mem_ctx) ir_expression(ir_binop_any_nequal,
glsl_type::bool_type, op0, op1);
ir_rvalue *const swiz =
@@ -473,10 +473,10 @@ ir_mat_op_to_vec_visitor::visit_leave(ir_assignment *orig_assign)
}
break;
- case ir_binop_equal:
- case ir_binop_nequal:
+ case ir_binop_all_equal:
+ case ir_binop_any_nequal:
do_equal_mat_mat(result_var, op_var[1], op_var[0],
- (orig_expr->operation == ir_binop_equal));
+ (orig_expr->operation == ir_binop_all_equal));
break;
default: