nir/types: Add an is_vector_or_scalar helper
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 1 May 2015 18:26:40 +0000 (11:26 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 31 Aug 2015 23:58:20 +0000 (16:58 -0700)
src/glsl/nir/nir_types.cpp
src/glsl/nir/nir_types.h

index f93a52b5fa5492fb5c8abf295fb723a4c9d102fe..a6d35fe617967715b357d5d3773a679ead799935 100644 (file)
@@ -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)
 {
index 40a80ec7130e93042895bb540fab7a0232b8e1a7..f19f0e5db5d541d8a10751965a1c96ee0e9c4398 100644 (file)
@@ -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);