mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Enable depth buffer copies on GLES3 devices without breaking any desktop
This commit is contained in:
parent
32a1f1e944
commit
43a93f086d
1 changed files with 11 additions and 6 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Reference in a new issue