mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 06:40:08 +01:00
compiler/types: add 64-bitness queries.
This adds an inline and type query for if a type is 64-bit. Fow now this is equivalent to double, but int64 will change this. Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
a1c5cd426c
commit
246518154e
1 changed files with 13 additions and 0 deletions
|
|
@ -64,6 +64,11 @@ enum glsl_base_type {
|
|||
GLSL_TYPE_ERROR
|
||||
};
|
||||
|
||||
static inline bool glsl_base_type_is_64bit(enum glsl_base_type type)
|
||||
{
|
||||
return type == GLSL_TYPE_DOUBLE;
|
||||
}
|
||||
|
||||
enum glsl_sampler_dim {
|
||||
GLSL_SAMPLER_DIM_1D = 0,
|
||||
GLSL_SAMPLER_DIM_2D,
|
||||
|
|
@ -497,6 +502,14 @@ struct glsl_type {
|
|||
return base_type == GLSL_TYPE_DOUBLE && vector_elements > 2;
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is 64-bit
|
||||
*/
|
||||
bool is_64bit() const
|
||||
{
|
||||
return glsl_base_type_is_64bit(base_type);
|
||||
}
|
||||
|
||||
/**
|
||||
* Query whether or not a type is a non-array boolean type
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue