diff options
author | Luca Barbieri <[email protected]> | 2010-09-08 01:31:39 +0200 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-09-13 17:53:04 -0700 |
commit | 4dfb89904c0a3d2166e9a3fc0253a254680e91bc (patch) | |
tree | cbdcd0ef976c8cb33d604a29caf10bec1571af3b /src/glsl/ir_algebraic.cpp | |
parent | 2cdbced10d98214616bcc5f960b21185c433d23b (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 <[email protected]>
Diffstat (limited to 'src/glsl/ir_algebraic.cpp')
-rw-r--r-- | src/glsl/ir_algebraic.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/glsl/ir_algebraic.cpp b/src/glsl/ir_algebraic.cpp index ff81563f196..2ed66db4765 100644 --- a/src/glsl/ir_algebraic.cpp +++ b/src/glsl/ir_algebraic.cpp @@ -270,6 +270,8 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) case ir_binop_gequal: new_op = ir_binop_less; break; case ir_binop_equal: new_op = ir_binop_nequal; break; case ir_binop_nequal: new_op = ir_binop_equal; break; + case ir_binop_all_equal: new_op = ir_binop_any_nequal; break; + case ir_binop_any_nequal: new_op = ir_binop_all_equal; break; default: /* The default case handler is here to silence a warning from GCC. |