diff --git a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp index c705991f..7557e4bb 100644 --- a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp +++ b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp @@ -225,6 +225,7 @@ namespace skyline::gpu { std::unique_lock lock(mutex); surfaceCondition.wait(lock, [this]() { return vkSurface.has_value(); }); + std::scoped_lock textureLock(*texture); if (texture->format != swapchainFormat || texture->dimensions != swapchainExtent) UpdateSwapchain(texture->format, texture->dimensions); @@ -258,6 +259,8 @@ namespace skyline::gpu { } std::ignore = gpu.vkDevice.waitForFences(*acquireFence, true, std::numeric_limits::max()); + + texture->SynchronizeHost(); images.at(nextImage.second)->CopyFrom(texture, vk::ImageSubresourceRange{ .aspectMask = vk::ImageAspectFlagBits::eColor, .levelCount = 1, diff --git a/app/src/main/cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp b/app/src/main/cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp index decd90df..eee43472 100644 --- a/app/src/main/cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp +++ b/app/src/main/cpp/skyline/services/hosbinder/GraphicBufferProducer.cpp @@ -386,11 +386,8 @@ namespace skyline::service::hosbinder { fence.Wait(state.soc->host1x); { - auto &texture{buffer.texture}; - std::scoped_lock textureLock(*texture); - texture->SynchronizeHost(); u64 frameId; - state.gpu->presentation.Present(texture, isAutoTimestamp ? 0 : timestamp, swapInterval, crop, scalingMode, transform, frameId); + state.gpu->presentation.Present(buffer.texture, isAutoTimestamp ? 0 : timestamp, swapInterval, crop, scalingMode, transform, frameId); } buffer.frameNumber = ++frameNumber;