diff options
author | Mike Krus <mike.krus@kdab.com> | 2020-03-07 09:27:16 +0000 |
---|---|---|
committer | Mike Krus <mike.krus@kdab.com> | 2020-04-23 10:46:06 +0100 |
commit | 60f42119fe5c341880f4576e0c9ad8d99ee277d5 (patch) | |
tree | e3a4992e501593c64ad506c13c0ddae87e9f5018 /src/render/frontend | |
parent | ee476605629a74fb824d3f014deb6e6be9e40e9f (diff) |
Pull bounding volume info from front end
When an entity has a bounding QBoundingVolume component AND that has
a QGeometryView, the bounding volume can be computed by the core
aspect and the results get pulled to the render backend.
Otherwise, we use the old code which computes the bounding volume
in the render aspect.
This means we have 2 jobs to compute bounding volumes and that the core
version must complete before the render aspect runs.
Change-Id: I4de45e48fa0c4d40d3d5084f387abfed5ea1a2f8
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/frontend')
-rw-r--r-- | src/render/frontend/qrenderaspect.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/render/frontend/qrenderaspect.cpp b/src/render/frontend/qrenderaspect.cpp index 202012194..dff7f3640 100644 --- a/src/render/frontend/qrenderaspect.cpp +++ b/src/render/frontend/qrenderaspect.cpp @@ -95,6 +95,7 @@ #include <Qt3DCore/qarmature.h> #include <Qt3DCore/qjoint.h> #include <Qt3DCore/qskeletonloader.h> +#include <Qt3DCore/qcoreaspect.h> #include <Qt3DRender/private/backendnode_p.h> #include <Qt3DRender/private/cameraselectornode_p.h> @@ -297,6 +298,8 @@ void QRenderAspectPrivate::createNodeManagers() m_updateEntityLayersJob->setManager(m_nodeManagers); m_pickBoundingVolumeJob->setManagers(m_nodeManagers); m_rayCastingJob->setManagers(m_nodeManagers); + + m_calculateBoundingVolumeJob->setFrontEndNodeManager(m_aspectManager); } void QRenderAspectPrivate::onEngineStartup() @@ -316,6 +319,13 @@ void QRenderAspectPrivate::onEngineStartup() // Ensures all skeletons are loaded before we try to update them m_updateSkinningPaletteJob->addDependency(m_syncLoadingJobs); + + // make sure bv job in core aspect runs before the one in render aspect + if (m_aspectManager) { + auto *coreAspect = qobject_cast<Qt3DCore::QCoreAspect *>(m_aspectManager->aspect(&Qt3DCore::QCoreAspect::staticMetaObject)); + Q_ASSERT(coreAspect); + m_calculateBoundingVolumeJob->addDependency(coreAspect->calculateBoundingVolumeJob()); + } } /*! \internal */ |