Skip to content

Commit

Permalink
Merge pull request #9603 from unknownbrackets/fb-resize
Browse files Browse the repository at this point in the history
Fix framebuffer size flopping back and forth
  • Loading branch information
hrydgard authored Apr 12, 2017
2 parents 81c3c7c + 5a7ad5b commit 0cb4344
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion GPU/Common/FramebufferCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,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 {
Expand Down Expand Up @@ -1643,6 +1643,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<int>(dstX * dstXFactor), dstY, srcBase, dstBuffer->format, static_cast<int>(srcStride * dstXFactor), static_cast<int>(dstWidth * dstXFactor), dstHeight);
SetColorUpdated(dstBuffer, skipDrawReason);
Expand Down

0 comments on commit 0cb4344

Please sign in to comment.