From: minho.sun Date: Wed, 9 May 2018 10:36:28 +0000 (+0900) Subject: [4.0] Set DepthMask to true before clearing depth buffer X-Git-Tag: accepted/tizen/4.0/unified/20180511.174357^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-core.git;a=commitdiff_plain;h=c56d2ad3057b218a9eea8703a9f838714fd986f1 [4.0] Set DepthMask to true before clearing depth buffer When enableDepthWrite is false, Depth buffer is not cleared because DepthMask is false. Make sure that DALi set DepthMask to true before clearing depth buffer. Change-Id: Icbba95348e835f5a3146f611ff2d06baa1c1f608 Signed-off-by: minho.sun --- diff --git a/dali/internal/render/common/render-algorithms.cpp b/dali/internal/render/common/render-algorithms.cpp index 9e2c900..cd542ce 100644 --- a/dali/internal/render/common/render-algorithms.cpp +++ b/dali/internal/render/common/render-algorithms.cpp @@ -194,9 +194,6 @@ inline void SetupDepthBuffer( const RenderItem& item, Context& context, bool dep // The depth buffer must be enabled if either reading or writing. context.EnableDepthBuffer( true ); - // Set up the depth mask based on our depth write setting. - context.DepthMask( enableDepthWrite ); - // Look-up the GL depth function from the Dali::DepthFunction enum, and set it. context.DepthFunc( DaliDepthToGLDepthTable[ item.mRenderer->GetDepthFunction() ] ); @@ -210,8 +207,12 @@ inline void SetupDepthBuffer( const RenderItem& item, Context& context, bool dep firstDepthBufferUse = false; // Note: The buffer will only be cleared if written to since a previous clear. + context.DepthMask( true ); context.Clear( GL_DEPTH_BUFFER_BIT, Context::CHECK_CACHED_VALUES ); } + + // Set up the depth mask based on our depth write setting. + context.DepthMask( enableDepthWrite ); } else {