diff options
author | Timothy Arceri <[email protected]> | 2016-03-08 20:35:41 +1100 |
---|---|---|
committer | Timothy Arceri <[email protected]> | 2016-03-09 20:30:42 +1100 |
commit | 2188c77a0ee9b29f89dde316116d53fe22e526e0 (patch) | |
tree | 88a77fc5614373937a0402d565a7e4daeadd3a4a /src/compiler/glsl | |
parent | 353a4f844f9e845dad93de9c28fa0d484b4b92d3 (diff) |
glsl: dont allow undefined array sizes in ES
This applies the rule to empty declarations.
Fixes:
dEQP-GLES3.functional.shaders.arrays.invalid.empty_declaration_without_var_name_vertex
dEQP-GLES3.functional.shaders.arrays.invalid.empty_declaration_without_var_name_fragment
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/compiler/glsl')
-rw-r--r-- | src/compiler/glsl/ast_to_hir.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/compiler/glsl/ast_to_hir.cpp b/src/compiler/glsl/ast_to_hir.cpp index d755a11727f..5262bd87655 100644 --- a/src/compiler/glsl/ast_to_hir.cpp +++ b/src/compiler/glsl/ast_to_hir.cpp @@ -4223,6 +4223,18 @@ ast_declarator_list::hir(exec_list *instructions, type_name); } else { if (decl_type->base_type == GLSL_TYPE_ARRAY) { + /* From Section 13.22 (Array Declarations) of the GLSL ES 3.2 + * spec: + * + * "... any declaration that leaves the size undefined is + * disallowed as this would add complexity and there are no + * use-cases." + */ + if (state->es_shader && decl_type->is_unsized_array()) { + _mesa_glsl_error(&loc, state, "array size must be explicitly " + "or implicitly defined"); + } + /* From Section 4.12 (Empty Declarations) of the GLSL 4.5 spec: * * "The combinations of types and qualifiers that cause |