[Tizen] Using shader list for precompile
authordongsug.song <dongsug.song@samsung.com>
Mon, 6 Nov 2023 10:08:36 +0000 (19:08 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Mon, 6 Nov 2023 10:08:41 +0000 (19:08 +0900)
This reverts commit 900c18361eec163b6ed14ac8d946be84c449c708.

Change-Id: Iab74336704164356f514cbc1ba1fce3c0d6750cf

dali/internal/adaptor/common/combined-update-render-controller.cpp

index e164e85..e2961d1 100644 (file)
@@ -572,16 +572,20 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   if(Integration::ShaderPrecompiler::Get().IsEnable())
   {
-    RawShaderData precompiledShader;
-    Integration::ShaderPrecompiler::Get().GetPrecompileShaderList(precompiledShader);
-    auto numberOfPrecomipledShader = precompiledShader.shaderCount;
-    for(int i= 0; i<numberOfPrecomipledShader; ++i)
+    std::vector<RawShaderData> precompiledShaderList;
+    Integration::ShaderPrecompiler::Get().GetPrecompileShaderList(precompiledShaderList);
+    DALI_LOG_RELEASE_INFO("ShaderPrecompiler[ENABLE], list size:%d \n",precompiledShaderList.size());
+    for(auto precompiledShader = precompiledShaderList.begin(); precompiledShader != precompiledShaderList.end(); ++precompiledShader)
     {
-      auto vertexShader   = std::string(graphics.GetController().GetGlAbstraction().GetVertexShaderPrefix() + precompiledShader.vertexPrefix[i].data() + precompiledShader.vertexShader.data());
-      auto fragmentShader = std::string(graphics.GetController().GetGlAbstraction().GetFragmentShaderPrefix() + precompiledShader.fragmentPrefix[i].data() + precompiledShader.fragmentShader.data());
-      mCore.PreCompileShader(vertexShader.data(), fragmentShader.data());
+      auto numberOfPrecomipledShader = precompiledShader->shaderCount;
+      for(int i= 0; i<numberOfPrecomipledShader; ++i)
+      {
+        auto vertexShader   = std::string(graphics.GetController().GetGlAbstraction().GetVertexShaderPrefix() + precompiledShader->vertexPrefix[i].data() + precompiledShader->vertexShader.data());
+        auto fragmentShader = std::string(graphics.GetController().GetGlAbstraction().GetFragmentShaderPrefix() + precompiledShader->fragmentPrefix[i].data() + precompiledShader->fragmentShader.data());
+        mCore.PreCompileShader(vertexShader.data(), fragmentShader.data());
+      }
+      DALI_LOG_RELEASE_INFO("ShaderPrecompiler[ENABLE], shader count :%d \n",numberOfPrecomipledShader);
     }
-    DALI_LOG_RELEASE_INFO("ShaderPrecompiler[ENABLE], shader :%d \n",numberOfPrecomipledShader);
   }
   else
   {