Unsized array of arrays in uniform variable
authorAndres Gomez <agomez@igalia.com>
Tue, 20 Dec 2016 16:57:57 +0000 (18:57 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 24 Feb 2017 16:49:02 +0000 (11:49 -0500)
commit629518ebe1816de7710ae43283d86f4c4e444fd0
treebde3e384834145bf62aa477ddc1316448367a42f
parent3fe566af4bcd9ce3b6cb2c3c6b0854d0a391a6cb
Unsized array of arrays in uniform variable

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.InteractionUniforms2

Components: OpenGL
VK-GL-CTS issue: 144

Change-Id: Icd3e710f1bb69b35355a5c4172dc8839b9f98c82
external/openglcts/modules/gles31/es31cArrayOfArraysTests.cpp