SPV: Memory qualifiers should decorate top-level block members

This commit is contained in:
Rex Xu
2017-07-27 14:33:16 +08:00
parent f1f5058a3c
commit 286ca432cf
5 changed files with 3 additions and 10 deletions

View File

@@ -2531,7 +2531,9 @@ void TGlslangToSpvTraverser::decorateStructType(const glslang::TType& type,
}
addMemberDecoration(spvType, member, TranslateInvariantDecoration(memberQualifier));
if (qualifier.storage == glslang::EvqBuffer) {
if (type.getBasicType() == glslang::EbtBlock &&
qualifier.storage == glslang::EvqBuffer) {
// Add memory decorations only to top-level members of shader storage block
std::vector<spv::Decoration> memory;
TranslateMemoryDecoration(memberQualifier, memory);
for (unsigned int i = 0; i < memory.size(); ++i)