瀏覽代碼

Vulkan: Only recreate swapchain if the frame is bigger than the swap image.

Fernando Sahmkow 2 年之前
父節點
當前提交
737e6e531c
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 2 1
      src/core/memory.h
  2. 1 1
      src/video_core/renderer_vulkan/vk_present_manager.cpp

+ 2 - 1
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());
             }
         }

+ 1 - 1
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);
     }