summaryrefslogtreecommitdiffstats
path: root/src/render
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2020-08-21 08:43:46 +0200
committerPaul Lemire <paul.lemire@kdab.com>2020-08-25 12:27:36 +0200
commit09ef0c77a3b6dccaaa8d26bc2572052e38dcc070 (patch)
tree5bafe3af4f6d9d9170d0ced5891c6982bc184be6 /src/render
parenta026e98d7f9e3d7d8a2757c98bd7de4fe28ff798 (diff)
Job Graph dump improvements
- Reverse dependency order so that graph shows jobs from first to last instead of last to first - Add instance id to RenderViewBuilder jobs, otherwise it all appears as if there's a single instance of a given job when in reality there is one per RenderView Change-Id: Id47764151f0321c794068e71e21a25e921d04589 Reviewed-by: Mike Krus <mike.krus@kdab.com>
Diffstat (limited to 'src/render')
-rw-r--r--src/render/jobs/filterproximitydistancejob.cpp11
-rw-r--r--src/render/jobs/filterproximitydistancejob_p.h1
-rw-r--r--src/render/jobs/frustumcullingjob.cpp11
-rw-r--r--src/render/jobs/frustumcullingjob_p.h1
-rw-r--r--src/render/jobs/genericlambdajob_p.h4
5 files changed, 24 insertions, 4 deletions
diff --git a/src/render/jobs/filterproximitydistancejob.cpp b/src/render/jobs/filterproximitydistancejob.cpp
index 56c3baa62..53c814805 100644
--- a/src/render/jobs/filterproximitydistancejob.cpp
+++ b/src/render/jobs/filterproximitydistancejob.cpp
@@ -40,13 +40,22 @@ namespace Qt3DRender {
namespace Render {
+namespace {
+int instanceCounter = 0;
+} // anonymous
+
FilterProximityDistanceJob::FilterProximityDistanceJob()
: m_manager(nullptr)
, m_targetEntity(nullptr)
, m_distanceThresholdSquared(0.)
{
- SET_JOB_RUN_STAT_TYPE(this, JobTypes::ProximityFiltering, 0)
+ SET_JOB_RUN_STAT_TYPE(this, JobTypes::ProximityFiltering, instanceCounter++)
+}
+
+FilterProximityDistanceJob::~FilterProximityDistanceJob()
+{
+ --instanceCounter;
}
void FilterProximityDistanceJob::run()
diff --git a/src/render/jobs/filterproximitydistancejob_p.h b/src/render/jobs/filterproximitydistancejob_p.h
index e058f011a..08ee43fac 100644
--- a/src/render/jobs/filterproximitydistancejob_p.h
+++ b/src/render/jobs/filterproximitydistancejob_p.h
@@ -57,6 +57,7 @@ class Q_3DRENDERSHARED_PRIVATE_EXPORT FilterProximityDistanceJob : public Qt3DCo
{
public:
FilterProximityDistanceJob();
+ ~FilterProximityDistanceJob();
inline void setManager(NodeManagers *manager) { m_manager = manager; }
inline void setProximityFilterIds(const Qt3DCore::QNodeIdVector &proximityFilterIds) { m_proximityFilterIds = proximityFilterIds; }
diff --git a/src/render/jobs/frustumcullingjob.cpp b/src/render/jobs/frustumcullingjob.cpp
index aa1a57a31..17dac3c49 100644
--- a/src/render/jobs/frustumcullingjob.cpp
+++ b/src/render/jobs/frustumcullingjob.cpp
@@ -51,13 +51,22 @@ namespace Qt3DRender {
namespace Render {
+namespace {
+int instanceCounter = 0;
+} // anonymous
+
FrustumCullingJob::FrustumCullingJob()
: Qt3DCore::QAspectJob()
, m_root(nullptr)
, m_manager(nullptr)
, m_active(false)
{
- SET_JOB_RUN_STAT_TYPE(this, JobTypes::FrustumCulling, 0)
+ SET_JOB_RUN_STAT_TYPE(this, JobTypes::FrustumCulling, instanceCounter++)
+}
+
+FrustumCullingJob::~FrustumCullingJob()
+{
+ --instanceCounter;
}
void FrustumCullingJob::run()
diff --git a/src/render/jobs/frustumcullingjob_p.h b/src/render/jobs/frustumcullingjob_p.h
index 636585c2f..9dc80f435 100644
--- a/src/render/jobs/frustumcullingjob_p.h
+++ b/src/render/jobs/frustumcullingjob_p.h
@@ -73,6 +73,7 @@ class Q_3DRENDERSHARED_PRIVATE_EXPORT FrustumCullingJob : public Qt3DCore::QAspe
{
public:
FrustumCullingJob();
+ ~FrustumCullingJob();
QT3D_ALIGNED_MALLOC_AND_FREE()
diff --git a/src/render/jobs/genericlambdajob_p.h b/src/render/jobs/genericlambdajob_p.h
index 994cd3a14..765746b0c 100644
--- a/src/render/jobs/genericlambdajob_p.h
+++ b/src/render/jobs/genericlambdajob_p.h
@@ -64,11 +64,11 @@ template<typename T>
class GenericLambdaJob : public Qt3DCore::QAspectJob
{
public:
- explicit GenericLambdaJob(T callable, JobTypes::JobType type = JobTypes::GenericLambda, const char *name = "GenericLambda")
+ explicit GenericLambdaJob(T callable, JobTypes::JobType type = JobTypes::GenericLambda, const char *name = "GenericLambda", int instance = 0)
: Qt3DCore::QAspectJob()
, m_callable(callable)
{
- SET_JOB_RUN_STAT_TYPE_AND_NAME(this, type, name, 0)
+ SET_JOB_RUN_STAT_TYPE_AND_NAME(this, type, name, instance)
}
// QAspectJob interface