From: Samuel Iglesias Gonsálvez <sigles...@igalia.com> Signed-off-by: Samuel Iglesias Gonsálvez <sigles...@igalia.com> --- src/compiler/nir_types.cpp | 15 +++++++++++++++ src/compiler/nir_types.h | 2 ++ 2 files changed, 17 insertions(+)
diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index cc90efd..ea3bcb8 100644 --- a/src/compiler/nir_types.cpp +++ b/src/compiler/nir_types.cpp @@ -235,6 +235,21 @@ glsl_type_is_numeric(const struct glsl_type *type) } bool +glsl_type_is_integer(const struct glsl_type *type) +{ + return (type->base_type == GLSL_TYPE_INT || + type->base_type == GLSL_TYPE_UINT); +} + +bool +glsl_type_is_float(const struct glsl_type *type) +{ + return (type->base_type == GLSL_TYPE_FLOAT || + type->base_type == GLSL_TYPE_DOUBLE); +} + + +bool glsl_type_is_boolean(const struct glsl_type *type) { return type->is_boolean(); diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h index 9088a06..cf15ffc 100644 --- a/src/compiler/nir_types.h +++ b/src/compiler/nir_types.h @@ -114,6 +114,8 @@ bool glsl_type_is_sampler(const struct glsl_type *type); bool glsl_type_is_image(const struct glsl_type *type); bool glsl_type_is_dual_slot(const struct glsl_type *type); bool glsl_type_is_numeric(const struct glsl_type *type); +bool glsl_type_is_integer(const struct glsl_type *type); +bool glsl_type_is_float(const struct glsl_type *type); bool glsl_type_is_boolean(const struct glsl_type *type); bool glsl_sampler_type_is_shadow(const struct glsl_type *type); bool glsl_sampler_type_is_array(const struct glsl_type *type); -- 2.9.3 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev