From 67af6c59f22cf5a223e539faa4215e7722bda75c Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 1 May 2015 11:26:40 -0700 Subject: [PATCH] nir/types: Add an is_vector_or_scalar helper --- src/glsl/nir/nir_types.cpp | 6 ++++++ src/glsl/nir/nir_types.h | 1 + 2 files changed, 7 insertions(+) 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); -- 2.30.2