Fix setDirty behavior in Buffer::SynchronizeGuest

The condition for `setDirty` in the dirty state CAS was inverted from what it should've been resulting in synchronizing incorrectly, this commit fixes the condition to correct synchronization.
This commit is contained in:
Billy Laws 2022-07-17 18:08:17 +05:30 committed by PixelyIon
parent 00d434efdc
commit d1a682eace
No known key found for this signature in database
GPG Key ID: 11BC6C3201BC2C05

View File

@ -166,7 +166,7 @@ namespace skyline::gpu {
auto currentState{dirtyState.load(std::memory_order_relaxed)};
do {
if (currentState == DirtyState::CpuDirty || (currentState == DirtyState::Clean && setDirty))
if (currentState == DirtyState::CpuDirty || (currentState == DirtyState::Clean && !setDirty))
return true; // If the buffer is synchronized (Clean/CpuDirty), there is no need to synchronize it
else if (currentState == DirtyState::GpuDirty && nonBlocking && !PollFence())
return false; // If the buffer is GPU dirty and the fence is not signalled then we can't block