mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-23 12:29:19 +01:00
Fix Texture
Trap Data Race
The trap callbacks did not wait on the `Texture` to complete synchronization to the guest, this resulted in races where the contents written to the texture would be overwritten by the synced content. This commit fixes that by waiting on the fences at the end of the trap callback.
This commit is contained in:
parent
cb7c3602e7
commit
4f6a67af36
@ -150,6 +150,7 @@ namespace skyline::gpu {
|
||||
if (!lock)
|
||||
return false;
|
||||
SynchronizeGuest(true); // We can skip trapping since the caller will do it
|
||||
WaitOnFence();
|
||||
return true;
|
||||
}, [this] {
|
||||
DirtyState expectedState{DirtyState::Clean};
|
||||
@ -161,6 +162,7 @@ namespace skyline::gpu {
|
||||
return false;
|
||||
SynchronizeGuest(true);
|
||||
dirtyState = DirtyState::CpuDirty; // We need to assume the texture is dirty since we don't know what the guest is writing
|
||||
WaitOnFence();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user