From 1a6165f74d48f88ff69b02b67f644d90c5c2c7d7 Mon Sep 17 00:00:00 2001 From: Billy Laws Date: Sat, 31 Dec 2022 23:03:55 +0000 Subject: [PATCH] Fix GetReadOnlyBackingSpan for non-direct buffers This was missed in the initial implementation --- app/src/main/cpp/skyline/gpu/buffer.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/cpp/skyline/gpu/buffer.cpp b/app/src/main/cpp/skyline/gpu/buffer.cpp index b108b86f..8159456f 100644 --- a/app/src/main/cpp/skyline/gpu/buffer.cpp +++ b/app/src/main/cpp/skyline/gpu/buffer.cpp @@ -620,9 +620,13 @@ namespace skyline::gpu { } span Buffer::GetReadOnlyBackingSpan(bool isFirstUsage, const std::function &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; }