glsl: Refactor is_vec_{zero,one} to be methods of ir_constant

These predicates will be used in other places soon.
This commit is contained in:
Ian Romanick
2010-11-12 10:19:08 -08:00
parent 4f84a3aa32
commit 38e55153af
3 changed files with 101 additions and 68 deletions

View File

@@ -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.
*