From 3129359ed7461b90fe6ea70641ec7a858dd656de Mon Sep 17 00:00:00 2001 From: Timothy Arceri Date: Thu, 15 Oct 2015 14:32:41 +1100 Subject: glsl: allow AoA to be sized by initializer or constructor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit V2: Split out unsized array validation to its own patch as suggested by Samuel. Reviewed-by: Samuel Iglesias Gonsálvez --- src/glsl/glsl_parser.yy | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/glsl/glsl_parser.yy') diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy index c1bcccc34f4..16c91710bbb 100644 --- a/src/glsl/glsl_parser.yy +++ b/src/glsl/glsl_parser.yy @@ -1962,7 +1962,9 @@ array_specifier: '[' ']' { void *ctx = state; - $$ = new(ctx) ast_array_specifier(@1); + $$ = new(ctx) ast_array_specifier(@1, new(ctx) ast_expression( + ast_unsized_array_dim, NULL, + NULL, NULL)); $$->set_location_range(@1, @2); } | '[' constant_expression ']' @@ -1973,17 +1975,16 @@ array_specifier: } | array_specifier '[' ']' { + void *ctx = state; $$ = $1; if (!state->ARB_arrays_of_arrays_enable) { _mesa_glsl_error(& @1, state, "GL_ARB_arrays_of_arrays " "required for defining arrays of arrays"); - } else { - _mesa_glsl_error(& @1, state, - "only the outermost array dimension can " - "be unsized"); } + $$->add_dimension(new(ctx) ast_expression(ast_unsized_array_dim, NULL, + NULL, NULL)); } | array_specifier '[' constant_expression ']' { -- cgit v1.2.3