nir/types: add more nir_type_is_xxx() wrappers
authorConnor Abbott <connor.w.abbott@intel.com>
Thu, 16 Jul 2015 04:58:32 +0000 (21:58 -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 d44d48095da254e13d7a7a75d398fb1d89cf15da..809a7cff79c7730f934307b01e59c166a09cb2b9 100644 (file)
@@ -168,6 +168,18 @@ glsl_type_is_matrix(const struct glsl_type *type)
    return type->is_matrix();
 }
 
+bool
+glsl_type_is_array(const struct glsl_type *type)
+{
+   return type->is_array();
+}
+
+bool
+glsl_type_is_struct(const struct glsl_type *type)
+{
+   return type->is_record() || type->is_interface();
+}
+
 bool
 glsl_type_is_sampler(const struct glsl_type *type)
 {
index 60e1d9d96fcee795787a0d97ff814ee69ef2c98f..a2fa7934e16c5125235004e47daf3d1bb7d61e86 100644 (file)
@@ -76,6 +76,8 @@ 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);
+bool glsl_type_is_array(const struct glsl_type *type);
+bool glsl_type_is_struct(const struct glsl_type *type);
 bool glsl_type_is_sampler(const struct glsl_type *type);
 bool glsl_sampler_type_is_shadow(const struct glsl_type *type);
 bool glsl_sampler_type_is_array(const struct glsl_type *type);