summaryrefslogtreecommitdiff
path: root/src/glsl/ir.h
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-11-12 10:19:08 -0800
committerIan Romanick <ian.d.romanick@intel.com>2010-11-16 12:11:02 -0800
commit38e55153af031e48125b1cd0a5d939bb92379ddc (patch)
tree386166b2f5265da45ca02a12d5034bf3d5cc6aa1 /src/glsl/ir.h
parent4f84a3aa32b06c99e65a4bf91452671075f8204c (diff)
glsl: Refactor is_vec_{zero,one} to be methods of ir_constant
These predicates will be used in other places soon.
Diffstat (limited to 'src/glsl/ir.h')
-rw-r--r--src/glsl/ir.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/glsl/ir.h b/src/glsl/ir.h
index 80e0f67d6d..6a70dede9b 100644
--- a/src/glsl/ir.h
+++ b/src/glsl/ir.h
@@ -1441,10 +1441,34 @@ public:
/**
* Determine whether a constant has the same value as another constant
+ *
+ * \sa ir_constant::is_zero, ir_constant::is_one
*/
bool has_value(const ir_constant *) const;
/**
+ * Determine if a constant has the value zero
+ *
+ * \note
+ * This function always returns \c false for constants that are not
+ * scalars or vectors.
+ *
+ * \sa ir_constant::has_value, ir_constant::is_one
+ */
+ bool is_zero() const;
+
+ /**
+ * Determine if a constant has the value one
+ *
+ * \note
+ * This function always returns \c false for constants that are not
+ * scalars or vectors.
+ *
+ * \sa ir_constant::has_value, ir_constant::is_zero
+ */
+ bool is_one() const;
+
+ /**
* Value of the constant.
*
* The field used to back the values supplied by the constant is determined