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_RENDER_COMPUTECOMMAND_P_H
5#define QT3DRENDER_RENDER_COMPUTECOMMAND_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <Qt3DRender/private/backendnode_p.h>
19#include <Qt3DRender/qcomputecommand.h>
20
21QT_BEGIN_NAMESPACE
22
23namespace Qt3DRender {
24
25namespace Render {
26
27class ComputeJobPrivate;
28
29class Q_3DRENDERSHARED_PRIVATE_EXPORT ComputeCommand : public BackendNode
30{
31public:
32 ComputeCommand();
33 ~ComputeCommand();
34
35 void cleanup();
36 void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override;
37
38 inline int x() const noexcept { return m_workGroups[0]; }
39 inline int y() const noexcept { return m_workGroups[1]; }
40 inline int z() const noexcept { return m_workGroups[2]; }
41 inline int frameCount() const noexcept { return m_frameCount; }
42 inline QComputeCommand::RunType runType() const noexcept { return m_runType; }
43
44 // Called from a job
45 void updateFrameCount();
46 bool hasReachedFrameCount() const;
47 void resetHasReachedFrameCount();
48
49private:
50 int m_workGroups[3];
51 int m_frameCount;
52 QComputeCommand::RunType m_runType;
53 bool m_hasReachedFrameCount;
54};
55
56} // Render
57
58} // Qt3DRender
59
60QT_END_NAMESPACE
61
62#endif // QT3DRENDER_RENDER_COMPUTECOMMAND_P_H
63

source code of qt3d/src/render/backend/computecommand_p.h