std::once_flag ShaderPrecompiler::mOnceFlag;
ShaderPrecompiler::ShaderPrecompiler()
-: mRawShaderData(),
+: mRawShaderList(),
mPrecompiled(false),
mEnabled(false)
{
return *(mInstance.get());
}
-void ShaderPrecompiler::GetPrecompileShaderList(RawShaderData& shaders)
+void ShaderPrecompiler::GetPrecompileShaderList(std::vector<RawShaderData>& shaderList)
{
ConditionalWait::ScopedLock lock(mConditionalWait);
if(!IsReady())
}
// 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);
}
* @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.
* @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
private:
static std::unique_ptr<ShaderPrecompiler> mInstance;
static std::once_flag mOnceFlag;
- RawShaderData mRawShaderData;
+ std::vector<RawShaderData> mRawShaderList;
ConditionalWait mConditionalWait;
bool mPrecompiled;
bool mEnabled;