From 38e55153af031e48125b1cd0a5d939bb92379ddc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Fri, 12 Nov 2010 10:19:08 -0800 Subject: glsl: Refactor is_vec_{zero,one} to be methods of ir_constant These predicates will be used in other places soon. --- src/glsl/ir.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/glsl/ir.h') 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,9 +1441,33 @@ 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. * -- cgit v1.2.3