Add glsl_type::is_numeric and glsl_type::is_boolean queries

This commit is contained in:
Ian Romanick 2010-03-23 17:31:03 -07:00
parent abef955764
commit 7aeb6abda7

View file

@ -167,6 +167,22 @@ struct glsl_type {
return (matrix_rows > 0) && (base_type == GLSL_TYPE_FLOAT);
}
/**
* Query whether or not a type is a non-array numeric type
*/
bool is_numeric() const
{
return (base_type >= GLSL_TYPE_UINT) && (base_type <= GLSL_TYPE_FLOAT);
}
/**
* Query whether or not a type is a non-array boolean type
*/
bool is_boolean() const
{
return base_type == GLSL_TYPE_BOOL;
}
/**
* Query whether or not a type is a sampler
*/