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

Revert "Don't copy depth buffer to RDRAM if it was not cleared completly."

This commit causes 2 regressions: #436, #437
Better solution needed.

This reverts commit 8b551549e0ca5ece29c5322cb062e8a9bc11e48e.
This commit is contained in:
Sergey Lipskiy 2015-04-29 19:31:04 +06:00
parent 3fa7756fd9
commit b205529aec
5 changed files with 9 additions and 9 deletions

View File

@ -84,7 +84,7 @@ void DepthBuffer::initDepthImageTexture(FrameBuffer * _pBuffer)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, _pBuffer->m_FBO);
depthBufferList().clearBuffer(true);
depthBufferList().clearBuffer();
#endif // GL_IMAGE_TEXTURES_SUPPORT
}
@ -306,11 +306,11 @@ void DepthBufferList::saveBuffer(u32 _address)
}
void DepthBufferList::clearBuffer(bool _fullsize)
void DepthBufferList::clearBuffer()
{
if (m_pCurrent == NULL)
return;
m_pCurrent->m_cleared = _fullsize;
m_pCurrent->m_cleared = true;
#ifdef GL_IMAGE_TEXTURES_SUPPORT
if (m_pCurrent->m_FBO == 0 || !video().getRender().isImageTexturesSupported() || config.frameBufferEmulation.N64DepthCompare == 0)
return;

View File

@ -38,7 +38,7 @@ public:
void destroy();
void saveBuffer(u32 _address);
void removeBuffer(u32 _address);
void clearBuffer(bool _fullsize);
void clearBuffer();
void setNotCleared();
DepthBuffer *findBuffer(u32 _address);
DepthBuffer * getCurrent() const {return m_pCurrent;}

View File

@ -1144,12 +1144,12 @@ void OGLRender::drawText(const char *_pText, float x, float y)
TextDrawer::get().renderText(_pText, x, y);
}
void OGLRender::clearDepthBuffer(bool _fullsize)
void OGLRender::clearDepthBuffer()
{
if (config.frameBufferEmulation.enable && frameBufferList().getCurrent() == NULL)
return;
depthBufferList().clearBuffer(_fullsize);
depthBufferList().clearBuffer();
glDisable( GL_SCISSOR_TEST );
glDepthMask( TRUE );

View File

@ -59,7 +59,7 @@ public:
};
void drawTexturedRect(const TexturedRectParams & _params);
void drawText(const char *_pText, float x, float y);
void clearDepthBuffer(bool _fullsize);
void clearDepthBuffer();
void clearColorBuffer( float * _pColor );
int getTrianglesCount() const {return triangles.num;}

View File

@ -757,13 +757,13 @@ void gDPFillRectangle( s32 ulx, s32 uly, s32 lrx, s32 lry )
// If color is not depth clear color, that is most likely the case
if (gDP.fillColor.color == DepthClearColor) {
gDPFillRDRAM(gDP.colorImage.address, ulx, uly, lrx, lry, gDP.colorImage.width, gDP.colorImage.size, gDP.fillColor.color);
render.clearDepthBuffer(lrx - ulx >= gDP.scissor.lrx - gDP.scissor.ulx && lry - uly >= gDP.scissor.lry - gDP.scissor.uly);
render.clearDepthBuffer();
return;
}
} else if (gDP.fillColor.color == DepthClearColor && gDP.otherMode.cycleType == G_CYC_FILL) {
depthBufferList().saveBuffer(gDP.colorImage.address);
gDPFillRDRAM(gDP.colorImage.address, ulx, uly, lrx, lry, gDP.colorImage.width, gDP.colorImage.size, gDP.fillColor.color);
render.clearDepthBuffer(lrx - ulx == gDP.scissor.lrx - gDP.scissor.ulx && lry - uly == gDP.scissor.lry - gDP.scissor.uly);
render.clearDepthBuffer();
return;
}