summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaj Grönholm <kaj.gronholm@qt.io>2018-02-09 13:25:37 +0200
committerKaj Grönholm <kaj.gronholm@qt.io>2018-02-10 08:29:32 +0000
commitd5bd8f06c767c96443cb696586232f11b14b9062 (patch)
tree7bd143ac61242e15c94e1d47ca0df6e394f7cfe0
parentc8964b8f1cf56718a189b0f57bad446cec30a8b8 (diff)
Avoid duplicate animation job dependencies
When testing Qt3D Studio runtime 2.0, noticed slowing down and memory usage increasing which came from AspectTaskRunnable m_dependers growing. Located reason being multiple dependencies to m_findRunningClipAnimatorsJob, so make sure that each job has only single dependency to that and m_loadAnimationClipJob. Task-number: QT3DS-909 Change-Id: I0d3ebc3ea2ab17af51394c69bc32b8aa2db0913e Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/animation/backend/handler.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/animation/backend/handler.cpp b/src/animation/backend/handler.cpp
index ed48d281f..112e2742b 100644
--- a/src/animation/backend/handler.cpp
+++ b/src/animation/backend/handler.cpp
@@ -248,9 +248,12 @@ QVector<Qt3DCore::QAspectJobPtr> Handler::jobsToExecute(qint64 time)
for (int i = 0; i < newSize; ++i) {
m_evaluateClipAnimatorJobs[i]->setClipAnimator(m_runningClipAnimators[i]);
m_evaluateClipAnimatorJobs[i]->removeDependency(QWeakPointer<Qt3DCore::QAspectJob>());
- if (hasLoadAnimationClipJob)
+ if (hasLoadAnimationClipJob &&
+ !m_evaluateClipAnimatorJobs[i]->dependencies().contains(m_loadAnimationClipJob))
m_evaluateClipAnimatorJobs[i]->addDependency(m_loadAnimationClipJob);
- if (hasFindRunningClipAnimatorsJob)
+
+ if (hasFindRunningClipAnimatorsJob &&
+ !m_evaluateClipAnimatorJobs[i]->dependencies().contains(m_findRunningClipAnimatorsJob))
m_evaluateClipAnimatorJobs[i]->addDependency(m_findRunningClipAnimatorsJob);
jobs.push_back(m_evaluateClipAnimatorJobs[i]);
}