diff --git a/src/DepthBuffer.cpp b/src/DepthBuffer.cpp index 05e919cd..db3f2fd6 100644 --- a/src/DepthBuffer.cpp +++ b/src/DepthBuffer.cpp @@ -398,10 +398,7 @@ void DepthBufferList::saveBuffer(u32 _address) m_pCurrent = &buffer; } -#ifdef ANDROID - //Fixes issues with PowerVR devices and potentially other Android devices - glClear( GL_DEPTH_BUFFER_BIT ); -#endif + frameBufferList().attachDepthBuffer(); #ifdef DEBUG diff --git a/src/OpenGL.cpp b/src/OpenGL.cpp index 8f709c06..38afb8e5 100644 --- a/src/OpenGL.cpp +++ b/src/OpenGL.cpp @@ -1836,6 +1836,12 @@ void OGLRender::clearDepthBuffer(u32 _uly, u32 _lry) depthBufferList().clearBuffer(_uly, _lry); glDisable( GL_SCISSOR_TEST ); + +#ifdef ANDROID + glDepthMask( FALSE ); + glClear( GL_DEPTH_BUFFER_BIT ); +#endif + glDepthMask( TRUE ); glClear( GL_DEPTH_BUFFER_BIT );