mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 07:28:11 +02:00
Add glsl_type::is_numeric and glsl_type::is_boolean queries
This commit is contained in:
parent
abef955764
commit
7aeb6abda7
1 changed files with 16 additions and 0 deletions
16
glsl_types.h
16
glsl_types.h
|
|
@ -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
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue