[4.0] Set DepthMask to true before clearing depth buffer 37/178337/2 accepted/tizen/4.0/unified/20180511.174357 submit/tizen_4.0/20180510.005122
authorminho.sun <minho.sun@samsung.com>
Wed, 9 May 2018 10:36:28 +0000 (19:36 +0900)
committerMinho Sun <minho.sun@samsung.com>
Wed, 9 May 2018 10:42:58 +0000 (10:42 +0000)
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 <minho.sun@samsung.com>
dali/internal/render/common/render-algorithms.cpp

index 9e2c900..cd542ce 100644 (file)
@@ -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
   {