Add flag to check whether offset is implicit or explicit (#2031)
authorChow <laddoc@outlook.com>
Wed, 11 Mar 2020 09:59:25 +0000 (17:59 +0800)
committerGitHub <noreply@github.com>
Wed, 11 Mar 2020 09:59:25 +0000 (03:59 -0600)
commit9b620aa0c12d12dd7ec7ced43ce9e58f275d47c1
tree54da864be96e931f430a3590e16a0e3996c1b76a
parent56a7e020561af357f052e15cce8fd2bdaeabf44b
Add flag to check whether offset is implicit or explicit (#2031)

When we use unsized array in shader storage buffer, glslang calculate the offset during delcaring the block, it may lead to incorrect block offsets when its implicit array size changed.

So here is what we do:
1. For GLSL, we add flag explicitOffset in TQualifier, and set it when layout offset is specified explicitly
2. By using this flag we could tell difference as whether it is an explicit offset, and recalculate the block member offset conditionally in OpenGL.
glslang/Include/Types.h
glslang/MachineIndependent/ParseHelper.cpp