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.
Affects:
GL43-CTS.arrays_of_arrays_gl.InteractionStorageBuffers3
Components: OpenGL
VK-GL-CTS issue: 145
Change-Id: Ic751b3ff52a84e3aee604552edf9441211890a11
DEFAULT_MAIN_ENDING(tested_shader_type, shader_source);
/* Execute test */
- EXECUTE_SHADER_TEST(API::ALLOW_UNSIZED_DECLARATION, tested_shader_type, shader_source);
+ EXECUTE_SHADER_TEST(API::ALLOW_UNSIZED_DECLARATION && invalid_size_declarations_index == 3,
+ tested_shader_type, shader_source);
} /* for (int invalid_size_declarations_index = 0; ...) */
}
else