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
qssgrenderreflectionmap_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QSSG_RENDER_REFLECTION_MAP_H
7#define QSSG_RENDER_REFLECTION_MAP_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/qtquick3druntimerenderglobal_p.h>
21#include <QtQuick3DRuntimeRender/private/qssgrenderreflectionprobe_p.h>
22
23QT_BEGIN_NAMESPACE
24
25class QRhi;
26class QRhiCommandBuffer;
27class QSSGRhiContext;
29
30class QRhiRenderBuffer;
31class QRhiTextureRenderTarget;
32class QRhiRenderPassDescriptor;
33class QRhiTexture;
34class QRhiGraphicsPipeline;
35class QRhiShaderResourceBindings;
36class QRhiBuffer;
37
39{
41
42 static QSSGReflectionMapEntry withRhiTexturedCubeMap(quint32 probeIdx,
43 QRhiTexture *preFiltered);
44 static QSSGReflectionMapEntry withRhiCubeMap(quint32 probeIdx,
45 QRhiTexture *cube,
46 QRhiTexture *prefiltered,
47 QRhiRenderBuffer *depthStencil);
48
49 void renderMips(QSSGRhiContext *rhiCtx);
51
53
54 // RHI resources
55 QRhiTexture *m_rhiCube = nullptr;
56 QRhiTexture *m_rhiPrefilteredCube = nullptr;
57 QRhiRenderBuffer *m_rhiDepthStencil = nullptr;
59 QRhiRenderPassDescriptor *m_rhiRenderPassDesc = nullptr;
60
61 QRhiGraphicsPipeline *m_prefilterPipeline = nullptr;
62 QRhiGraphicsPipeline *m_irradiancePipeline = nullptr;
63 QRhiShaderResourceBindings *m_prefilterSrb = nullptr;
64 QRhiShaderResourceBindings *m_irradianceSrb = nullptr;
65 QRhiBuffer *m_prefilterVertBuffer = nullptr;
66 QRhiBuffer *m_prefilterFragBuffer = nullptr;
67 QRhiBuffer *m_irradianceFragBuffer = nullptr;
69 QRhiRenderPassDescriptor *m_rhiPrefilterRenderPassDesc = nullptr;
71
73
75
76 bool m_needsRender = false;
77 bool m_rendered = false;
78
83};
84
85class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderReflectionMap
86{
87 typedef QVector<QSSGReflectionMapEntry> TReflectionMapEntryList;
88 Q_DISABLE_COPY(QSSGRenderReflectionMap)
89
90public:
91 const QSSGRenderContextInterface &m_context;
92
93 explicit QSSGRenderReflectionMap(const QSSGRenderContextInterface &inContext);
94 ~QSSGRenderReflectionMap();
95 void releaseCachedResources();
96
97 void addReflectionMapEntry(qint32 probeIdx, const QSSGRenderReflectionProbe &probe);
98 void addTexturedReflectionMapEntry(qint32 probeIdx, const QSSGRenderReflectionProbe &probe);
99
100 QSSGReflectionMapEntry *reflectionMapEntry(int probeIdx);
101
102 qint32 reflectionMapEntryCount() { return m_reflectionMapList.size(); }
103
104private:
105 TReflectionMapEntryList m_reflectionMapList;
106};
107
108using QSSGRenderReflectionMapPtr = std::shared_ptr<QSSGRenderReflectionMap>;
109
110QT_END_NAMESPACE
111
112#endif
friend class QSSGRenderContextInterface
QVarLengthArray< QRhiTextureRenderTarget *, 6 > m_rhiRenderTargets
QSSGRenderReflectionProbe::ReflectionTimeSlicing m_timeSlicing
QVarLengthArray< QRhiShaderResourceBindings *, 6 > m_skyBoxSrbs
static QSSGReflectionMapEntry withRhiTexturedCubeMap(quint32 probeIdx, QRhiTexture *preFiltered)
QRhiRenderPassDescriptor * m_rhiRenderPassDesc
static QSSGReflectionMapEntry withRhiCubeMap(quint32 probeIdx, QRhiTexture *cube, QRhiTexture *prefiltered, QRhiRenderBuffer *depthStencil)
QRhiShaderResourceBindings * m_irradianceSrb
QRhiShaderResourceBindings * m_prefilterSrb
QMap< int, QSize > m_prefilterMipLevelSizes
QRhiRenderPassDescriptor * m_rhiPrefilterRenderPassDesc
QRhiGraphicsPipeline * m_irradiancePipeline
QRhiGraphicsPipeline * m_prefilterPipeline
QMap< int, QVarLengthArray< QRhiTextureRenderTarget *, 6 > > m_rhiPrefilterRenderTargetsMap
void renderMips(QSSGRhiContext *rhiCtx)
QSSGRenderTextureCubeFace m_timeSliceFace