Skip to content

Commit

Permalink
Take care of most cases of render-to-virtual-readback-buffer, I think.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Nov 12, 2018
1 parent 6269d9b commit 32cd6df
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions GPU/Common/FramebufferCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,13 @@ VirtualFramebuffer *FramebufferManagerCommon::DoSetRenderFrameBuffer(const Frame
vfb->fb_stride = params.fb_stride;
vfb->format = params.fmt;
}

if (vfb->z_address == 0 && vfb->z_stride == 0) {
// Got one that was created by CreateRAMFramebuffer. Since it has no depth buffer,
// we just recreate it immediately.
ResizeFramebufFBO(vfb, vfb->width, vfb->height, true);
}

// 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.
Expand Down

0 comments on commit 32cd6df

Please sign in to comment.