mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-12-29 14:15:29 +03:00
Extend stateMutex
scope inside Buffer::SynchronizeHost
The code is much simpler to reason about when reading the code as it doesn't require evaluating all the potential edge cases of trap handlers in different states. It should be noted that this should not change behavior in any meaningful way, at most it can prevent a minor race where the protection could be upgraded after being downgraded by the signal handler leading to a redundant trap.
This commit is contained in:
parent
c3cf79cb39
commit
c1bf5a804a
@ -161,12 +161,13 @@ namespace skyline::gpu {
|
||||
|
||||
dirtyState = DirtyState::Clean;
|
||||
WaitOnFence();
|
||||
|
||||
AdvanceSequence(); // We are modifying GPU backing contents so advance to the next sequence
|
||||
|
||||
if (!skipTrap)
|
||||
gpu.state.nce->TrapRegions(*trapHandle, true); // Trap any future CPU writes to this buffer, must be done before the memcpy so that any modifications during the copy are tracked
|
||||
}
|
||||
|
||||
AdvanceSequence(); // We are modifying GPU backing contents so advance to the next sequence
|
||||
|
||||
if (!skipTrap)
|
||||
gpu.state.nce->TrapRegions(*trapHandle, true); // Trap any future CPU writes to this buffer, must be done before the memcpy so that any modifications during the copy are tracked
|
||||
std::memcpy(backing.data(), mirror.data(), mirror.size());
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user