From: Taehyub Kim Date: Mon, 30 Oct 2023 08:44:57 +0000 (+0900) Subject: Revert "[Tizen] Add lock for shader-precompiler" X-Git-Tag: accepted/tizen/unified/20231031.163528~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=57146d283aa89352931fc5497de1e717f252f86e;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git Revert "[Tizen] Add lock for shader-precompiler" This reverts commit ca4f81211f6549cbae2e224ee6baf7453c9f490b. --- diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 55a557a..e2961d1 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -116,7 +116,6 @@ CombinedUpdateRenderController::CombinedUpdateRenderController(AdaptorInternalSe mUpdateRenderThreadCanSleep(FALSE), mPendingRequestUpdate(FALSE), mUseElapsedTimeAfterWait(FALSE), - mIsQuitedPreCompile(FALSE), mNewSurface(NULL), mDeletedSurface(nullptr), mPostRendering(FALSE), @@ -314,11 +313,6 @@ void CombinedUpdateRenderController::ReplaceSurface(Dali::RenderSurfaceInterface ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will replace the surface now mNewSurface = newSurface; - if(mIsQuitedPreCompile == FALSE) - { - mIsQuitedPreCompile = TRUE; - Integration::ShaderPrecompiler::Get().StopPrecompile(); - } mUpdateRenderThreadWaitCondition.Notify(lock); } @@ -342,11 +336,6 @@ void CombinedUpdateRenderController::DeleteSurface(Dali::RenderSurfaceInterface* ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); mPostRendering = FALSE; // Clear the post-rendering flag as Update/Render thread will delete the surface now mDeletedSurface = surface; - if(mIsQuitedPreCompile == FALSE) - { - mIsQuitedPreCompile = TRUE; - Integration::ShaderPrecompiler::Get().StopPrecompile(); - } mUpdateRenderThreadWaitCondition.Notify(lock); } @@ -383,11 +372,6 @@ void CombinedUpdateRenderController::ResizeSurface() ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); // Surface is resized and the surface resized count is increased. mSurfaceResized++; - if(mIsQuitedPreCompile == FALSE) - { - mIsQuitedPreCompile = TRUE; - Integration::ShaderPrecompiler::Get().StopPrecompile(); - } mUpdateRenderThreadWaitCondition.Notify(lock); } } @@ -466,11 +450,6 @@ void CombinedUpdateRenderController::RunUpdateRenderThread(int numberOfCycles, A mUpdateRenderThreadCanSleep = FALSE; mUploadWithoutRendering = (updateMode == UpdateMode::SKIP_RENDER); LOG_COUNTER_EVENT("mUpdateRenderRunCount: %d, mUseElapsedTimeAfterWait: %d", mUpdateRenderRunCount, mUseElapsedTimeAfterWait); - if(mIsQuitedPreCompile == FALSE) - { - mIsQuitedPreCompile = TRUE; - Integration::ShaderPrecompiler::Get().StopPrecompile(); - } mUpdateRenderThreadWaitCondition.Notify(lock); } @@ -484,11 +463,6 @@ void CombinedUpdateRenderController::StopUpdateRenderThread() { ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); mDestroyUpdateRenderThread = TRUE; - if(mIsQuitedPreCompile == FALSE) - { - mIsQuitedPreCompile = TRUE; - Integration::ShaderPrecompiler::Get().StopPrecompile(); - } mUpdateRenderThreadWaitCondition.Notify(lock); } @@ -596,38 +570,27 @@ void CombinedUpdateRenderController::UpdateRenderThread() const bool renderToFboEnabled = 0u != renderToFboInterval; unsigned int frameCount = 0u; - if(!mDestroyUpdateRenderThread) + if(Integration::ShaderPrecompiler::Get().IsEnable()) { - Integration::ShaderPrecompiler::Get().WaitPrecompileList(); - if(Integration::ShaderPrecompiler::Get().IsEnable()) + std::vector 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) { - std::vector 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 numberOfPrecomipledShader = precompiledShader->shaderCount; + for(int i= 0; ishaderCount; - 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); + 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()); } - } - else - { - DALI_LOG_RELEASE_INFO("ShaderPrecompiler[DISABLE] \n"); + DALI_LOG_RELEASE_INFO("ShaderPrecompiler[ENABLE], shader count :%d \n",numberOfPrecomipledShader); } } + else + { + DALI_LOG_RELEASE_INFO("ShaderPrecompiler[DISABLE] \n"); + } while(UpdateRenderReady(useElapsedTime, updateRequired, timeToSleepUntil)) { @@ -1073,11 +1036,6 @@ void CombinedUpdateRenderController::PostRenderComplete() { ConditionalWait::ScopedLock lock(mUpdateRenderThreadWaitCondition); mPostRendering = FALSE; - if(mIsQuitedPreCompile == FALSE) - { - mIsQuitedPreCompile = TRUE; - Integration::ShaderPrecompiler::Get().StopPrecompile(); - } mUpdateRenderThreadWaitCondition.Notify(lock); } diff --git a/dali/internal/adaptor/common/combined-update-render-controller.h b/dali/internal/adaptor/common/combined-update-render-controller.h index abb40d9..bec2f70 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.h +++ b/dali/internal/adaptor/common/combined-update-render-controller.h @@ -377,7 +377,6 @@ private: ///< Ensures we do not go to sleep if we have not processed the most recent update-request. volatile unsigned int mUseElapsedTimeAfterWait; ///< Whether we should use the elapsed time after waiting (set by the event-thread, read by the update-render-thread). - volatile unsigned int mIsQuitedPreCompile; ///< Whether we need to do precompile shader. Dali::RenderSurfaceInterface* volatile mNewSurface; ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread). Dali::RenderSurfaceInterface* volatile mDeletedSurface; ///< Will be set to the deleted surface if requested (set by the event-thread, read & cleared by the update-render thread).