diff --git a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp index 9d967faa..c5c48a30 100644 --- a/app/src/main/cpp/skyline/gpu/presentation_engine.cpp +++ b/app/src/main/cpp/skyline/gpu/presentation_engine.cpp @@ -377,8 +377,8 @@ namespace skyline::gpu { u64 PresentationEngine::Present(const std::shared_ptr &texture, i64 timestamp, i64 swapInterval, AndroidRect crop, NativeWindowScalingMode scalingMode, NativeWindowTransform transform, skyline::service::hosbinder::AndroidFence fence, const std::function &presentCallback) { if (!vkSurface.has_value()) { // We want this function to generally (not necessarily always) block when a surface is not present to implicitly pause the game - std::unique_lock lock(mutex); - surfaceCondition.wait(lock, [this]() { return vkSurface.has_value(); }); + std::unique_lock lock{mutex}; + surfaceCondition.wait(lock, [this] { return vkSurface.has_value(); }); } presentQueue.Push(PresentableFrame{ @@ -397,8 +397,7 @@ namespace skyline::gpu { } NativeWindowTransform PresentationEngine::GetTransformHint() { - std::unique_lock lock(mutex); - surfaceCondition.wait(lock, [this]() { return vkSurface.has_value(); }); + std::unique_lock lock{mutex}; return GetAndroidTransform(vkSurfaceCapabilities.currentTransform); } } diff --git a/app/src/main/cpp/skyline/gpu/presentation_engine.h b/app/src/main/cpp/skyline/gpu/presentation_engine.h index 03b3b5b7..2fbcee04 100644 --- a/app/src/main/cpp/skyline/gpu/presentation_engine.h +++ b/app/src/main/cpp/skyline/gpu/presentation_engine.h @@ -32,7 +32,7 @@ namespace skyline::gpu { i64 windowLastTimestamp{}; //!< The last timestamp submitted to the window, 0 or CLOCK_MONOTONIC value std::optional vkSurface; //!< The Vulkan Surface object that is backed by ANativeWindow - vk::SurfaceCapabilitiesKHR vkSurfaceCapabilities; //!< The capabilities of the current Vulkan Surface + vk::SurfaceCapabilitiesKHR vkSurfaceCapabilities{}; //!< The capabilities of the current Vulkan Surface std::optional vkSwapchain; //!< The Vulkan swapchain and the properties associated with it vk::raii::Fence acquireFence; //!< A fence for acquiring an image from the swapchain