More precisely check for the qualifiers that enable the vulkan memory model for buffer references.
Not all memory qualifiers necessarily need the vulkan memory model, e.g. volatile/restrict that correspond to core SPIR-V features do not.
This commit is contained in:
@@ -537,6 +537,11 @@ public:
|
||||
{
|
||||
return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || volatil || restrict || readonly || writeonly;
|
||||
}
|
||||
bool bufferReferenceNeedsVulkanMemoryModel() const
|
||||
{
|
||||
// include qualifiers that map to load/store availability/visibility/nonprivate memory access operands
|
||||
return subgroupcoherent || workgroupcoherent || queuefamilycoherent || devicecoherent || coherent || nonprivate;
|
||||
}
|
||||
|
||||
bool isInterpolation() const
|
||||
{
|
||||
|
||||
@@ -355,7 +355,7 @@ TIntermTyped* TParseContext::handleVariable(const TSourceLoc& loc, TSymbol* symb
|
||||
intermediate.addIoAccessed(*string);
|
||||
|
||||
if (variable->getType().getBasicType() == EbtReference &&
|
||||
variable->getType().getQualifier().isMemory()) {
|
||||
variable->getType().getQualifier().bufferReferenceNeedsVulkanMemoryModel()) {
|
||||
intermediate.setUseVulkanMemoryModel();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user