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 UserPassDepthTexture,
47 };
48 Q_ENUM(TextureSource)
49
50 enum class AttachmentSelector : quint32
51 {
52 Attachment0 = 0,
53 Attachment1 = 1,
54 Attachment2 = 2,
55 Attachment3 = 3,
56 };
57 Q_ENUM(AttachmentSelector)
58
59 explicit QQuick3DRenderOutputProvider(QQuick3DObject *parent = nullptr);
60 TextureSource textureSource() const;
61 void setTextureSource(TextureSource newTextureSource);
62
63 QQuick3DRenderPass *renderPass() const;
64 void setRenderPass(QQuick3DRenderPass *newRenderPass);
65
66 AttachmentSelector attachmentSelector() const;
67 void setAttachmentSelector(AttachmentSelector newAttachmentSelector);
68
69signals:
70 void textureSourceChanged();
71 void renderPassChanged();
72
73 void attachmentSelectorChanged();
74
75protected:
76 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
77 void markAllDirty() override;
78
79private:
80 enum DirtyType : quint32 {
81 TextureSourceDirty = 0x1,
82 UserPassTextureDirty = 0x2,
83 };
84
85 using DirtyTypeT = std::underlying_type_t<DirtyType>;
86 static constexpr DirtyTypeT AllDirty = 0xffffffff;
87
88 QQuick3DRenderPass *m_renderPass = nullptr;
89
90 TextureSource m_textureSource = TextureSource::None;
91 DirtyTypeT m_dirtyAttributes = AllDirty;
92 void markDirty(DirtyType type);
93 QString m_userPassKey;
94 AttachmentSelector m_attachmentSelector { AttachmentSelector::Attachment0 };
95};
96
97QT_END_NAMESPACE
98
99#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.