static const glsl_type *
-process_array_type(const glsl_type *base, ast_node *array_size,
+process_array_type(YYLTYPE *loc, const glsl_type *base, ast_node *array_size,
struct _mesa_glsl_parse_state *state)
{
unsigned length = 0;
}
}
}
+ } else if (state->es_shader) {
+ /* Section 10.17 of the GLSL ES 1.00 specification states that unsized
+ * array declarations have been removed from the language.
+ */
+ _mesa_glsl_error(loc, state, "unsized array declarations are not "
+ "allowed in GLSL ES 1.00.");
}
return glsl_type::get_array_instance(base, length);
*name = this->type_name;
if (this->is_array) {
- type = process_array_type(type, this->array_size, state);
+ YYLTYPE loc = this->get_location();
+ type = process_array_type(&loc, type, this->array_size, state);
}
}
}
if (decl->is_array) {
- var_type = process_array_type(decl_type, decl->array_size, state);
+ var_type = process_array_type(&loc, decl_type, decl->array_size,
+ state);
} else {
var_type = decl_type;
}
* call already handled the "vec4[..] foo" case.
*/
if (this->is_array) {
- type = process_array_type(type, this->array_size, state);
+ type = process_array_type(&loc, type, this->array_size, state);
}
if (type->array_size() == 0) {
foreach_list_typed (ast_declaration, decl, link,
&decl_list->declarations) {
- const struct glsl_type *const field_type =
- (decl->is_array)
- ? process_array_type(decl_type, decl->array_size, state)
- : decl_type;
-
+ const struct glsl_type *field_type = decl_type;
+ if (decl->is_array) {
+ YYLTYPE loc = decl->get_location();
+ field_type = process_array_type(&loc, decl_type, decl->array_size,
+ state);
+ }
fields[i].type = (field_type != NULL)
? field_type : glsl_type::error_type;
fields[i].name = decl->identifier;