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
qquick3drenderoutputprovider_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 QQUICK3DRENDEROUTPUTPROVIDER_P_H
7#define QQUICK3DRENDEROUTPUTPROVIDER_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 <QtQuick3DHelpers/qtquick3dhelpersexports.h>
21#include <QQuick3DTextureProviderExtension>
22#include <QQmlEngine>
23
24#include <QtQuick3D/private/qquick3drenderpass_p.h>
25
27
28class Q_QUICK3DHELPERS_EXPORT QQuick3DRenderOutputProvider : public QQuick3DTextureProviderExtension
29{
30 Q_OBJECT
31 Q_PROPERTY(TextureSource textureSource READ textureSource WRITE setTextureSource NOTIFY textureSourceChanged FINAL)
32 Q_PROPERTY(QQuick3DRenderPass *renderPass READ renderPass WRITE setRenderPass NOTIFY renderPassChanged FINAL)
33 Q_PROPERTY(AttachmentSelector attachmentSelector READ attachmentSelector WRITE setAttachmentSelector NOTIFY attachmentSelectorChanged FINAL)
34 QML_NAMED_ELEMENT(RenderOutputProvider)
35 QML_ADDED_IN_VERSION(6, 11)
36public:
37 enum class TextureSource : quint32
38 {
39 None = 0,
40 UserPassTexture = 1,
41 AoTexture,
42 DepthTexture,
43 ScreenTexture,
44 NormalTexture,
45 MotionVectorTexture,
46 };
47 Q_ENUM(TextureSource)
48
49 enum class AttachmentSelector : quint32
50 {
51 Attachment0 = 0,
52 Attachment1 = 1,
53 Attachment2 = 2,
54 Attachment3 = 3,
55 };
56 Q_ENUM(AttachmentSelector)
57
58 explicit QQuick3DRenderOutputProvider(QQuick3DObject *parent = nullptr);
59 TextureSource textureSource() const;
60 void setTextureSource(TextureSource newTextureSource);
61
62 QQuick3DRenderPass *renderPass() const;
63 void setRenderPass(QQuick3DRenderPass *newRenderPass);
64
65 AttachmentSelector attachmentSelector() const;
66 void setAttachmentSelector(AttachmentSelector newAttachmentSelector);
67
68signals:
69 void textureSourceChanged();
70 void renderPassChanged();
71
72 void attachmentSelectorChanged();
73
74protected:
75 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
76 void markAllDirty() override;
77
78private:
79 enum DirtyType : quint32 {
80 TextureSourceDirty = 0x1,
81 UserPassTextureDirty = 0x2,
82 };
83
84 using DirtyTypeT = std::underlying_type_t<DirtyType>;
85 static constexpr DirtyTypeT AllDirty = 0xffffffff;
86
87 QQuick3DRenderPass *m_renderPass = nullptr;
88
89 TextureSource m_textureSource = TextureSource::None;
90 DirtyTypeT m_dirtyAttributes = AllDirty;
91 void markDirty(DirtyType type);
92 QString m_userPassKey;
93 AttachmentSelector m_attachmentSelector { AttachmentSelector::Attachment0 };
94};
95
96QT_END_NAMESPACE
97
98#endif // QQUICK3DRENDEROUTPUTPROVIDER_P_H
QSSGFrameData::AttachmentSelector attachmentSelector
QSSGRenderOutputProviderExtension(QQuick3DRenderOutputProvider *ext)
void prepareRender(QSSGFrameData &data) override
Prepare data for rendering.
bool prepareData(QSSGFrameData &data) override
Called after scene data is collected, but before any render data or rendering in the current frame ha...
QPointer< QQuick3DRenderOutputProvider > m_ext
void render(QSSGFrameData &data) override
Record the render pass.
void resetForFrame() override
Called each time a new frame starts.
Combined button and popup list for selecting options.