From: Connor Abbott Date: Thu, 16 Jul 2015 04:58:32 +0000 (-0700) Subject: nir/types: add more nir_type_is_xxx() wrappers X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=513ee7fa48bb2fb2ed1f07b6f18ebff402c882f2;p=mesa.git nir/types: add more nir_type_is_xxx() wrappers --- diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp index 3c00bdb3c18..f3f3af97fde 100644 --- a/src/glsl/nir/nir_types.cpp +++ b/src/glsl/nir/nir_types.cpp @@ -168,6 +168,18 @@ glsl_type_is_matrix(const struct glsl_type *type) return type->is_matrix(); } +bool +glsl_type_is_array(const struct glsl_type *type) +{ + return type->is_array(); +} + +bool +glsl_type_is_struct(const struct glsl_type *type) +{ + return type->is_record() || type->is_interface(); +} + bool glsl_type_is_sampler(const struct glsl_type *type) { diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h index 60e1d9d96fc..a2fa7934e16 100644 --- a/src/glsl/nir/nir_types.h +++ b/src/glsl/nir/nir_types.h @@ -76,6 +76,8 @@ bool glsl_type_is_vector(const struct glsl_type *type); bool glsl_type_is_scalar(const struct glsl_type *type); bool glsl_type_is_vector_or_scalar(const struct glsl_type *type); bool glsl_type_is_matrix(const struct glsl_type *type); +bool glsl_type_is_array(const struct glsl_type *type); +bool glsl_type_is_struct(const struct glsl_type *type); bool glsl_type_is_sampler(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);