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.
+ /* Section 4.1.8 (Structures) of the GLSL 1.10 spec says:
+ *
+ * "Anonymous structures are not supported; so embedded structures
+ * must have a declarator. A name given to an embedded struct is
+ * scoped at the same level as the struct it is embedded in."
+ *
+ * The same section of the GLSL 1.20 spec says:
+ *
+ * "Anonymous structures are not supported. Embedded structures are
+ * not supported."
+ *
+ * The GLSL ES 1.00 and 3.00 specs have similar langauge. So, we allow
+ * embedded structures in 1.10 only.
*/
- if (state->es_shader && decl_list->type->specifier->structure != NULL) {
- _mesa_glsl_error(&loc, state, "embedded structure definitions are "
- "not allowed in GLSL ES 1.00");
- }
+ if (state->language_version != 110 &&
+ decl_list->type->specifier->structure != NULL)
+ _mesa_glsl_error(&loc, state,
+ "embedded structure declarations are not allowed");
const glsl_type *decl_type =
decl_list->type->glsl_type(& type_name, state);
{
YYLTYPE loc = this->get_location();
- /* Section 4.1.8 (Structures) of the GLSL 1.10 spec says:
- *
- * "Anonymous structures are not supported; so embedded structures must
- * have a declarator. A name given to an embedded struct is scoped at
- * the same level as the struct it is embedded in."
- *
- * The same section of the GLSL 1.20 spec says:
- *
- * "Anonymous structures are not supported. Embedded structures are not
- * supported.
- *
- * struct S { float f; };
- * struct T {
- * S; // Error: anonymous structures disallowed
- * struct { ... }; // Error: embedded structures disallowed
- * S s; // Okay: nested structures with name are allowed
- * };"
- *
- * The GLSL ES 1.00 and 3.00 specs have similar langauge and examples. So,
- * we allow embedded structures in 1.10 only.
- */
- if (state->language_version != 110 && state->struct_specifier_depth != 0)
- _mesa_glsl_error(&loc, state,
- "embedded structure declarations are not allowed");
-
- state->struct_specifier_depth++;
-
unsigned expl_location = 0;
if (layout && layout->flags.q.explicit_location) {
if (!process_qualifier_constant(state, &loc, "location",
}
}
- state->struct_specifier_depth--;
-
/* Structure type definitions do not have r-values.
*/
return NULL;
exec_list declared_variables;
glsl_struct_field *fields;
- /* Treat an interface block as one level of nesting, so that embedded struct
- * specifiers will be disallowed.
- */
- state->struct_specifier_depth++;
-
/* For blocks that accept memory qualifiers (i.e. shader storage), verify
* that we don't have incompatible qualifiers
*/
qual_stream,
expl_location);
- state->struct_specifier_depth--;
-
if (!redeclaring_per_vertex) {
validate_identifier(this->block_name, loc, state);