glsl: add member's location layout qualifier rules for `arrayed` in/out blocks
authorAndrii Simiklit <asimiklit.work@gmail.com>
Fri, 31 Jul 2020 11:53:25 +0000 (14:53 +0300)
committerMarge Bot <emma+marge@anholt.net>
Thu, 3 Mar 2022 05:42:45 +0000 (05:42 +0000)
commitddf2778269e4a5315964ee043abace895084aaa2
tree9a2c275567f542cd6d3bc2cf72eb79dd56418b31
parent0313110c9203b200425351ce8d4caf7b589c2bb1
glsl: add member's location layout qualifier rules for `arrayed` in/out blocks

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"

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Signed-off-by: Andrii Simiklit <andrii.simiklit@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11522>
src/compiler/glsl/ast_to_hir.cpp
src/gallium/drivers/llvmpipe/ci/llvmpipe-fails.txt
src/gallium/drivers/radeonsi/ci/navi10-piglit-quick-fail.csv
src/gallium/drivers/radeonsi/ci/raven-piglit-quick-fail.csv
src/gallium/drivers/radeonsi/ci/sienna_cichlid-piglit-quick-fail.csv
src/gallium/drivers/radeonsi/ci/vega20-piglit-quick-fail.csv
src/gallium/drivers/zink/ci/zink-radv-fails.txt