summaryrefslogtreecommitdiffstats
path: root/src/core/aspects
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2020-02-13 17:14:49 +0000
committerMike Krus <mike.krus@kdab.com>2020-02-14 11:00:11 +0000
commit90d5218564ceff5b4479c2679a1914227299b168 (patch)
tree1aa005074fcbbba7356a5768299c1db935e10d88 /src/core/aspects
parentd967a6369c967d9a1c7f740cfc5c962b8664c9eb (diff)
Add ability to dump job graph to dot file
Can be triggered from the overlay API and using sending a "dump jobs" command to the aspect engine. Gets saved in the current working directory. Change-Id: I19fc94a1215187c1d7eb9d1f3b13b968939cc917 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/core/aspects')
-rw-r--r--src/core/aspects/qaspectengine.cpp4
-rw-r--r--src/core/aspects/qaspectmanager.cpp9
-rw-r--r--src/core/aspects/qaspectmanager_p.h2
3 files changed, 14 insertions, 1 deletions
diff --git a/src/core/aspects/qaspectengine.cpp b/src/core/aspects/qaspectengine.cpp
index d28306197..e52435eed 100644
--- a/src/core/aspects/qaspectengine.cpp
+++ b/src/core/aspects/qaspectengine.cpp
@@ -412,6 +412,10 @@ QVariant QAspectEngine::executeCommand(const QString &command)
const QStringList names = d->m_aspectManager->serviceLocator()->systemInformation()->aspectNames();
return names.join(QLatin1String("\n"));
}
+ if (command == QLatin1String("dump jobs")) {
+ d->m_aspectManager->dumpJobsOnNextFrame();
+ return QLatin1String("Dump in next frame in working directory");
+ }
QStringList args = command.split(QLatin1Char(' '));
QString aspectName = args.takeFirst();
diff --git a/src/core/aspects/qaspectmanager.cpp b/src/core/aspects/qaspectmanager.cpp
index f0dc366b2..66475c615 100644
--- a/src/core/aspects/qaspectmanager.cpp
+++ b/src/core/aspects/qaspectmanager.cpp
@@ -128,6 +128,7 @@ QAspectManager::QAspectManager(QAspectEngine *parent)
, m_simulationAnimation(nullptr)
#endif
, m_jobsInLastFrame(0)
+ , m_dumpJobs(false)
{
qRegisterMetaType<QSurface *>("QSurface*");
qCDebug(Aspects) << Q_FUNC_INFO;
@@ -434,6 +435,11 @@ QVector<QNode *> QAspectManager::lookupNodes(const QVector<QNodeId> &ids) const
return d->m_scene ? d->m_scene->lookupNodes(ids) : QVector<QNode *>{};
}
+void QAspectManager::dumpJobsOnNextFrame()
+{
+ m_dumpJobs = true;
+}
+
#if !QT_CONFIG(animation)
/*!
\internal
@@ -537,7 +543,8 @@ void QAspectManager::processFrame()
// For each Aspect
// Ask them to launch set of jobs for the current frame
// Updates matrices, bounding volumes, render bins ...
- m_jobsInLastFrame = m_scheduler->scheduleAndWaitForFrameAspectJobs(t);
+ m_jobsInLastFrame = m_scheduler->scheduleAndWaitForFrameAspectJobs(t, m_dumpJobs);
+ m_dumpJobs = false;
// Tell the aspect the frame is complete (except rendering)
for (QAbstractAspect *aspect : qAsConst(m_aspects))
diff --git a/src/core/aspects/qaspectmanager_p.h b/src/core/aspects/qaspectmanager_p.h
index 2038e0822..e3d978ee2 100644
--- a/src/core/aspects/qaspectmanager_p.h
+++ b/src/core/aspects/qaspectmanager_p.h
@@ -116,6 +116,7 @@ public:
QVector<QNode *> lookupNodes(const QVector<QNodeId> &ids) const;
int jobsInLastFrame() const { return m_jobsInLastFrame; }
+ void dumpJobsOnNextFrame();
private:
#if !QT_CONFIG(animation)
@@ -140,6 +141,7 @@ private:
RequestFrameAnimation *m_simulationAnimation;
#endif
int m_jobsInLastFrame;
+ bool m_dumpJobs;
};
} // namespace Qt3DCore