diff options
author | Dave Airlie <[email protected]> | 2016-06-09 06:52:15 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-06-09 07:37:04 +1000 |
commit | 246518154efb5da5e3934385b9a43a1571209c60 (patch) | |
tree | 78f0bb3aec92a0c8d71e714358a5ba79bc7117de | |
parent | a1c5cd426c0381124f7c320d5a7b760a9a36af75 (diff) |
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 <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
-rw-r--r-- | src/compiler/glsl_types.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h index 4e3afe7d139..21021324786 100644 --- a/src/compiler/glsl_types.h +++ b/src/compiler/glsl_types.h @@ -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, @@ -498,6 +503,14 @@ struct glsl_type { } /** + * 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 */ bool is_boolean() const |