glsl: remove restriction on unsized arrays in GLSL ES 3.10
authorTimothy Arceri <t_arceri@yahoo.com.au>
Tue, 9 Jun 2015 06:53:55 +0000 (16:53 +1000)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Wed, 10 Jun 2015 08:54:43 +0000 (18:54 +1000)
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/glsl/ast_to_hir.cpp

index 8aebb1320f1a002dd4634446504c994dc46fc857..aab0c290c075be4fa2b0a1e75870220ac7a419d7 100644 (file)
@@ -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;