From 4dfb89904c0a3d2166e9a3fc0253a254680e91bc Mon Sep 17 00:00:00 2001 From: Luca Barbieri Date: Wed, 8 Sep 2010 01:31:39 +0200 Subject: 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 --- src/glsl/ir.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/glsl/ir.h') diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 80a647e0dc..70c6faaf15 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -675,16 +675,18 @@ enum ir_expression_operation { ir_binop_greater, ir_binop_lequal, ir_binop_gequal, + ir_binop_equal, + ir_binop_nequal, /** * Returns single boolean for whether all components of operands[0] * equal the components of operands[1]. */ - ir_binop_equal, + ir_binop_all_equal, /** * Returns single boolean for whether any component of operands[0] * is not equal to the corresponding component of operands[1]. */ - ir_binop_nequal, + ir_binop_any_nequal, /*@}*/ /** -- cgit v1.2.3