Mesa (10.1): glsl: Add is_horizontal() method to ir_expression.

Ian Romanick idr at kemper.freedesktop.org
Fri Feb 28 23:00:36 UTC 2014


Module: Mesa
Branch: 10.1
Commit: a43b8bfa780baf8974a1c949459c8781449af238
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a43b8bfa780baf8974a1c949459c8781449af238

Author: Matt Turner <mattst88 at gmail.com>
Date:   Sat Feb 22 16:35:14 2014 -0800

glsl: Add is_horizontal() method to ir_expression.

Cc: "10.1" <mesa-stable at lists.freedesktop.org>
(cherry picked from commit 5eff8576ba274858a0b242ead97b8b5fc2b4f8ff)

---

 src/glsl/ir.h |   12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index e266328..d446292 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1444,6 +1444,18 @@ public:
    }
 
    /**
+    * 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.
     */
    const char *operator_string();




More information about the mesa-commit mailing list