ParseHelper: assign global XfbBuffer to a block missing it
authorAlejandro Piñeiro <apinheiro@igalia.com>
Tue, 23 Oct 2018 12:54:26 +0000 (14:54 +0200)
committerAlejandro Piñeiro <apinheiro@igalia.com>
Sat, 10 Nov 2018 10:35:50 +0000 (11:35 +0100)
commitadba7dfc68f0590f54b8d29f4413057aa5693412
treeb706620925f99594394e10da4d3a29d9ab83ae3c
parent918caa7ee4df3ec283a6835a6988d641514705fe
ParseHelper: assign global XfbBuffer to a block missing it

If a block has assigned a XfbOffset it is assumed that it would
inherit the current global XfbBuffer. This commit fixes two use cases:

1) Getting the members of a Block with a XfbOffset to be assigned an
   offset, as explained on GLSL 4.60 spec, section "4.4.2 Output
   Layout Qualifiers", subsection "Transform Feedback Layout
   Qualifiers".

2) Compute properly an error on overlapping ranges if a block is
   assigned a XfbOffset and one of it members is assigned a explicit
   one. This gets working because when the members of a block get
   assigned a Offset/Buffer at fixBlockXfbOffsets, then the block is
   deassigned the Offsets, so ranges are computed only with the block
   members.

BTW, this is already done when redeclaring block builtins.

Fixes #1535
Test/baseResults/spv.xfbOffsetOnBlockMembersAssignment.vert.out [new file with mode: 0644]
Test/baseResults/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert.out [new file with mode: 0644]
Test/spv.xfbOffsetOnBlockMembersAssignment.vert [new file with mode: 0644]
Test/spv.xfbOverlapOffsetCheckWithBlockAndMember.vert [new file with mode: 0644]
glslang/MachineIndependent/ParseHelper.cpp
gtests/Spv.FromFile.cpp