glsl: add member's location layout qualifier rules for `arrayed` in/out blocks
This MR was posted on mesa in the past but was coincidentally removed together with account, so I recreated it from backup account here.
As far as I remember it was reviewed by @mareko and I would like to re-confirm it.
Note: This MR was waiting for VK-GL-CTS fix: https://github.com/KhronosGroup/VK-GL-CTS/pull/258
From Section 4.4.1 (Input Layout Qualifiers) of the GLSL 4.50 spec:
"For some blocks declared as arrays, the location can only be applied
at the block level: When a block is declared as an array where
additional locations are needed for each member for each block array
element, it is a compile-time error to specify locations on the block
members. That is, when locations would be under specified by applying
them on block members, they are not allowed on block members. For
arrayed interfaces (those generally having an extra level of
arrayness due to interface expansion), the outer array is stripped
before applying this rule"
From Section 1.2.1 (Changes from Revision 6 of GLSL Version) of the GLSL 4.50 spec:
"Private Bug 15678: Don’t allow location = on block members where
the block needs an array of locations"
From Section 4.4.1 (Input Layout Qualifiers) of the GLSL ES 3.20 spec
"If an input is declared as an array of blocks, excluding per-vertex-arrays
as required for tessellation, it is an error to declare a member of
the block with a location qualifier"
From Section 1.1.3 (Changes from GLSL ES 3.2 revision 3) of the GLSL ES 3.20 spec:
"Arrayed blocks cannot have layout location qualifiers on members"
/cc @tarceri
Signed-off-by: Andrii Simiklit andrii.simiklit@globallogic.com