Merge pull request #1360 from HifiExperiments/staticPlumbers

fix long startup times
This commit is contained in:
ksuprynowicz 2025-03-14 18:11:43 +01:00 committed by GitHub
commit 44c600a184
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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) { void RenderDeferredTask::build(JobModel& task, const render::Varying& input, render::Varying& output, render::CullFunctor cullFunctor, uint transformOffset, size_t depth) {
// Prepare the ShapePipelines // Prepare the ShapePipelines
ShapePlumberPointer shapePlumberDeferred = std::make_shared<ShapePlumber>(); static ShapePlumberPointer shapePlumberDeferred = std::make_shared<ShapePlumber>();
initDeferredPipelines(*shapePlumberDeferred, FadeEffect::getBatchSetter(), FadeEffect::getItemUniformSetter()); static ShapePlumberPointer shapePlumberForward = std::make_shared<ShapePlumber>();
ShapePlumberPointer shapePlumberForward = std::make_shared<ShapePlumber>(); static std::once_flag once;
initForwardPipelines(*shapePlumberForward); std::call_once(once, [] {
initDeferredPipelines(*shapePlumberDeferred, FadeEffect::getBatchSetter(), FadeEffect::getItemUniformSetter());
initForwardPipelines(*shapePlumberForward);
});
uint backgroundViewTransformSlot = render::RenderEngine::TS_BACKGROUND_VIEW + transformOffset; uint backgroundViewTransformSlot = render::RenderEngine::TS_BACKGROUND_VIEW + transformOffset;
uint mainViewTransformSlot = render::RenderEngine::TS_MAIN_VIEW + transformOffset; uint mainViewTransformSlot = render::RenderEngine::TS_MAIN_VIEW + transformOffset;