SPV: Protect getStorageClass() with a test that the thing is pointer.

This commit is contained in:
John Kessenich
2015-12-08 20:48:49 -07:00
parent 33661450c7
commit e00e72ded1
6 changed files with 128 additions and 5 deletions

View File

@@ -599,9 +599,11 @@ void TGlslangToSpvTraverser::visitSymbol(glslang::TIntermSymbol* symbol)
builder.setAccessChainLValue(id);
} else {
// finish off the entry-point SPV instruction by adding the Input/Output <id>
spv::StorageClass sc = builder.getStorageClass(id);
if (sc == spv::StorageClassInput || sc == spv::StorageClassOutput)
entryPoint->addIdOperand(id);
if (builder.isPointer(id)) {
spv::StorageClass sc = builder.getStorageClass(id);
if (sc == spv::StorageClassInput || sc == spv::StorageClassOutput)
entryPoint->addIdOperand(id);
}
}
}