[Tizen] Using shader list for precompile
authorJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 15 Nov 2023 06:05:58 +0000 (15:05 +0900)
committerJaehyun Cho <jae_hyun.cho@samsung.com>
Wed, 15 Nov 2023 06:05:58 +0000 (15:05 +0900)
This reverts commit 949e005b78ae1eac276b65dffe3f50c36ba5a4f9.

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
   {