From the GL_ARB_arrays_of_arrays spec:
"For unsized arrays, only the outermost dimension can be lacking a
size. A type that includes an unknown array size cannot be formed
into an array until it gets an explicit size."
This is later further detailed as per OpenGLĀ® Shading Language 4.40.
From page 3 (page 9 of the PDF) of the GLSL 4.00 v9 spec:
"* Bug 11987: Allow array-of-array constructors and initialized
variables to have any dimension unsized (not just the outer
dimension) and get their size from the content of the constructor
or initializer."
From page 37 (page 43 of the PDF) of the GLSL 4.00 v9 spec:
" vec4 a[][] = { vec4[2](vec4(0.0), vec4(1.0)), // okay, size to
vec4[2](vec4(0.0), vec4(1.0)), // a[3][2]
vec4[2](vec4(0.0), vec4(1.0)) };"
From page 38 (page 44 of the PDF) of the GLSL 4.00 v9 spec:
"For implicitly-sized or run-time-sized arrays, only the outermost
dimension can be lacking a size. A type that includes an unknown
array size cannot be formed into an array until it gets an explicit
size, except for shader storage blocks where the only unsized array
member is the last member of the block."
Hence, in the absence of a constructor/initializer, unsized arrays are
only allowed for the outermost dimension of an AoA.
Fixes #22.
Change-Id: I0ca0488d6fa29f37578df2270d87ee72b4ecb944
DEFAULT_MAIN_ENDING(tested_shader_type, shader_source);
/* Execute test */
- EXECUTE_SHADER_TEST(API::ALLOW_UNSIZED_DECLARATION, tested_shader_type, shader_source);
+ this->execute_negative_test(tested_shader_type, shader_source);
} /* for (int max_dimension_index = 2; ...) */
}