Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qssgrenderuserpass_p.h
Go to the documentation of this file.
1// Copyright (C) 2025 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QSSGRENDERUSERPASS_P_H
7#define QSSGRENDERUSERPASS_P_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3DRuntimeRender/private/qssgrendergraphobject_p.h>
21#include <QtQuick3DRuntimeRender/private/qssgrenderimage_p.h>
22
23#include <QtCore/QVariant>
24
25QT_BEGIN_NAMESPACE
26
27class QSSGCommand;
28
29class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderUserPass : public QSSGRenderGraphObject
30{
31public:
32 enum MaterialModes {
33 OriginalMaterial,
34 AugmentMaterial,
35 OverrideMaterial
36 };
37
38 enum PassModes {
39 UserPass,
40 SkyboxPass,
41 Item2DPass,
42 InfiniteGridPass
43 };
44
45 enum class Role : quint8 {
46 TopLevel,
47 SubPass
48 };
49
50 enum class DirtyFlag : quint8
51 {
52 ShaderDirty = 0x1
53 };
54 using FlagT = std::underlying_type_t<DirtyFlag>;
55
56 enum class State : quint8
57 {
58 None,
59 Ready,
60 Error,
61 };
62
63 static constexpr DirtyFlag DirtyMask { std::numeric_limits<FlagT>::max() };
64
65 QSSGRenderUserPass();
66 ~QSSGRenderUserPass();
67
68 bool isDirty(DirtyFlag flag = DirtyMask) const;
69 void markDirty(DirtyFlag flag);
70 void clearDirty(DirtyFlag flag);
71
72 bool isReady() const { return (m_state == State::Ready); }
73
74 void finalizeShaders(const QSSGRenderContextInterface &ctx);
75
76 QVector<QSSGCommand *> commands;
77
78 QString key;
79 QColor clearColor = Qt::black;
80 QRhiTextureRenderTarget::Flags renderTargetFlags = {};
81
82 // Material Mode
83 MaterialModes materialMode = OriginalMaterial;
84 QSSGRenderGraphObject *overrideMaterial = nullptr;
85 QSSGUserShaderAugmentation shaderAugmentation;
86 QRhiDepthStencilClearValue depthStencilClearValue = { };
87 PassModes passMode = UserPass;
88 Role role = Role::TopLevel;
89
90 FlagT m_dirtyFlags = 0;
91 State m_state = State::None;
92 // Number of RenderPass ancestors of the frontend item. Deeper-nested passes
93 // render first ("children before parents"), so a pass declared inside its
94 // consumer renders before it. Derived at sync when the scene manager's pass
95 // set is dirty.
96 quint32 m_nestingDepth = 0;
97 // Registration order in the scene manager's userRenderPasses list. Used as a
98 // stable tiebreak when ordering scheduled passes with equal nesting depth,
99 // so the render order does not depend on when a provider scheduled a pass.
100 quint32 m_declarationOrder = 0;
101
102 void resetCommands();
103};
104
105using QSSGRenderUserPassPtr = std::shared_ptr<QSSGRenderUserPass>;
106
107QT_END_NAMESPACE
108
109#endif // QSSGRENDERUSERPASS_P_H
Combined button and popup list for selecting options.
QByteArray replaceAugmentMacros(const QByteArray &shaderCode)