summaryrefslogtreecommitdiffstats
path: root/src/render/frontend
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-04-01 16:26:12 +0100
committerPaul Lemire <paul.lemire@kdab.com>2020-04-14 14:46:15 +0200
commit199953915b073cad0c751c0e6feedaa1111c1e68 (patch)
treef0347326ff4391d6adad2c79d6cf6e5f4e964fb9 /src/render/frontend
parente91234e5ad13873ee782d617f1f43e4b21018b93 (diff)
Adjust number of jobs based on number of render paths
Renderer currently creates a large number of jobs, most of them doing nothing, this quickly adds up when we have lots of branches. To keep those down, we adjust the number based as estimate of branches that have work to do (no draw detection will fail if it's not the leaf node). Also make RenderViewCommandBuilder and MaterialParameterGathererJob only run if necessary (and reset instance counter on each frame). Finally, only create the right number of MaterialParameterGathererJobs for the amount of updates required. Change-Id: I2d38c72589a38445d0110fc22a472fb9482d1a03 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/frontend')
-rw-r--r--src/render/frontend/qrenderaspect.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp
index 19727f42b..ec9417c00 100644
--- a/src/render/frontend/qrenderaspect.cpp
+++ b/src/render/frontend/qrenderaspect.cpp
@@ -318,6 +318,7 @@ QRenderAspectPrivate::QRenderAspectPrivate(QRenderAspect::RenderType type)
m_updateWorldBoundingVolumeJob->addDependency(m_worldTransformJob);
m_updateWorldBoundingVolumeJob->addDependency(m_calculateBoundingVolumeJob);
+ m_calculateBoundingVolumeJob->addDependency(m_updateTreeEnabledJob);
m_expandBoundingVolumeJob->addDependency(m_updateWorldBoundingVolumeJob);
m_updateLevelOfDetailJob->addDependency(m_expandBoundingVolumeJob);
m_pickBoundingVolumeJob->addDependency(m_expandBoundingVolumeJob);
@@ -712,12 +713,8 @@ QVector<Qt3DCore::QAspectJobPtr> QRenderAspect::jobsToExecute(qint64 time)
jobs.append(bufferJobs);
const bool entitiesEnabledDirty = dirtyBitsForFrame & AbstractRenderer::EntityEnabledDirty;
- if (entitiesEnabledDirty) {
+ if (entitiesEnabledDirty)
jobs.push_back(d->m_updateTreeEnabledJob);
- // This dependency is added here because we clear all dependencies
- // at the start of this function.
- d->m_calculateBoundingVolumeJob->addDependency(d->m_updateTreeEnabledJob);
- }
if (dirtyBitsForFrame & AbstractRenderer::TransformDirty) {
jobs.push_back(d->m_worldTransformJob);