From 3a1bc6a86b1da72fd9b21a58037b7ef526909b58 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 23 May 2020 00:12:22 -0700 Subject: [PATCH] GPU: Never set safe size larger than the buffer. Maybe this indicates the buffer size is wrong, but a safe size larger than the buffer will make us try to download outside the buffer and lose the Vulkan device. --- GPU/Common/FramebufferCommon.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index a14209c6c3..07f16b1bf0 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -1686,8 +1686,8 @@ void FramebufferManagerCommon::SetRenderSize(VirtualFramebuffer *vfb) { void FramebufferManagerCommon::SetSafeSize(u16 w, u16 h) { VirtualFramebuffer *vfb = currentRenderVfb_; if (vfb) { - vfb->safeWidth = std::max(vfb->safeWidth, w); - vfb->safeHeight = std::max(vfb->safeHeight, h); + vfb->safeWidth = std::min(vfb->bufferWidth, std::max(vfb->safeWidth, w)); + vfb->safeHeight = std::min(vfb->bufferHeight, std::max(vfb->safeHeight, h)); } }