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
4#ifndef QQUICK3DRENDEROUTPUTPROVIDER_P_H
5#define QQUICK3DRENDEROUTPUTPROVIDER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick3DHelpers/qtquick3dhelpersexports.h>
19#include <QQuick3DTextureProviderExtension>
20#include <QQmlEngine>
21
22QT_BEGIN_NAMESPACE
23
24class QQuick3DRenderPass;
25
26class Q_QUICK3DHELPERS_EXPORT QQuick3DRenderOutputProvider : public QQuick3DTextureProviderExtension
27{
28 Q_OBJECT
29 Q_PROPERTY(TextureSource textureSource READ textureSource WRITE setTextureSource NOTIFY textureSourceChanged FINAL)
30 QML_NAMED_ELEMENT(RenderOutputProvider)
31 QML_ADDED_IN_VERSION(6, 11)
32public:
33 enum class TextureSource : quint32
34 {
35 None = 0,
36 AoTexture = 1,
37 DepthTexture,
38 ScreenTexture,
39 };
40 Q_ENUM(TextureSource)
41
42 explicit QQuick3DRenderOutputProvider(QQuick3DObject *parent = nullptr);
43 TextureSource textureSource() const;
44 void setTextureSource(TextureSource newTextureSource);
45
46signals:
47 void textureSourceChanged();
48
49protected:
50 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
51 void markAllDirty() override;
52
53private:
54 enum DirtyType : quint32 {
55 TextureSourceDirty = 0x1,
56 };
57
58 using DirtyTypeT = std::underlying_type_t<DirtyType>;
59 static constexpr DirtyTypeT AllDirty = 0xffffffff;
60
61 TextureSource m_textureSource = TextureSource::None;
62 DirtyTypeT m_dirtyAttributes = AllDirty;
63 void markDirty(DirtyType type);
64};
65
66QT_END_NAMESPACE
67
68#endif // QQUICK3DRENDEROUTPUTPROVIDER_P_H
\qmltype RenderOutputProvider \inqmlmodule QtQuick3D.Helpers \inherits TextureProviderExtension
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.