diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-06-24 13:34:27 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-07-05 12:27:10 +0200 |
commit | 9a81d032c12d734ca483e2b822c201527a320213 (patch) | |
tree | 067c011b3031e4aa848304f9398c37c626215db2 /src | |
parent | 34df9525f607cab0208ad9b7006b7476f0a0fe79 (diff) |
glsl: add glsl_base_type_is_integer
We will use this from radeonsi/nir, which we want to keep as pure C code.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/compiler/glsl_types.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/glsl_types.h b/src/compiler/glsl_types.h index 55faac2533..2857dc9ad9 100644 --- a/src/compiler/glsl_types.h +++ b/src/compiler/glsl_types.h @@ -77,6 +77,17 @@ static inline bool glsl_base_type_is_64bit(enum glsl_base_type type) type == GLSL_TYPE_SAMPLER; } +static inline bool glsl_base_type_is_integer(enum glsl_base_type type) +{ + return type == GLSL_TYPE_UINT || + type == GLSL_TYPE_INT || + type == GLSL_TYPE_UINT64 || + type == GLSL_TYPE_INT64 || + type == GLSL_TYPE_BOOL || + type == GLSL_TYPE_SAMPLER || + type == GLSL_TYPE_IMAGE; +} + enum glsl_sampler_dim { GLSL_SAMPLER_DIM_1D = 0, GLSL_SAMPLER_DIM_2D, |