From c56d2ad3057b218a9eea8703a9f838714fd986f1 Mon Sep 17 00:00:00 2001 From: "minho.sun" Date: Wed, 9 May 2018 19:36:28 +0900 Subject: [PATCH] [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 --- 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 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 { -- 2.7.4