From 9004b94c9163f65f911660c02acbfe97c37ec37e Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Wed, 9 May 2018 19:36:28 +0900 Subject: [PATCH] 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: Ia94826a9681355719604f774e3fb37994068e3c2 Signed-off-by: minho.sun --- dali/internal/render/common/render-algorithms.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dali/internal/render/common/render-algorithms.cpp b/dali/internal/render/common/render-algorithms.cpp index 664eb6b..ec47b65 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 { -- 2.7.4