summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSean Harmer <sean.harmer@kdab.com>2016-03-30 08:46:26 +0100
committerSean Harmer <sean.harmer@kdab.com>2016-03-31 09:33:36 +0000
commitfbeb4c667bea1da14acacac09e190115b7452c01 (patch)
treeb641171b563d8c605d4b18b6fc3c0041eb6cf700
parentcfd6010b30e953f34a09e0d28e5889bd1901d888 (diff)
DispatchCompute handles creation
Change-Id: I6b173a6fe61738dd045802dd35298841010ecbc3 Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
-rw-r--r--src/render/framegraph/dispatchcompute.cpp10
-rw-r--r--src/render/framegraph/dispatchcompute_p.h2
2 files changed, 12 insertions, 0 deletions
diff --git a/src/render/framegraph/dispatchcompute.cpp b/src/render/framegraph/dispatchcompute.cpp
index 2e85b876b..fc6ced899 100644
--- a/src/render/framegraph/dispatchcompute.cpp
+++ b/src/render/framegraph/dispatchcompute.cpp
@@ -38,6 +38,7 @@
****************************************************************************/
#include "dispatchcompute_p.h"
+#include <Qt3DRender/private/qdispatchcompute_p.h>
#include <Qt3DCore/qscenepropertychange.h>
QT_BEGIN_NAMESPACE
@@ -73,6 +74,15 @@ void DispatchCompute::updateFromPeer(Qt3DCore::QNode *peer)
m_workGroups[2] = computeDispatch->workGroupZ();
}
+void DispatchCompute::initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change)
+{
+ const auto typedChange = qSharedPointerCast<Qt3DCore::QNodeCreatedChange<QDispatchComputeData>>(change);
+ const auto &data = typedChange->data;
+ m_workGroups[0] = data.workGroupX;
+ m_workGroups[1] = data.workGroupY;
+ m_workGroups[2] = data.workGroupZ;
+}
+
void DispatchCompute::sceneChangeEvent(const Qt3DCore::QSceneChangePtr &e)
{
if (e->type() == Qt3DCore::NodeUpdated) {
diff --git a/src/render/framegraph/dispatchcompute_p.h b/src/render/framegraph/dispatchcompute_p.h
index 64ddf0f27..7b611f34d 100644
--- a/src/render/framegraph/dispatchcompute_p.h
+++ b/src/render/framegraph/dispatchcompute_p.h
@@ -75,6 +75,8 @@ public:
inline int z() const Q_DECL_NOEXCEPT { return m_workGroups[2]; }
private:
+ void initializeFromPeer(const Qt3DCore::QNodeCreatedChangeBasePtr &change) Q_DECL_FINAL;
+
int m_workGroups[3];
};