From f55a4aee8fa60e5708d5090ff0a03ddba9a6684d Mon Sep 17 00:00:00 2001 From: Francisco Zurita Date: Sat, 23 Jul 2016 01:18:27 -0400 Subject: [PATCH] Fixes some depth issues in Android --- src/DepthBuffer.cpp | 5 +---- src/OpenGL.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) 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 );