Submit command buffer when rendering is skipped 30/281430/1
authorHeeyong Song <heeyong.song@samsung.com>
Mon, 19 Sep 2022 02:56:45 +0000 (11:56 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 19 Sep 2022 02:56:45 +0000 (11:56 +0900)
Change-Id: I4b9be39763b82d96982454e9bad356a38aceb600

dali/internal/render/common/render-manager.cpp

index dff1e74..75a80a2 100644 (file)
@@ -189,6 +189,8 @@ struct RenderManager::Impl
   std::unique_ptr<Dali::ThreadPool> threadPool;            ///< The thread pool
   Vector<Graphics::Texture*>        boundTextures;         ///< The textures bound for rendering
   Vector<Graphics::Texture*>        textureDependencyList; ///< The dependency list of bound textures
+
+  bool commandBufferSubmitted{false};
 };
 
 RenderManager* RenderManager::New(Graphics::Controller&               graphicsController,
@@ -465,6 +467,8 @@ void RenderManager::PreRender(Integration::RenderStatus& status, bool forceClear
       geom->Upload(mImpl->graphicsController);
     }
   }
+
+  mImpl->commandBufferSubmitted = false;
 }
 
 void RenderManager::PreRender(Integration::Scene& scene, std::vector<Rect<int>>& damagedRects)
@@ -947,6 +951,7 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::
   mImpl->uniformBufferManager->UnlockUniformBuffer(mImpl->renderBufferIndex);
 
   mImpl->renderAlgorithms.SubmitCommandBuffer();
+  mImpl->commandBufferSubmitted = true;
 
   std::sort(targetstoPresent.begin(), targetstoPresent.end());
 
@@ -963,6 +968,14 @@ void RenderManager::RenderScene(Integration::RenderStatus& status, Integration::
 
 void RenderManager::PostRender()
 {
+  if(!mImpl->commandBufferSubmitted)
+  {
+    // Rendering is skipped but there may be pending commands
+    // Submit command buffers
+    mImpl->renderAlgorithms.SubmitCommandBuffer();
+    mImpl->commandBufferSubmitted = true;
+  }
+
   // Notify RenderGeometries that rendering has finished
   for(auto&& iter : mImpl->geometryContainer)
   {