mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-11-28 08:43:38 +01:00
Enable depth buffer copies on GLES3 devices without breaking any desktop
This commit is contained in:
1 parent
32a1f1e944
commit
43a93f086d
1 file changed
+11
-6
@@ -864,19 +864,24 @@ void FramebufferManager::SetRenderFrameBuffer() {
|
||||
}
|
||||
#endif
|
||||
|
||||
bool doDepthCopy =
|
||||
currentRenderVfb_ != NULL &&
|
||||
currentRenderVfb_->fbo != NULL &&
|
||||
MaskedEqual(currentRenderVfb_->z_address, vfb->z_address) &&
|
||||
currentRenderVfb_->renderWidth == vfb->renderWidth &&
|
||||
currentRenderVfb_->renderHeight == vfb->renderHeight;
|
||||
|
||||
#ifndef USING_GLES2
|
||||
if (gl_extensions.FBO_ARB && currentRenderVfb_ != NULL &&
|
||||
currentRenderVfb_->fbo != NULL &&
|
||||
MaskedEqual(currentRenderVfb_->z_address, vfb->z_address) &&
|
||||
currentRenderVfb_->renderWidth == vfb->renderWidth &&
|
||||
currentRenderVfb_->renderHeight == vfb->renderHeight) {
|
||||
if (doDepthCopy && gl_extensions.FBO_ARB) {
|
||||
#else
|
||||
if (doDepthCopy && gl_extensions.GLES3) {
|
||||
#endif
|
||||
// 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 {
|
||||
|
||||
Reference in new issue
Block a user