nir: add glsl_type_is_32bit() helper

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
This commit is contained in:
Timothy Arceri 2019-02-06 12:27:39 +11:00
parent 7b01d5c354
commit e041123841
3 changed files with 17 additions and 0 deletions

View File

@ -584,6 +584,16 @@ public:
return glsl_base_type_is_16bit(base_type);
}
/**
* Query whether or not a type is 32-bit
*/
bool is_32bit() const
{
return base_type == GLSL_TYPE_UINT ||
base_type == GLSL_TYPE_INT ||
base_type == GLSL_TYPE_FLOAT;
}
/**
* Query whether or not a type is a non-array boolean type
*/

View File

@ -204,6 +204,12 @@ glsl_type_is_16bit(const glsl_type *type)
return type->is_16bit();
}
bool
glsl_type_is_32bit(const glsl_type *type)
{
return type->is_32bit();
}
bool
glsl_type_is_64bit(const glsl_type *type)
{

View File

@ -131,6 +131,7 @@ glsl_get_bit_size(const struct glsl_type *type)
}
bool glsl_type_is_16bit(const struct glsl_type *type);
bool glsl_type_is_32bit(const struct glsl_type *type);
bool glsl_type_is_64bit(const struct glsl_type *type);
bool glsl_type_is_void(const struct glsl_type *type);
bool glsl_type_is_error(const struct glsl_type *type);