Skip to content

Commit

Permalink
On desktop, blit depth when not cleared.
Browse files Browse the repository at this point in the history
Workaround for #1283, makes Jeanne d'Arc playable.
  • Loading branch information
unknownbrackets committed Jan 4, 2014
1 parent 4d477f0 commit 202842d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions GPU/GLES/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,17 @@ void FramebufferManager::SetRenderFrameBuffer() {
ClearBuffer();
}
#endif

#ifndef USING_GLES2
if (gl_extensions.FBO_ARB && currentRenderVfb_ != NULL && MaskedEqual(currentRenderVfb_->z_address, vfb->z_address)) {
// Let's only do this if not clearing.
if (!gstate.isModeClear() || !gstate.isClearModeDepthMask()) {
fbo_bind_for_read(currentRenderVfb_->fbo);
glBlitFramebuffer(0, 0, currentRenderVfb_->renderWidth, currentRenderVfb_->renderHeight, 0, 0, vfb->renderWidth, vfb->renderHeight, GL_DEPTH_BUFFER_BIT, GL_NEAREST);
}
}
#endif

currentRenderVfb_ = vfb;
} else {
vfb->last_frame_render = gpuStats.numFlips;
Expand Down

0 comments on commit 202842d

Please sign in to comment.