SPV 1.4: Generate all globals on OpEntryPoint interface list.
This commit is contained in:
parent
2dd4ab3a4a
commit
7c7731ecbb
@ -1552,10 +1552,16 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
|
|||||||
|
|
||||||
// Include all "static use" and "linkage only" interface variables on the OpEntryPoint instruction
|
// Include all "static use" and "linkage only" interface variables on the OpEntryPoint instruction
|
||||||
if (builder.isPointer(id)) {
|
if (builder.isPointer(id)) {
|
||||||
spv::StorageClass sc = builder.getStorageClass(id);
|
// Consider adding to the OpEntryPoint interface list.
|
||||||
if (sc == spv::StorageClassInput || sc == spv::StorageClassOutput) {
|
// Only looking at structures if they have at least one member.
|
||||||
if (!symbol->getType().isStruct() || symbol->getType().getStruct()->size() > 0)
|
if (!symbol->getType().isStruct() || symbol->getType().getStruct()->size() > 0) {
|
||||||
|
spv::StorageClass sc = builder.getStorageClass(id);
|
||||||
|
// Before SPIR-V 1.4, we only want to include Input and Output.
|
||||||
|
// Starting with SPIR-V 1.4, we want all globals.
|
||||||
|
if ((glslangIntermediate->getSpv().spv >= glslang::EShTargetSpv_1_4 && sc != spv::StorageClassFunction) ||
|
||||||
|
(sc == spv::StorageClassInput || sc == spv::StorageClassOutput)) {
|
||||||
iOSet.insert(id);
|
iOSet.insert(id);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user