glsl: enforce restriction on AoA interface blocks in GLSL ES 3.10
authorTimothy Arceri <t_arceri@yahoo.com.au>
Wed, 10 Jun 2015 09:40:07 +0000 (19:40 +1000)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Fri, 12 Jun 2015 22:31:21 +0000 (08:31 +1000)
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/glsl/ast_to_hir.cpp

index 1c2c7b56efa25e8e507084def4637762f6af2461..a7811af5d0fb526d8fe3aa4ca1c12113c7a24718 100644 (file)
@@ -5847,6 +5847,17 @@ ast_interface_block::hir(exec_list *instructions,
          const glsl_type *block_array_type =
             process_array_type(&loc, block_type, this->array_specifier, state);
 
+          /* From section 4.3.9 (Interface Blocks) of the GLSL ES 3.10 spec:
+          *
+          *     * Arrays of arrays of blocks are not allowed
+          */
+         if (state->es_shader && block_array_type->is_array() &&
+             block_array_type->fields.array->is_array()) {
+            _mesa_glsl_error(&loc, state,
+                             "arrays of arrays interface blocks are "
+                             "not allowed");
+         }
+
          var = new(state) ir_variable(block_array_type,
                                       this->instance_name,
                                       var_mode);