| 1 | // Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB). |
| 2 | // Copyright (C) 2016 The Qt Company Ltd and/or its subsidiary(-ies). |
| 3 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 4 | |
| 5 | #ifndef QT3DRENDER_RENDER_RENDERPASS_H |
| 6 | #define QT3DRENDER_RENDER_RENDERPASS_H |
| 7 | |
| 8 | // |
| 9 | // W A R N I N G |
| 10 | // ------------- |
| 11 | // |
| 12 | // This file is not part of the Qt API. It exists for the convenience |
| 13 | // of other Qt classes. This header file may change from version to |
| 14 | // version without notice, or even be removed. |
| 15 | // |
| 16 | // We mean it. |
| 17 | // |
| 18 | |
| 19 | #include <Qt3DRender/private/backendnode_p.h> |
| 20 | #include <Qt3DRender/qt3drender_global.h> |
| 21 | #include <Qt3DRender/private/parameterpack_p.h> |
| 22 | #include <Qt3DCore/private/qabstractaspect_p.h> |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | namespace Qt3DRender { |
| 27 | |
| 28 | class QRenderPass; |
| 29 | class QAbstractShader; |
| 30 | class QFilterKey; |
| 31 | class QRenderState; |
| 32 | |
| 33 | namespace Render { |
| 34 | |
| 35 | class RenderPassManager; |
| 36 | class RenderState; |
| 37 | |
| 38 | class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderPass : public BackendNode |
| 39 | { |
| 40 | public: |
| 41 | RenderPass(); |
| 42 | ~RenderPass(); |
| 43 | |
| 44 | void cleanup(); |
| 45 | |
| 46 | void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) override; |
| 47 | |
| 48 | Qt3DCore::QNodeId shaderProgram() const; |
| 49 | QList<Qt3DCore::QNodeId> filterKeys() const; |
| 50 | QList<Qt3DCore::QNodeId> parameters() const; |
| 51 | QList<Qt3DCore::QNodeId> renderStates() const; |
| 52 | |
| 53 | inline bool hasRenderStates() const { return !m_renderStates.empty(); } |
| 54 | |
| 55 | private: |
| 56 | void appendFilterKey(Qt3DCore::QNodeId filterKeyId); |
| 57 | void removeFilterKey(Qt3DCore::QNodeId filterKeyId); |
| 58 | |
| 59 | void addRenderState(Qt3DCore::QNodeId renderStateId); |
| 60 | void removeRenderState(Qt3DCore::QNodeId renderStateId); |
| 61 | |
| 62 | Qt3DCore::QNodeId m_shaderUuid; |
| 63 | QList<Qt3DCore::QNodeId> m_filterKeyList; |
| 64 | ParameterPack m_parameterPack; |
| 65 | QList<Qt3DCore::QNodeId> m_renderStates; |
| 66 | }; |
| 67 | |
| 68 | } // namespace Render |
| 69 | |
| 70 | } // namespace Qt3DRender |
| 71 | |
| 72 | QT_END_NAMESPACE |
| 73 | |
| 74 | #endif // QT3DRENDER_RENDER_RENDERPASS_H |
| 75 | |