From: Jason Ekstrand Date: Fri, 12 Feb 2016 06:03:48 +0000 (-0800) Subject: nir/types: Add a few more glsl_type_is_ functions X-Git-Tag: upstream/17.1.0~12554 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f05f576803caf939a420d559c78cbf40a455235f;p=platform%2Fupstream%2Fmesa.git nir/types: Add a few more glsl_type_is_ functions Reviewed-by: Jordan Justen --- diff --git a/src/compiler/nir_types.cpp b/src/compiler/nir_types.cpp index 89f1be5..2942810 100644 --- a/src/compiler/nir_types.cpp +++ b/src/compiler/nir_types.cpp @@ -158,6 +158,12 @@ glsl_type_is_void(const glsl_type *type) } bool +glsl_type_is_error(const glsl_type *type) +{ + return type->is_error(); +} + +bool glsl_type_is_vector(const struct glsl_type *type) { return type->is_vector(); @@ -182,6 +188,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/compiler/nir_types.h b/src/compiler/nir_types.h index e16dc4b..48927da 100644 --- a/src/compiler/nir_types.h +++ b/src/compiler/nir_types.h @@ -78,10 +78,13 @@ unsigned glsl_get_record_location_offset(const struct glsl_type *type, unsigned length); bool glsl_type_is_void(const struct glsl_type *type); +bool glsl_type_is_error(const struct glsl_type *type); 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_type_is_image(const struct glsl_type *type); bool glsl_sampler_type_is_shadow(const struct glsl_type *type);