1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +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,12 +479,15 @@ void FrameBufferList::attachDepthBuffer()
if (m_pCurrent->m_FBO > 0 && pDepthBuffer != NULL) {
pDepthBuffer->initDepthImageTexture(m_pCurrent);
pDepthBuffer->initDepthBufferTexture(m_pCurrent);
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;
#ifndef GLES2
GLuint attachments[1] = { GL_COLOR_ATTACHMENT0 };