From 5eff8576ba274858a0b242ead97b8b5fc2b4f8ff Mon Sep 17 00:00:00 2001 From: Matt Turner Date: Sat, 22 Feb 2014 16:35:14 -0800 Subject: [PATCH] glsl: Add is_horizontal() method to ir_expression. Cc: "10.1" --- src/glsl/ir.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/glsl/ir.h b/src/glsl/ir.h index 5da61d5cfe5..ed3f086ce7a 100644 --- a/src/glsl/ir.h +++ b/src/glsl/ir.h @@ -1458,6 +1458,18 @@ public: ? this->type->vector_elements : get_num_operands(operation); } + /** + * Return whether the expression operates on vectors horizontally. + */ + bool is_horizontal() const + { + return operation == ir_binop_all_equal || + operation == ir_binop_any_nequal || + operation == ir_unop_any || + operation == ir_binop_dot || + operation == ir_quadop_vector; + } + /** * Return a string representing this expression's operator. */ -- 2.30.2