Fix GetReadOnlyBackingSpan for non-direct buffers

This was missed in the initial implementation
This commit is contained in:
Billy Laws 2022-12-31 23:03:55 +00:00
parent 4e5141f879
commit 1a6165f74d

View File

@ -620,9 +620,13 @@ namespace skyline::gpu {
}
span<u8> Buffer::GetReadOnlyBackingSpan(bool isFirstUsage, const std::function<void()> &flushHostCallback) {
std::scoped_lock lock{stateMutex};
if (dirtyState == DirtyState::GpuDirty)
SynchronizeGuestImmediate(isFirstUsage, flushHostCallback);
if (!isDirect) {
std::unique_lock lock{stateMutex};
if (dirtyState == DirtyState::GpuDirty)
SynchronizeGuestImmediate(isFirstUsage, flushHostCallback);
} else {
RefreshGpuWritesActiveDirect(true, flushHostCallback);
}
return mirror;
}