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
24QT_BEGIN_NAMESPACE
25
26namespace Qt3DRender {
27
28class QRenderPass;
29class QAbstractShader;
30class QFilterKey;
31class QRenderState;
32
33namespace Render {
34
35class RenderPassManager;
36class RenderState;
37
38class Q_3DRENDERSHARED_PRIVATE_EXPORT RenderPass : public BackendNode
39{
40public:
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
55private:
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
72QT_END_NAMESPACE
73
74#endif // QT3DRENDER_RENDER_RENDERPASS_H
75

source code of qt3d/src/render/materialsystem/renderpass_p.h