mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
caacb1dc9f
commit
c054b097e9
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue