On Tue, 2015-04-28 at 23:08 +0300, Abdiel Janulgue wrote: > Signed-off-by: Abdiel Janulgue <abdiel.janul...@linux.intel.com> > --- > src/glsl/nir/nir_types.cpp | 5 +++++ > src/glsl/nir/nir_types.h | 2 ++ > 2 files changed, 7 insertions(+) > > diff --git a/src/glsl/nir/nir_types.cpp b/src/glsl/nir/nir_types.cpp > index f0d0b46..249678f 100644 > --- a/src/glsl/nir/nir_types.cpp > +++ b/src/glsl/nir/nir_types.cpp > @@ -82,6 +82,11 @@ glsl_get_base_type(const struct glsl_type *type) > return type->base_type; > } > > +const struct glsl_type * > +glsl_get_element_type(const struct glsl_type *type) > +{ > + return type->element_type();
I've sent a patch to remove the element_type() helper. I'm yet to see a case where just using is_array() and/or without_array() don't result in clearer code with the added advantage (in most cases) of free multidimensional array support. http://lists.freedesktop.org/archives/mesa-dev/2015-April/083195.html > +} > unsigned > glsl_get_vector_elements(const struct glsl_type *type) > { > diff --git a/src/glsl/nir/nir_types.h b/src/glsl/nir/nir_types.h > index 276d4ad..125f075 100644 > --- a/src/glsl/nir/nir_types.h > +++ b/src/glsl/nir/nir_types.h > @@ -49,6 +49,8 @@ const struct glsl_type *glsl_get_array_element(const struct > glsl_type *type); > > const struct glsl_type *glsl_get_column_type(const struct glsl_type *type); > > +const struct glsl_type *glsl_get_element_type(const struct glsl_type *type); > + > enum glsl_base_type glsl_get_base_type(const struct glsl_type *type); > > unsigned glsl_get_vector_elements(const struct glsl_type *type); _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev