gsdx ogl: fix wrong depth clear

If a color buffer is still attached and is smaller than depth buffer,
the latter won't be fully cleared.

As a faster alternative, use GL4.4 clear texture function. Avoid to fiddle with
framebuffer and pixel tests.

Fix #1362x Ar Tolenico 2 map clip
This commit is contained in:
Gregory Hainaut 2016-05-15 14:57:37 +02:00
parent caacb1dc9f
commit c054b097e9
1 changed files with 20 additions and 11 deletions

View File

@ -603,7 +603,15 @@ void GSDeviceOGL::ClearDepth(GSTexture* t, float c)
GL_PUSH("Clear Depth %d", T->GetID());
if (GLLoader::found_GL_ARB_clear_texture) {
// Don't bother with Depth_Stencil insanity
ASSERT(c == 0.0f);
T->Clear(NULL);
} else {
OMSetFBO(m_fbo);
// RT must be detached, if RT is too small, depth won't be fully cleared
// AT tolenico 2 map clip bug
OMAttachRt(NULL);
OMAttachDs(T);
// TODO: check size of scissor before toggling it
@ -617,6 +625,7 @@ void GSDeviceOGL::ClearDepth(GSTexture* t, float c)
}
glEnable(GL_SCISSOR_TEST);
}
}
void GSDeviceOGL::ClearStencil(GSTexture* t, uint8 c)
{