1 | // Copyright (C) 2016 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_QMEMORYBARRIER_H |
5 | #define QT3DRENDER_QMEMORYBARRIER_H |
6 | |
7 | #include <Qt3DRender/qframegraphnode.h> |
8 | |
9 | QT_BEGIN_NAMESPACE |
10 | |
11 | namespace Qt3DRender { |
12 | |
13 | class QMemoryBarrierPrivate; |
14 | |
15 | class Q_3DRENDERSHARED_EXPORT QMemoryBarrier : public QFrameGraphNode |
16 | { |
17 | Q_OBJECT |
18 | public: |
19 | explicit QMemoryBarrier(Qt3DCore::QNode *parent = nullptr); |
20 | ~QMemoryBarrier(); |
21 | |
22 | enum Operation { |
23 | None = 0, |
24 | VertexAttributeArray = (1 << 0), |
25 | ElementArray = (1 << 1), |
26 | Uniform = (1 << 2), |
27 | TextureFetch = (1 << 3), |
28 | ShaderImageAccess = (1 << 4), |
29 | Command = (1 << 5), |
30 | PixelBuffer = (1 << 6), |
31 | TextureUpdate = (1 << 7), |
32 | BufferUpdate = (1 << 8), |
33 | FrameBuffer = (1 << 9), |
34 | TransformFeedback = (1 << 10), |
35 | AtomicCounter = (1 << 11), |
36 | ShaderStorage = (1 << 12), |
37 | QueryBuffer = (1 << 13), |
38 | All = 0xFFFFFFFF |
39 | }; |
40 | Q_ENUM(Operation) |
41 | Q_DECLARE_FLAGS(Operations, Operation) |
42 | |
43 | Operations waitOperations() const; |
44 | |
45 | public Q_SLOTS: |
46 | void setWaitOperations(QMemoryBarrier::Operations operations); |
47 | |
48 | Q_SIGNALS: |
49 | void waitOperationsChanged(QMemoryBarrier::Operations barrierTypes); |
50 | |
51 | protected: |
52 | explicit QMemoryBarrier(QMemoryBarrierPrivate &dd, Qt3DCore::QNode *parent = nullptr); |
53 | |
54 | private: |
55 | Q_DECLARE_PRIVATE(QMemoryBarrier) |
56 | }; |
57 | |
58 | } // Qt3DRender |
59 | |
60 | QT_END_NAMESPACE |
61 | |
62 | Q_DECLARE_METATYPE(Qt3DRender::QMemoryBarrier::Operations) |
63 | |
64 | #endif // QT3DRENDER_QMEMORYBARRIER_H |
65 | |