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

Fix crash in _copyDepthBuffer()

This commit is contained in:
Sergey Lipskiy 2015-03-30 15:32:38 +06:00
parent 06da08e349
commit 7365301a8d

View File

@ -2113,8 +2113,12 @@ void _copyDepthBuffer()
depthBufferList().saveBuffer(gDP.colorImage.address);
// Take any frame buffer and attach source depth buffer to it, to blit it into copy depth buffer
FrameBuffer * pTmpBuffer = frameBufferList().findTmpBuffer(frameBufferList().getCurrent()->m_startAddress);
if (pTmpBuffer == NULL)
return;
DepthBuffer * pTmpBufferDepth = pTmpBuffer->m_pDepthBuffer;
pTmpBuffer->m_pDepthBuffer = depthBufferList().findBuffer(gSP.bgImage.address);
if (pTmpBufferDepth == NULL || pTmpBuffer->m_pDepthBuffer == NULL)
return;
glBindFramebuffer(GL_READ_FRAMEBUFFER, pTmpBuffer->m_FBO);
pTmpBuffer->m_pDepthBuffer->setDepthAttachment();
GLuint attachment = GL_COLOR_ATTACHMENT0;