1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-02 09:03:37 +00:00

Correct condition for valid depth buffer attachement.

Rat attack uses color buffer with width 640, but depth buffer width is only 639.
goodDepthBufferTexture check failed because of it, and game run without depth compare.

Fixed Rat attack missing geometry #600
This commit is contained in:
Sergey Lipskiy 2019-01-09 18:19:01 +07:00
parent da5acef3eb
commit 6de128b8fd

View File

@ -910,9 +910,11 @@ void FrameBufferList::attachDepthBuffer()
bool goodDepthBufferTexture = false;
if (Context::DepthFramebufferTextures) {
goodDepthBufferTexture = Context::WeakBlitFramebuffer ?
pDepthBuffer->m_pDepthBufferTexture->realWidth == pCurrent->m_pTexture->realWidth :
pDepthBuffer->m_pDepthBufferTexture->realWidth >= pCurrent->m_pTexture->realWidth;
if (Context::WeakBlitFramebuffer)
goodDepthBufferTexture = pDepthBuffer->m_pDepthBufferTexture->realWidth == pCurrent->m_pTexture->realWidth;
else
goodDepthBufferTexture = pDepthBuffer->m_pDepthBufferTexture->realWidth >= pCurrent->m_pTexture->realWidth ||
std::abs((s32)(pCurrent->m_width - pDepthBuffer->m_width)) < 2;
} else {
goodDepthBufferTexture = pDepthBuffer->m_depthRenderbufferWidth == pCurrent->m_pTexture->realWidth;
}