glsl: Add is_horizontal() method to ir_expression.
authorMatt Turner <mattst88@gmail.com>
Sun, 23 Feb 2014 00:35:14 +0000 (16:35 -0800)
committerMatt Turner <mattst88@gmail.com>
Fri, 28 Feb 2014 18:37:46 +0000 (10:37 -0800)
Cc: "10.1" <mesa-stable@lists.freedesktop.org>
src/glsl/ir.h

index 5da61d5cfe540942f217241628f31aabcee657a7..ed3f086ce7a9b1e61d374441ccc632690acb1297 100644 (file)
@@ -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.
     */