[Mesa-dev] [PATCH 4/9] glsl: Add array specifier to ast code
Timothy Arceri
t_arceri at yahoo.com.au
Fri Jan 17 19:57:00 PST 2014
> >
> > diff --git a/src/glsl/glsl_parser_extras.cpp b/src/glsl/glsl_parser_extras.cpp
> > index 21dc3ab..92076b5 100644
> > --- a/src/glsl/glsl_parser_extras.cpp
> > +++ b/src/glsl/glsl_parser_extras.cpp
> > @@ -484,6 +484,7 @@ struct _mesa_glsl_extension {
> > static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = {
> > /* API availability */
> > /* name GL ES supported flag */
> > + EXT(ARB_arrays_of_arrays, true, false, ARB_arrays_of_arrays),
> > EXT(ARB_conservative_depth, true, false, ARB_conservative_depth),
> > EXT(ARB_draw_buffers, true, false, dummy_true),
> > EXT(ARB_draw_instanced, true, false, ARB_draw_instanced),
> > @@ -769,7 +770,7 @@ _mesa_ast_set_aggregate_type(const ast_type_specifier *type,
> > link);
> >
> > bool is_array = decl_list->type->specifier->is_array;
> > - ast_expression *array_size = decl_list->type->specifier->array_size;
> > + ast_array_specifier *array_specifier = decl_list->type->specifier->array_specifier;
> >
> > /* Recognize variable declarations with the bracketed size attached
> > * to the type rather than the variable name as arrays. E.g.,
> > @@ -777,19 +778,18 @@ _mesa_ast_set_aggregate_type(const ast_type_specifier *type,
> > * float a[2];
> > * float[2] b;
> > *
> > - * are both arrays, but <a>'s array_size is decl->array_size, while
> > - * <b>'s array_size is decl_list->type->specifier->array_size.
> > + * are both arrays, but <a>'s array_specifier is decl->array_specifier, while
> > + * <b>'s array_specifier is decl_list->type->specifier->array_specifier.
> > */
> > if (!is_array) {
> > - /* FINISHME: Update when ARB_array_of_arrays is supported. */
>
> There's another identical FINISHME in this function that I don't see
> in this patch.
>
> > is_array = decl->is_array;
> > - array_size = decl->array_size;
> > + array_specifier = decl->array_specifier;
> > }
>
> I don't think this is going to work for
>
> float[2] a[3]
>
> will it? is_array will be true, but the whole array_specifier won't be complete.
>
The arrays of arrays support is added in patch 7. These changes are just
to get things working with new array specifier. I should have left the
TODO removal until patch 7.
More information about the mesa-dev
mailing list