Mesa (master): glsl: remove restriction on unsized arrays in GLSL ES 3.10

Timothy Arceri tarceri at kemper.freedesktop.org
Wed Jun 10 08:54:57 UTC 2015


Module: Mesa
Branch: master
Commit: adee54f8269c5e9f4fde91d19f0e465afc8f14d8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=adee54f8269c5e9f4fde91d19f0e465afc8f14d8

Author: Timothy Arceri <t_arceri at yahoo.com.au>
Date:   Tue Jun  9 16:53:55 2015 +1000

glsl: remove restriction on unsized arrays in GLSL ES 3.10

Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

---

 src/glsl/ast_to_hir.cpp |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/glsl/ast_to_hir.cpp b/src/glsl/ast_to_hir.cpp
index 8aebb13..aab0c29 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;
 




More information about the mesa-commit mailing list