Set DepthMask to true before clearing depth buffer 38/178338/5
authorminho.sun <minho.sun@samsung.com>
Wed, 9 May 2018 10:36:28 +0000 (19:36 +0900)
committerMinho Sun <minho.sun@samsung.com>
Fri, 10 Aug 2018 02:20:15 +0000 (02:20 +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: Ia94826a9681355719604f774e3fb37994068e3c2
Signed-off-by: minho.sun <minho.sun@samsung.com>
dali/internal/render/common/render-algorithms.cpp

index 664eb6b..ec47b65 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
   {