1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-02-27 04:54:15 +01:00

[dxbc] Fix memory semantics for atomic operations

This commit is contained in:
Philip Rebohle 2020-02-13 01:15:06 +01:00
parent 4aa6800e95
commit 313d46984d
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99

View File

@ -2279,9 +2279,13 @@ namespace dxvk {
// (srcX) As above
const DxbcBufferInfo bufferInfo = getBufferInfo(ins.dst[ins.dstCount - 1]);
const bool isImm = ins.dstCount == 2;
const bool isUav = ins.dst[ins.dstCount - 1].type == DxbcOperandType::UnorderedAccessView;
bool isImm = ins.dstCount == 2;
bool isUav = ins.dst[ins.dstCount - 1].type == DxbcOperandType::UnorderedAccessView;
bool isSsbo = m_moduleInfo.options.minSsboAlignment <= bufferInfo.align
&& bufferInfo.type != DxbcResourceType::Typed
&& isUav;
// Perform atomic operations on UAVs only if the UAV
// is bound and if there is nothing else stopping us.
DxbcConditional cond;
@ -2317,8 +2321,11 @@ namespace dxvk {
if (isUav) {
scope = spv::ScopeDevice;
semantics = spv::MemorySemanticsImageMemoryMask
| spv::MemorySemanticsAcquireReleaseMask;
semantics = spv::MemorySemanticsAcquireReleaseMask;
semantics |= isSsbo
? spv::MemorySemanticsUniformMemoryMask
: spv::MemorySemanticsImageMemoryMask;
} else {
scope = spv::ScopeWorkgroup;
semantics = spv::MemorySemanticsWorkgroupMemoryMask