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

Minor corrections in DepthBufferToRDRAM::CopyToRDRAM

This commit is contained in:
Sergey Lipskiy 2015-04-01 19:06:14 +06:00
parent f96d54bd1f
commit e4599870f3
2 changed files with 4 additions and 4 deletions

View File

@ -939,7 +939,7 @@ bool DepthBufferToRDRAM::CopyToRDRAM( u32 _address) {
if (VI.width == 0) // H width is zero. Don't copy if (VI.width == 0) // H width is zero. Don't copy
return false; return false;
if (m_lastDList == RSP.DList) // Already read; if (m_lastDList == RSP.DList) // Already read;
return false; return true;
FrameBuffer *pBuffer = frameBufferList().findBuffer(_address); FrameBuffer *pBuffer = frameBufferList().findBuffer(_address);
if (pBuffer == NULL || pBuffer->m_width < VI.width || pBuffer->m_pDepthBuffer == NULL || !pBuffer->m_pDepthBuffer->m_cleared) if (pBuffer == NULL || pBuffer->m_width < VI.width || pBuffer->m_pDepthBuffer == NULL || !pBuffer->m_pDepthBuffer->m_cleared)
return false; return false;
@ -996,7 +996,7 @@ bool DepthBufferToRDRAM::CopyToRDRAM( u32 _address) {
glUnmapBuffer(GL_PIXEL_PACK_BUFFER); glUnmapBuffer(GL_PIXEL_PACK_BUFFER);
glBindFramebuffer(GL_READ_FRAMEBUFFER, 0); glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
glEnable(GL_SCISSOR_TEST); gDP.changed |= CHANGED_SCISSOR;
return true; return true;
} }
#endif // GLES2 #endif // GLES2

View File

@ -946,10 +946,10 @@ bool texturedRectDepthBufferCopy(const OGLRender::TexturedRectParams & _params)
// Load of arbitrary data to that area causes weird camera rotation in CBFD. // Load of arbitrary data to that area causes weird camera rotation in CBFD.
const gDPTile * pTile = gSP.textureTile[0]; const gDPTile * pTile = gSP.textureTile[0];
if (pTile->loadType == LOADTYPE_BLOCK && gDP.textureImage.size == 2 && gDP.textureImage.address >= gDP.depthImageAddress && gDP.textureImage.address < (gDP.depthImageAddress + gDP.colorImage.width*gDP.colorImage.width * 6 / 4)) { if (pTile->loadType == LOADTYPE_BLOCK && gDP.textureImage.size == 2 && gDP.textureImage.address >= gDP.depthImageAddress && gDP.textureImage.address < (gDP.depthImageAddress + gDP.colorImage.width*gDP.colorImage.width * 6 / 4)) {
if (!config.frameBufferEmulation.enable) if (config.frameBufferEmulation.enable == 0)
return true; return true;
frameBufferList().getCurrent()->m_cleared = true; frameBufferList().getCurrent()->m_cleared = true;
if (!config.frameBufferEmulation.copyDepthToRDRAM) if (config.frameBufferEmulation.copyDepthToRDRAM == 0)
return true; return true;
if (FrameBuffer_CopyDepthBuffer(gDP.colorImage.address)) if (FrameBuffer_CopyDepthBuffer(gDP.colorImage.address))
RDP_RepeatLastLoadBlock(); RDP_RepeatLastLoadBlock();