Permalink
Browse files

Dirty viewport state on framebuf resize.

  • Loading branch information...
unknownbrackets authored and hrydgard committed Mar 19, 2017
1 parent 1098bf7 commit aa2269020ab52b4e3245e98a3261b5075c41baba
Showing with 6 additions and 2 deletions.
  1. +4 −0 GPU/Common/FramebufferCommon.cpp
  2. +2 −2 GPU/GPUCommon.cpp
@@ -633,6 +633,8 @@ void FramebufferManagerCommon::NotifyVideoUpload(u32 addr, int size, int width,
DEBUG_LOG(ME, "Changing stride for %08x from %d to %d", addr, vfb->fb_stride, width);
const int bpp = fmt == GE_FORMAT_8888 ? 4 : 2;
ResizeFramebufFBO(vfb, width, size / (bpp * width));
// Resizing may change the viewport/etc.
gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE);
vfb->fb_stride = width;
// This might be a bit wider than necessary, but we'll redetect on next render.
vfb->width = width;
@@ -1647,6 +1649,8 @@ void FramebufferManagerCommon::NotifyBlockTransferAfter(u32 dstBasePtr, int dstS
dstBuffer->newWidth = std::max(dstWidth, (int)dstBuffer->width);
dstBuffer->newHeight = std::max(dstHeight, (int)dstBuffer->height);
dstBuffer->lastFrameNewSize = gpuStats.numFlips;
// Resizing may change the viewport/etc.
gstate_c.Dirty(DIRTY_VIEWPORTSCISSOR_STATE);
}
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);
View
@@ -179,8 +179,8 @@ const CommonCommandTableEntry commonCommandTable[] = {
{ GE_CMD_CLIPENABLE, FLAG_FLUSHBEFOREONCHANGE },
// Z clip
{ GE_CMD_MINZ, FLAG_FLUSHBEFOREONCHANGE, DIRTY_DEPTHRANGE | DIRTY_VIEWPORTSCISSOR_STATE},
{ GE_CMD_MAXZ, FLAG_FLUSHBEFOREONCHANGE, DIRTY_DEPTHRANGE | DIRTY_VIEWPORTSCISSOR_STATE},
{ GE_CMD_MINZ, FLAG_FLUSHBEFOREONCHANGE, DIRTY_DEPTHRANGE | DIRTY_VIEWPORTSCISSOR_STATE },
{ GE_CMD_MAXZ, FLAG_FLUSHBEFOREONCHANGE, DIRTY_DEPTHRANGE | DIRTY_VIEWPORTSCISSOR_STATE },
// Region
{ GE_CMD_REGION1, FLAG_FLUSHBEFOREONCHANGE, DIRTY_FRAMEBUF | DIRTY_TEXTURE_PARAMS },

0 comments on commit aa22690

Please sign in to comment.