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:
@@ -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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user