OSDN Git Service

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 f93a52b..a6d35fe 100644 (file)
@@ -143,6 +143,12 @@ glsl_type_is_scalar(const struct glsl_type *type)
 }
 
 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)
 {
    return type->is_matrix();
index 40a80ec..f19f0e5 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);