From 2b65fecd8571f2f31633493b6c2d37bedef61c80 Mon Sep 17 00:00:00 2001 From: Alejandro PiƱeiro Date: Thu, 7 Mar 2019 11:33:03 +0100 Subject: nir_types: add glsl_type_is_struct helper Reviewed-by: Timothy Arceri --- src/compiler/nir_types.cpp | 6 ++++++ src/compiler/nir_types.h | 1 + 2 files changed, 7 insertions(+) diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index a6c9dbd7192..a1f1198f27e 100644 --- a/src/compiler/nir_types.cpp +++ b/src/compiler/nir_types.cpp @@ -283,6 +283,12 @@ glsl_type_is_array_or_matrix(const struct glsl_type *type) return type->is_array() || type->is_matrix(); } +bool +glsl_type_is_struct(const struct glsl_type *type) +{ + return type->is_struct(); +} + bool glsl_type_is_struct_or_ifc(const struct glsl_type *type) { diff --git a/src/compiler/nir_types.h b/src/compiler/nir_types.h index 2c31fa2e43b..c7ded19afb1 100644 --- a/src/compiler/nir_types.h +++ b/src/compiler/nir_types.h @@ -144,6 +144,7 @@ bool glsl_matrix_type_is_row_major(const struct glsl_type *type); bool glsl_type_is_array(const struct glsl_type *type); bool glsl_type_is_array_of_arrays(const struct glsl_type *type); bool glsl_type_is_array_or_matrix(const struct glsl_type *type); +bool glsl_type_is_struct(const struct glsl_type *type); bool glsl_type_is_struct_or_ifc(const struct glsl_type *type); bool glsl_type_is_sampler(const struct glsl_type *type); bool glsl_type_is_image(const struct glsl_type *type); -- cgit v1.2.3