glsl: introduce ir_binop_all_equal and ir_binop_any_equal, allow vector cmps
authorLuca Barbieri <luca@luca-barbieri.com>
Tue, 7 Sep 2010 23:31:39 +0000 (01:31 +0200)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 14 Sep 2010 00:53:04 +0000 (17:53 -0700)
commit4dfb89904c0a3d2166e9a3fc0253a254680e91bc
treecbdcd0ef976c8cb33d604a29caf10bec1571af3b
parent2cdbced10d98214616bcc5f960b21185c433d23b
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>
src/glsl/ast_to_hir.cpp
src/glsl/ir.cpp
src/glsl/ir.h
src/glsl/ir_algebraic.cpp
src/glsl/ir_constant_expression.cpp
src/glsl/ir_mat_op_to_vec.cpp
src/glsl/ir_validate.cpp
src/mesa/program/ir_to_mesa.cpp