From: Timothy Arceri Date: Tue, 9 Jun 2015 06:53:55 +0000 (+1000) Subject: glsl: remove restriction on unsized arrays in GLSL ES 3.10 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=adee54f8269c5e9f4fde91d19f0e465afc8f14d8;p=mesa.git glsl: remove restriction on unsized arrays in GLSL ES 3.10 Reviewed-by: Tapani Pälli --- diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp index 8aebb1320f1..aab0c290c07 100644 --- a/src/glsl/ast_to_hir.cpp +++ b/src/glsl/ast_to_hir.cpp @@ -3849,7 +3849,15 @@ ast_declarator_list::hir(exec_list *instructions, decl->identifier); } - if (state->es_shader) { + /* GLSL ES 3.10 removes the restriction on unsized arrays. + * + * Section 4.1.9 (Arrays) of the GLSL ES 3.10 spec says: + * + * "Variables of the same type can be aggregated into arrays by + * declaring a name followed by brackets ([ ]) enclosing an + * optional size." + */ + if (state->es_shader && state->language_version < 310) { const glsl_type *const t = (earlier == NULL) ? var->type : earlier->type;