mirror of
https://github.com/blawar/GLideN64.git
synced 2024-07-07 03:13:49 +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:
parent
43b7488ec8
commit
4fd2000459
|
@ -479,12 +479,15 @@ void FrameBufferList::attachDepthBuffer()
|
||||||
if (m_pCurrent->m_FBO > 0 && pDepthBuffer != NULL) {
|
if (m_pCurrent->m_FBO > 0 && pDepthBuffer != NULL) {
|
||||||
pDepthBuffer->initDepthImageTexture(m_pCurrent);
|
pDepthBuffer->initDepthImageTexture(m_pCurrent);
|
||||||
pDepthBuffer->initDepthBufferTexture(m_pCurrent);
|
pDepthBuffer->initDepthBufferTexture(m_pCurrent);
|
||||||
|
if (pDepthBuffer->m_pDepthBufferTexture->realWidth >= m_pCurrent->m_pTexture->realWidth) {
|
||||||
m_pCurrent->m_pDepthBuffer = pDepthBuffer;
|
m_pCurrent->m_pDepthBuffer = pDepthBuffer;
|
||||||
pDepthBuffer->setDepthAttachment(GL_DRAW_FRAMEBUFFER);
|
pDepthBuffer->setDepthAttachment(GL_DRAW_FRAMEBUFFER);
|
||||||
if (video().getRender().isImageTexturesSupported() && config.frameBufferEmulation.N64DepthCompare != 0)
|
if (video().getRender().isImageTexturesSupported() && config.frameBufferEmulation.N64DepthCompare != 0)
|
||||||
pDepthBuffer->bindDepthImageTexture();
|
pDepthBuffer->bindDepthImageTexture();
|
||||||
} else
|
} else
|
||||||
m_pCurrent->m_pDepthBuffer = NULL;
|
m_pCurrent->m_pDepthBuffer = NULL;
|
||||||
|
} else
|
||||||
|
m_pCurrent->m_pDepthBuffer = NULL;
|
||||||
|
|
||||||
#ifndef GLES2
|
#ifndef GLES2
|
||||||
GLuint attachments[1] = { GL_COLOR_ATTACHMENT0 };
|
GLuint attachments[1] = { GL_COLOR_ATTACHMENT0 };
|
||||||
|
|
Loading…
Reference in New Issue
Block a user