diff options
author | Connor Abbott <[email protected]> | 2015-07-15 21:58:32 -0700 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2015-08-31 16:58:20 -0700 |
commit | c62be3828671706600f4b661e0b67fef78580cd2 (patch) | |
tree | d27b8147d22a2f00fb0baa733567113cebb8556c | |
parent | a1e136711bc661f4471115396f6a477a5fe9f930 (diff) |
nir/types: add more nir_type_is_xxx() wrappers
-rw-r--r-- | src/glsl/nir/nir_types.cpp | 12 | ||||
-rw-r--r-- | src/glsl/nir/nir_types.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp index d44d48095da..809a7cff79c 100644 --- a/src/glsl/nir/nir_types.cpp +++ b/src/glsl/nir/nir_types.cpp @@ -169,6 +169,18 @@ glsl_type_is_matrix(const struct glsl_type *type) } 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) { return type->is_sampler(); 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); |