mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxbc] Fix memory semantics for atomic operations
This commit is contained in:
parent
4aa6800e95
commit
313d46984d
@ -2279,9 +2279,13 @@ namespace dxvk {
|
|||||||
// (srcX) As above
|
// (srcX) As above
|
||||||
const DxbcBufferInfo bufferInfo = getBufferInfo(ins.dst[ins.dstCount - 1]);
|
const DxbcBufferInfo bufferInfo = getBufferInfo(ins.dst[ins.dstCount - 1]);
|
||||||
|
|
||||||
const bool isImm = ins.dstCount == 2;
|
bool isImm = ins.dstCount == 2;
|
||||||
const bool isUav = ins.dst[ins.dstCount - 1].type == DxbcOperandType::UnorderedAccessView;
|
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
|
// Perform atomic operations on UAVs only if the UAV
|
||||||
// is bound and if there is nothing else stopping us.
|
// is bound and if there is nothing else stopping us.
|
||||||
DxbcConditional cond;
|
DxbcConditional cond;
|
||||||
@ -2317,8 +2321,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
if (isUav) {
|
if (isUav) {
|
||||||
scope = spv::ScopeDevice;
|
scope = spv::ScopeDevice;
|
||||||
semantics = spv::MemorySemanticsImageMemoryMask
|
semantics = spv::MemorySemanticsAcquireReleaseMask;
|
||||||
| spv::MemorySemanticsAcquireReleaseMask;
|
|
||||||
|
semantics |= isSsbo
|
||||||
|
? spv::MemorySemanticsUniformMemoryMask
|
||||||
|
: spv::MemorySemanticsImageMemoryMask;
|
||||||
} else {
|
} else {
|
||||||
scope = spv::ScopeWorkgroup;
|
scope = spv::ScopeWorkgroup;
|
||||||
semantics = spv::MemorySemanticsWorkgroupMemoryMask
|
semantics = spv::MemorySemanticsWorkgroupMemoryMask
|
||||||
|
Loading…
x
Reference in New Issue
Block a user