From: Matt Turner Date: Sun, 23 Feb 2014 00:35:14 +0000 (-0800) Subject: glsl: Add is_horizontal() method to ir_expression. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5eff8576ba274858a0b242ead97b8b5fc2b4f8ff;p=mesa.git glsl: Add is_horizontal() method to ir_expression. Cc: "10.1" --- 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. */