ast_to_hir: Reject embedded structure definitions in GLSL ES 1.00.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 16 Aug 2010 21:02:25 +0000 (14:02 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 8 Sep 2010 00:30:38 +0000 (17:30 -0700)
src/glsl/ast_to_hir.cpp

index e767c58e097321e0712f5ea713d57c21718779f4..9e639efd0ab0326fcd59e0bd29e7c369589e20a6 100644 (file)
@@ -2715,6 +2715,15 @@ ast_struct_specifier::hir(exec_list *instructions,
 
       decl_list->type->specifier->hir(instructions, state);
 
+      /* Section 10.9 of the GLSL ES 1.00 specification states that
+       * embedded structure definitions have been removed from the language.
+       */
+      if (state->es_shader && decl_list->type->specifier->structure != NULL) {
+        YYLTYPE loc = this->get_location();
+        _mesa_glsl_error(&loc, state, "Embedded structure definitions are "
+                         "not allowed in GLSL ES 1.00.");
+      }
+
       const glsl_type *decl_type =
         decl_list->type->specifier->glsl_type(& type_name, state);