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>
Sat, 7 Nov 2015 20:09:38 +0000 (12:09 -0800)
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
src/glsl/nir/nir_types.cpp
src/glsl/nir/nir_types.h

index 965f423..135591a 100644 (file)
@@ -144,6 +144,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 60d561b..b0b5184 100644 (file)
@@ -70,6 +70,7 @@ unsigned glsl_get_record_location_offset(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);