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

Add check that depth buffer width is enough for selected frame buffer.

Fixed driver crash error in Pokemon Stadium when entering a battle.
This commit is contained in:
Sergey Lipskiy 2015-04-11 23:17:38 +06:00
parent 43b7488ec8
commit 4fd2000459

View File

@ -479,10 +479,13 @@ void FrameBufferList::attachDepthBuffer()
if (m_pCurrent->m_FBO > 0 && pDepthBuffer != NULL) {
pDepthBuffer->initDepthImageTexture(m_pCurrent);
pDepthBuffer->initDepthBufferTexture(m_pCurrent);
m_pCurrent->m_pDepthBuffer = pDepthBuffer;
pDepthBuffer->setDepthAttachment(GL_DRAW_FRAMEBUFFER);
if (video().getRender().isImageTexturesSupported() && config.frameBufferEmulation.N64DepthCompare != 0)
pDepthBuffer->bindDepthImageTexture();
if (pDepthBuffer->m_pDepthBufferTexture->realWidth >= m_pCurrent->m_pTexture->realWidth) {
m_pCurrent->m_pDepthBuffer = pDepthBuffer;
pDepthBuffer->setDepthAttachment(GL_DRAW_FRAMEBUFFER);
if (video().getRender().isImageTexturesSupported() && config.frameBufferEmulation.N64DepthCompare != 0)
pDepthBuffer->bindDepthImageTexture();
} else
m_pCurrent->m_pDepthBuffer = NULL;
} else
m_pCurrent->m_pDepthBuffer = NULL;