Add missing capability when QueueFamily scope is used

Also, if this capability is added and the memory model is not
otherwise enabled by pragma, enable it as part of postprocessing.
This commit is contained in:
Jeff Bolz
2021-01-27 13:14:34 -06:00
parent 36df92e4a0
commit bfd84a39f2
5 changed files with 65 additions and 0 deletions

View File

@@ -6996,6 +6996,10 @@ spv::Id TGlslangToSpvTraverser::createAtomicOperation(glslang::TOperator op, spv
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
}
if (builder.getConstantScalar(scopeId) == spv::ScopeQueueFamily) {
builder.addCapability(spv::CapabilityVulkanMemoryModelKHR);
}
if (glslangIntermediate->usingVulkanMemoryModel() && builder.getConstantScalar(scopeId) == spv::ScopeDevice) {
builder.addCapability(spv::CapabilityVulkanMemoryModelDeviceScopeKHR);
}