From 088ced7261e8b2302d0c390ee25128462ea608df Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 12 Apr 2017 00:19:02 -0700 Subject: [PATCH 1/2] Fix framebuffer size flopping back and forth. If block transfers are keeping it larger, keep it larger. --- GPU/Common/FramebufferCommon.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index 1d29463e2d..c410e709e4 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -1532,6 +1532,10 @@ void FramebufferManagerCommon::NotifyBlockTransferAfter(u32 dstBasePtr, int dstS // The buffer isn't big enough, and we have a clear hint of size. Resize. // This happens in Valkyrie Profile when uploading video at the ending. ResizeFramebufFBO(dstBuffer, dstWidth, dstHeight, false, true); + // Make sure we don't flop back and forth. + dstBuffer->newWidth = std::max(dstWidth, (int)dstBuffer->width); + dstBuffer->newHeight = std::max(dstHeight, (int)dstBuffer->height); + dstBuffer->lastFrameNewSize = gpuStats.numFlips; } DrawPixels(dstBuffer, static_cast(dstX * dstXFactor), dstY, srcBase, dstBuffer->format, static_cast(srcStride * dstXFactor), static_cast(dstWidth * dstXFactor), dstHeight); SetColorUpdated(dstBuffer, skipDrawReason); From 5a7ad5b17619db8dd1803380b1e596c9c224b5c3 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 12 Apr 2017 00:20:50 -0700 Subject: [PATCH 2/2] Fix largest framebuf size in throughmode. This was probably always meant to be <=, since it logically makes sense for them to be equal. Might fix cases of resizing down a framebuf in throughmode, where viewport isn't as good a heuristic. --- GPU/Common/FramebufferCommon.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/Common/FramebufferCommon.cpp b/GPU/Common/FramebufferCommon.cpp index c410e709e4..39653311dd 100644 --- a/GPU/Common/FramebufferCommon.cpp +++ b/GPU/Common/FramebufferCommon.cpp @@ -334,7 +334,7 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame // Keep track, but this isn't really used. vfb->z_stride = params.z_stride; // Heuristic: In throughmode, a higher height could be used. Let's avoid shrinking the buffer. - if (params.isModeThrough && (int)vfb->width < params.fb_stride) { + if (params.isModeThrough && (int)vfb->width <= params.fb_stride) { vfb->width = std::max((int)vfb->width, drawing_width); vfb->height = std::max((int)vfb->height, drawing_height); } else {