From b4f7c24b3ef77a07be4d884f63a459e12c9fde0f Mon Sep 17 00:00:00 2001 From: HifiExperiments Date: Thu, 13 Mar 2025 23:21:44 -0700 Subject: [PATCH] possible fix for long startup times --- libraries/render-utils/src/RenderDeferredTask.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/libraries/render-utils/src/RenderDeferredTask.cpp b/libraries/render-utils/src/RenderDeferredTask.cpp index 296fc22c40..fd5e2633ce 100644 --- a/libraries/render-utils/src/RenderDeferredTask.cpp +++ b/libraries/render-utils/src/RenderDeferredTask.cpp @@ -96,10 +96,13 @@ void RenderDeferredTask::configure(const Config& config) { void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, uint transformOffset, size_t depth) { // Prepare the ShapePipelines - ShapePlumberPointer shapePlumberDeferred = std::make_shared(); - initDeferredPipelines(*shapePlumberDeferred, FadeEffect::getBatchSetter(), FadeEffect::getItemUniformSetter()); - ShapePlumberPointer shapePlumberForward = std::make_shared(); - initForwardPipelines(*shapePlumberForward); + static ShapePlumberPointer shapePlumberDeferred = std::make_shared(); + static ShapePlumberPointer shapePlumberForward = std::make_shared(); + static std::once_flag once; + std::call_once(once, [] { + initDeferredPipelines(*shapePlumberDeferred, FadeEffect::getBatchSetter(), FadeEffect::getItemUniformSetter()); + initForwardPipelines(*shapePlumberForward); + }); uint backgroundViewTransformSlot = render::RenderEngine::TS_BACKGROUND_VIEW + transformOffset; uint mainViewTransformSlot = render::RenderEngine::TS_MAIN_VIEW + transformOffset;