From: Jason Ekstrand Date: Fri, 1 May 2015 18:26:40 +0000 (-0700) Subject: nir/types: Add an is_vector_or_scalar helper X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6ff0830d64840d88631287db32ae464c7a436b17;p=mesa.git nir/types: Add an is_vector_or_scalar helper --- diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp index f93a52b5fa5..a6d35fe6179 100644 --- a/src/glsl/nir/nir_types.cpp +++ b/src/glsl/nir/nir_types.cpp @@ -142,6 +142,12 @@ glsl_type_is_scalar(const struct glsl_type *type) return type->is_scalar(); } +bool +glsl_type_is_vector_or_scalar(const struct glsl_type *type) +{ + return type->is_vector() || type->is_scalar(); +} + bool glsl_type_is_matrix(const struct glsl_type *type) { diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h index 40a80ec7130..f19f0e5db5d 100644 --- a/src/glsl/nir/nir_types.h +++ b/src/glsl/nir/nir_types.h @@ -72,6 +72,7 @@ const char *glsl_get_struct_elem_name(const struct glsl_type *type, bool glsl_type_is_void(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); const struct glsl_type *glsl_void_type(void);