| 1 | // Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QT3DRENDER_QCOMPUTECOMMAND_H |
| 5 | #define QT3DRENDER_QCOMPUTECOMMAND_H |
| 6 | |
| 7 | #include <Qt3DCore/qcomponent.h> |
| 8 | #include <Qt3DRender/qt3drender_global.h> |
| 9 | |
| 10 | QT_BEGIN_NAMESPACE |
| 11 | |
| 12 | namespace Qt3DRender { |
| 13 | |
| 14 | class QComputeCommandPrivate; |
| 15 | |
| 16 | class Q_3DRENDERSHARED_EXPORT QComputeCommand : public Qt3DCore::QComponent |
| 17 | { |
| 18 | Q_OBJECT |
| 19 | Q_PROPERTY(int workGroupX READ workGroupX WRITE setWorkGroupX NOTIFY workGroupXChanged) |
| 20 | Q_PROPERTY(int workGroupY READ workGroupY WRITE setWorkGroupY NOTIFY workGroupYChanged) |
| 21 | Q_PROPERTY(int workGroupZ READ workGroupZ WRITE setWorkGroupZ NOTIFY workGroupZChanged) |
| 22 | Q_PROPERTY(RunType runType READ runType WRITE setRunType NOTIFY runTypeChanged REVISION(2, 13)) |
| 23 | |
| 24 | public: |
| 25 | enum RunType { |
| 26 | Continuous = 0, |
| 27 | Manual |
| 28 | }; |
| 29 | Q_ENUM(RunType) |
| 30 | |
| 31 | explicit QComputeCommand(Qt3DCore::QNode *parent = nullptr); |
| 32 | ~QComputeCommand(); |
| 33 | |
| 34 | int workGroupX() const; |
| 35 | int workGroupY() const; |
| 36 | int workGroupZ() const; |
| 37 | RunType runType() const; |
| 38 | |
| 39 | public Q_SLOTS: |
| 40 | void setWorkGroupX(int workGroupX); |
| 41 | void setWorkGroupY(int workGroupY); |
| 42 | void setWorkGroupZ(int workGroupZ); |
| 43 | Q_REVISION(2, 13) void setRunType(RunType runType); |
| 44 | |
| 45 | Q_REVISION(2, 13) void trigger(int frameCount = 1); |
| 46 | Q_REVISION(2, 13) void trigger(int workGroupX, int workGroupY, int workGroupZ, int frameCount = 1); |
| 47 | |
| 48 | Q_SIGNALS: |
| 49 | void workGroupXChanged(); |
| 50 | void workGroupYChanged(); |
| 51 | void workGroupZChanged(); |
| 52 | void runTypeChanged(); |
| 53 | |
| 54 | private: |
| 55 | Q_DECLARE_PRIVATE(QComputeCommand) |
| 56 | }; |
| 57 | |
| 58 | } // Qt3DRender |
| 59 | |
| 60 | QT_END_NAMESPACE |
| 61 | |
| 62 | #endif // QT3DRENDER_QCOMPUTECOMMAND_H |
| 63 | |