[Tizen] Add ShaderList for precompile
authorEunki, Hong <eunkiki.hong@samsung.com>
Wed, 25 Oct 2023 07:38:55 +0000 (16:38 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Wed, 25 Oct 2023 07:38:57 +0000 (16:38 +0900)
This reverts commit c2a244c3961fd0cb2ba7adc4ac6ad3db7a51a4e5.

Change-Id: I681bd6263ee44f5ceec92d71dd6f20e935c07d65

dali/integration-api/shader-precompiler.cpp
dali/integration-api/shader-precompiler.h

index ad8efcf..f897a70 100644 (file)
@@ -30,7 +30,7 @@ std::unique_ptr<ShaderPrecompiler> ShaderPrecompiler::mInstance = nullptr;
 std::once_flag ShaderPrecompiler::mOnceFlag;
 
 ShaderPrecompiler::ShaderPrecompiler()
-: mRawShaderData(),
+: mRawShaderList(),
   mPrecompiled(false),
   mEnabled(false)
 {
@@ -44,7 +44,7 @@ ShaderPrecompiler& ShaderPrecompiler::Get()
   return *(mInstance.get());
 }
 
-void ShaderPrecompiler::GetPrecompileShaderList(RawShaderData& shaders)
+void ShaderPrecompiler::GetPrecompileShaderList(std::vector<RawShaderData>& shaderList)
 {
   ConditionalWait::ScopedLock lock(mConditionalWait);
   if(!IsReady())
@@ -54,18 +54,14 @@ void ShaderPrecompiler::GetPrecompileShaderList(RawShaderData& shaders)
   }
 
   // move shader list
-  shaders = mRawShaderData;
+  shaderList = mRawShaderList;
 }
 
-void ShaderPrecompiler::SavePrecomipleShaderList(RawShaderData& shaders)
+void ShaderPrecompiler::SavePrecomipleShaderList(std::vector<RawShaderData>& shaderList)
 {
   ConditionalWait::ScopedLock lock(mConditionalWait);
-  mRawShaderData.vertexPrefix = shaders.vertexPrefix;
-  mRawShaderData.fragmentPrefix = shaders.fragmentPrefix;
-  mRawShaderData.vertexShader = shaders.vertexShader;
-  mRawShaderData.fragmentShader = shaders.fragmentShader;
-  mRawShaderData.shaderCount = shaders.shaderCount;
 
+  mRawShaderList = shaderList;
   mPrecompiled = true;
   mConditionalWait.Notify(lock);
 }
index 1c2094b..1ad5ba7 100644 (file)
@@ -69,7 +69,7 @@ public:
    *  @SINCE_2_2.45
    *  @param[in] shaders shader data for precompile
   */
-  void GetPrecompileShaderList(RawShaderData& shaders);
+  void GetPrecompileShaderList(std::vector<RawShaderData>& shaders);
 
   /**
    * @brief Save the precompile shader list.
@@ -77,7 +77,7 @@ public:
    * @SINCE_2_2.45
    * @param[in] shaders shader data for precompile
   */
-  void SavePrecomipleShaderList(RawShaderData& shaders);
+  void SavePrecomipleShaderList(std::vector<RawShaderData>& shaders);
 
   /**
    * @brief Check precompile list is ready or not
@@ -116,7 +116,7 @@ public:
 private:
   static std::unique_ptr<ShaderPrecompiler> mInstance;
   static std::once_flag mOnceFlag;
-  RawShaderData mRawShaderData;
+  std::vector<RawShaderData> mRawShaderList;
   ConditionalWait mConditionalWait;
   bool mPrecompiled;
   bool mEnabled;