From 737e6e531c8eb155fcbd19ddd679336332bbc8c6 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Sun, 31 Dec 2023 21:00:23 +0100 Subject: Vulkan: Only recreate swapchain if the frame is bigger than the swap image. --- src/core/memory.h | 3 ++- src/video_core/renderer_vulkan/vk_present_manager.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/core/memory.h b/src/core/memory.h index 7bf05e177..e325dd613 100644 --- a/src/core/memory.h +++ b/src/core/memory.h @@ -683,7 +683,8 @@ public: } else { this->m_memory.WriteBlockUnsafe(this->m_addr, this->data(), this->size_bytes()); } - } else if constexpr ((FLAGS & GuestMemoryFlags::Safe) || (FLAGS & GuestMemoryFlags::Cached)) { + } else if constexpr ((FLAGS & GuestMemoryFlags::Safe) || + (FLAGS & GuestMemoryFlags::Cached)) { this->m_memory.InvalidateRegion(this->m_addr, this->size_bytes()); } } diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp index 5e7518d96..792ed9615 100644 --- a/src/video_core/renderer_vulkan/vk_present_manager.cpp +++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp @@ -329,7 +329,7 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) { // to account for that. const bool is_suboptimal = swapchain.NeedsRecreation(); const bool size_changed = - swapchain.GetWidth() != frame->width || swapchain.GetHeight() != frame->height; + swapchain.GetWidth() < frame->width || swapchain.GetHeight() < frame->height; if (is_suboptimal || size_changed) { RecreateSwapchain(frame); } -- cgit v1.2.3