summaryrefslogtreecommitdiffstats
path: root/src/render/frontend/qcomputecommand.h
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2018-10-30 15:30:52 +0100
committerPaul Lemire <paul.lemire@kdab.com>2018-11-14 06:16:56 +0000
commitf1b333c36a19cf85eab798fc1b1952ed063fedfe (patch)
treebed08fc0bd5d4a4e925d368786f3e8398e2ec908 /src/render/frontend/qcomputecommand.h
parenta3761a118f07dd3d4bebc3b28fff01b5f91a0016 (diff)
QComputeCommand allow to control the run behavior
It can either be Continuous, like it was until now or Manual. When in manual mode, the compute shader will only be executed by calling trigger() Change-Id: Icaae24f4691ccd821297f967d564e7a883fa60b5 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/frontend/qcomputecommand.h')
-rw-r--r--src/render/frontend/qcomputecommand.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/render/frontend/qcomputecommand.h b/src/render/frontend/qcomputecommand.h
index c31082197..ad7f89a4d 100644
--- a/src/render/frontend/qcomputecommand.h
+++ b/src/render/frontend/qcomputecommand.h
@@ -55,24 +55,37 @@ class QT3DRENDERSHARED_EXPORT QComputeCommand : public Qt3DCore::QComponent
Q_PROPERTY(int workGroupX READ workGroupX WRITE setWorkGroupX NOTIFY workGroupXChanged)
Q_PROPERTY(int workGroupY READ workGroupY WRITE setWorkGroupY NOTIFY workGroupYChanged)
Q_PROPERTY(int workGroupZ READ workGroupZ WRITE setWorkGroupZ NOTIFY workGroupZChanged)
+ Q_PROPERTY(RunType runType READ runType WRITE setRunType NOTIFY runTypeChanged REVISION 13)
public:
+ enum RunType {
+ Continuous = 0,
+ Manual
+ };
+ Q_ENUM(RunType)
+
explicit QComputeCommand(Qt3DCore::QNode *parent = nullptr);
~QComputeCommand();
int workGroupX() const;
int workGroupY() const;
int workGroupZ() const;
+ RunType runType() const;
public Q_SLOTS:
void setWorkGroupX(int workGroupX);
void setWorkGroupY(int workGroupY);
void setWorkGroupZ(int workGroupZ);
+ void setRunType(RunType runType);
+
+ void trigger(int frameCount = 1);
+ void trigger(int workGroupX, int workGroupY, int workGroupZ, int frameCount = 1);
Q_SIGNALS:
void workGroupXChanged();
void workGroupYChanged();
void workGroupZChanged();
+ void runTypeChanged();
private:
Q_DECLARE_PRIVATE(QComputeCommand)