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
qssgrenderpass_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 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 QSSGRENDERPASS_H
7#define QSSGRENDERPASS_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 <QtCore/qglobal.h>
21
22#include <ssg/qssgrenderhelpers.h>
23#include <QtQuick3DUtils/private/qssgaosettings_p.h>
24#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
25#include <QtQuick3DRuntimeRender/private/qssgrendershadercache_p.h>
26#include <QtQuick3DRuntimeRender/private/qssgrenderableobjects_p.h>
27#include <QtQuick3DRuntimeRender/private/qssgrendermotionvectormap_p.h>
28#include <QtQuick3DRuntimeRender/private/qssgcomputemanager_p.h>
29#include "qssgrenderer_p.h"
30
31QT_BEGIN_NAMESPACE
32
33class QSSGRenderShadowMap;
34class QSSGRenderReflectionMap;
36class QSSGRenderCamera;
37struct QSSGRenderSkyMaterial;
38class QSGRenderer;
39class QSSGRenderExtension;
40class QSSGRenderUserPass;
41class QSSGRenderComputePass;
42
43class QRhiTexture;
44
46{
47public:
48 enum class Type
49 {
53 };
54 // Input:
55
56 virtual ~QSSGRenderPass();
57 virtual void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) = 0;
58 virtual void renderPass(QSSGRenderer &renderer) = 0;
59 virtual Type passType() const = 0;
60 virtual void resetForFrame() = 0;
61
62 // Output:
63
64 // Flags: Debug markers(?)
65
66 // Dependency
67};
68
70{
71public:
72 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
73 void renderPass(QSSGRenderer &renderer) final;
74 Type passType() const final { return Type::Standalone; }
75 void resetForFrame() final;
76
78
79 static constexpr int MaxBuckets = 8; // (int(skin) << 2) | (int(instance) << 1) | int(morph);
81 QSSGRenderCamera *camera = nullptr;
83 bool enabled = false;
85};
86
88{
89public:
90 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
91 void renderPass(QSSGRenderer &renderer) final;
92 Type passType() const final { return Type::Standalone; }
93 void resetForFrame() final;
94
98 QSSGRenderCamera *camera = nullptr;
103 bool enabled = false;
104};
105
107{
108public:
110 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
111 void renderPass(QSSGRenderer &renderer) final;
112 Type passType() const final { return Type::Standalone; }
113 void resetForFrame() final;
114
119 bool m_includeSTO = false; // Compatibility flag to include STO objects in reflection map rendering.
120};
121
123{
124public:
125 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
126 void renderPass(QSSGRenderer &renderer) final;
127 Type passType() const final { return Type::Standalone; }
128 void resetForFrame() final;
129};
130
132{
133public:
134 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
135 void renderPass(QSSGRenderer &renderer) final;
136 Type passType() const final { return Type::Main; }
137 void resetForFrame() final;
138
142 bool active = false;
143};
144
146{
147public:
148 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
149 void renderPass(QSSGRenderer &renderer) final;
150 Type passType() const final { return Type::Standalone; }
151 void resetForFrame() final;
152
154 const QSSGRenderCamera *camera = nullptr;
159};
160
161class Q_QUICK3DRUNTIMERENDER_EXPORT DepthMapPass : public QSSGRenderPass
162{
163public:
164 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
165 void renderPass(QSSGRenderer &renderer) final;
166 Type passType() const final { return Type::Standalone; }
167 void resetForFrame() final;
168 void setMultisamplingEnabled(bool enabled) { m_multisampling = enabled; }
169 bool isMultisamplingEnabled() const { return m_multisampling; }
170
171 QSSGRenderableObjectList sortedOpaqueObjects;
172 QSSGRenderableObjectList sortedTransparentObjects;
173 QSSGRhiGraphicsPipelineState ps;
174 QSSGRhiRenderableTexture *rhiDepthTexture = nullptr;
175 bool m_multisampling = false;
176};
177
178class Q_QUICK3DRUNTIMERENDER_EXPORT NormalPass : public QSSGRenderPass
179{
180public:
181 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
182 void renderPass(QSSGRenderer &renderer) final;
183 Type passType() const final { return Type::Standalone; }
184 void resetForFrame() final;
185
186 QSSGRenderableObjectList sortedOpaqueObjects;
187 QSSGRhiGraphicsPipelineState ps;
188 QSSGRhiRenderableTexture *normalTexture = nullptr;
189 QSSGRhiRenderableTexture *depthBuffer = nullptr;
190};
191
193{
194public:
195 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
196 void renderPass(QSSGRenderer &renderer) final;
197 Type passType() const final { return Type::Main; }
198 void resetForFrame() final;
199
201 QRhiRenderPassDescriptor *rpDesc = nullptr;
203 bool skipTonemapping = false;
204 bool skipPrep = false;
205};
206
208{
209public:
210 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
211 void renderPass(QSSGRenderer &renderer) final;
212 Type passType() const final { return Type::Main; }
213 void resetForFrame() final;
214
216 QRhiRenderPassDescriptor *rpDesc = nullptr;
218 bool skipTonemapping = false;
219 bool ready = false;
220 int scaleDivisor = 1; // 1=Full, 2=Half, 4=Quarter
223 // Offscreen target (owned by the layer render data) used for reduced-scale rendering.
225};
226
228{
229public:
230 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
231 void renderPass(QSSGRenderer &renderer) final;
232 Type passType() const final { return Type::Main; }
233 void resetForFrame() final;
234
237 QRhiRenderPassDescriptor *rpDesc = nullptr;
239 bool skipTonemapping = false;
240};
241
243{
244public:
245 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
246 void renderPass(QSSGRenderer &renderer) final;
247 Type passType() const final { return Type::Standalone; }
248 void resetForFrame() final;
249
253 QSSGShaderFeatures shaderFeatures;
257 bool wantsMips = false;
258};
259
261{
262public:
263 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
264 void renderPass(QSSGRenderer &renderer) final;
265 Type passType() const final { return Type::Main; }
266 void resetForFrame() final;
267
271};
272
274{
275public:
276 static void prep(const QSSGRenderContextInterface &ctx,
278 QSSGPassKey passKey,
279 QSSGRhiGraphicsPipelineState &ps,
280 QSSGShaderFeatures shaderFeatures,
281 QRhiRenderPassDescriptor *rpDesc,
282 const QSSGRenderableObjectList &sortedOpaqueObjects);
283
284 static void render(const QSSGRenderContextInterface &ctx,
285 const QSSGRhiGraphicsPipelineState &ps,
286 const QSSGRenderableObjectList &sortedOpaqueObjects);
287
288 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
289 void renderPass(QSSGRenderer &renderer) final;
290 Type passType() const final { return Type::Main; }
291 void resetForFrame() final;
292
295 QSSGShaderFeatures shaderFeatures;
296};
297
298struct QSSGCameraRenderData;
299
301{
302public:
303 static void prep(const QSSGRenderContextInterface &ctx,
305 QSSGPassKey passKey,
306 QSSGRhiGraphicsPipelineState &ps,
307 QSSGShaderFeatures shaderFeatures,
308 QRhiRenderPassDescriptor *rpDesc,
309 const QSSGRenderableObjectList &sortedTransparentObjects,
310 bool oit = false);
311
312 static void render(const QSSGRenderContextInterface &ctx,
313 const QSSGRhiGraphicsPipelineState &ps,
314 const QSSGRenderableObjectList &sortedTransparentObjects);
315
316
317 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
318 void renderPass(QSSGRenderer &renderer) final;
319 Type passType() const final { return Type::Main; }
320 void resetForFrame() final;
321
324 QSSGShaderFeatures shaderFeatures;
325};
326
328{
329public:
330 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
331 void renderPass(QSSGRenderer &renderer) final;
332 Type passType() const final { return Type::Main; }
333 void resetForFrame() final;
334
335protected:
337};
338
340{
341public:
342 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
343 void renderPass(QSSGRenderer &renderer) final;
344 Type passType() const final { return Type::Main; }
345 void resetForFrame() final;
346
350};
351
353{
354public:
355 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
356 void renderPass(QSSGRenderer &renderer) final;
357 Type passType() const final { return Type::Main; }
358 void resetForFrame() final;
359
362};
363
365{
366public:
367 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
368 void renderPass(QSSGRenderer &renderer) final;
369 Type passType() const final { return Type::Extension; }
370 void resetForFrame() final;
371
372 bool hasData() const { return extensions.size() != 0; }
373
375};
376
378{
379public:
380 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderUserPass *pass, QSSGPassKey key);
381 void renderPass(QSSGRenderer &renderer, QSSGRenderUserPass *pass);
382 void resetForFrame();
383
384protected:
401
402 void prepareTopLevelPass(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderUserPass *passNode, QSSGPassKey key)
403 {
404 visitedPasses.clear(); // clear visited passes for each top-level pass
405 preparePassImpl(renderer, data, passNode, {/* null */}, nullptr, key);
406 }
407
408 void prepareSubPass(QSSGRenderer &renderer,
410 QSSGRenderUserPass *subPassNode,
411 const QSSGRhiRenderableTextureV2Ptr &renderableTexture,
412 UserPassData *parentUserPassData,
413 QSSGPassKey key)
414 {
415 Q_ASSERT(renderableTexture != nullptr);
416 preparePassImpl(renderer, data, subPassNode, renderableTexture, parentUserPassData, key);
417 }
418
419 void preparePassImpl(QSSGRenderer &renderer,
421 QSSGRenderUserPass *passNode,
422 QSSGRhiRenderableTextureV2Ptr renderableTexture,
423 UserPassData *parentUserPassData,
424 QSSGPassKey key);
426 std::set<QSSGResourceId> visitedPasses; // For circular dependency detection
427 static constexpr size_t MAX_SUBPASS_DEPTH = 16;
428};
429
431{
432public:
433 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderComputePass *pass, QSSGPassKey key);
434 void renderPass(QSSGRenderer &renderer, QSSGRenderComputePass *pass);
435 void resetForFrame();
436private:
437 std::unordered_map<QSSGRenderComputePass *, ComputeUserPassData> userPassData;
438};
439
441{
442 UserRenderPass userRenderPass;
443 UserComputePass userComputePass;
444public:
445 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
446 void renderPass(QSSGRenderer &renderer) final;
447 Type passType() const final { return Type::Standalone; }
448 void resetForFrame() final;
449
450 bool hasData() const { return (userPasses.size() != 0); }
451
453};
454
457{
458public:
459 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
460 void renderPass(QSSGRenderer &renderer) final;
461 Type passType() const final { return Type::Standalone; }
462 void resetForFrame() final;
463 void setMethod(QSSGRenderLayer::OITMethod m) { method = m; }
464 bool linkedListRequiresResize(QSize dim);
465
467
470
473 QSSGShaderFeatures shaderFeatures;
474 union {
475 QSSGRhiRenderableTexture *rhiAccumTexture = nullptr;
476 QSSGRhiRenderableTexture *rhiABufferImage;
477 QRhiBuffer *rhiABuffer;
478 };
479 union {
480 QSSGRhiRenderableTexture *rhiRevealageTexture = nullptr;
481 QSSGRhiRenderableTexture *rhiAuxiliaryImage;
482 QRhiBuffer *rhiAuxBuffer;
483 };
486 QRhiTexture *readbackImage = nullptr;
492};
493
495{
496public:
497 void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final;
498 void renderPass(QSSGRenderer &renderer) final;
499 Type passType() const final { return Type::Main; }
500 void resetForFrame() final;
501 void setMethod(QSSGRenderLayer::OITMethod m) { method = m; }
505 QSSGShaderFeatures shaderFeatures;
507 QRhiTexture *rhiOverflowTexture = nullptr;
508 union {
509 QSSGRhiRenderableTexture *rhiAccumTexture = nullptr;
510 QSSGRhiRenderableTexture *rhiABufferImage;
511 QRhiBuffer *rhiABuffer;
512 };
513 union {
514 QSSGRhiRenderableTexture *rhiRevealageTexture = nullptr;
515 QSSGRhiRenderableTexture *rhiAuxiliaryImage;
516 QRhiBuffer *rhiAuxBuffer;
517 };
518};
519
520QT_END_NAMESPACE
521
522#endif // QSSGRENDERPASS_H
QSSGRhiShaderPipelinePtr debugObjectShader
QSSGRhiGraphicsPipelineState ps
Type passType() const final
void resetForFrame() final
QSSGRhiGraphicsPipelineState ps
QSSGRenderLayer * layer
QSSGRhiShaderPipelinePtr gridShader
void resetForFrame() final
Type passType() const final
Type passType() const final
std::vector< QSGRenderer * > prepdItem2DRenderers
void resetForFrame() final
static constexpr int MaxBuckets
QSSGRhiGraphicsPipelineState ps
QSSGRenderMotionVectorMapPtr motionVectorMapManager
QSSGRenderableObjectList motionVectorPassObjects[MaxBuckets]
Type passType() const final
QSSGRhiRenderableTexture * rhiMotionVectorTexture
QSSGRenderCamera * camera
QRhiTexture * rhiOverflowTexture
QSSGShaderFeatures shaderFeatures
QRhiShaderResourceBindings * compositeSrb
QSSGRhiShaderPipelinePtr compositeShaderPipeline
QSSGRenderLayer::OITMethod method
void resetForFrame() final
Type passType() const final
QSSGRhiGraphicsPipelineState ps
void setMethod(QSSGRenderLayer::OITMethod m)
void setMethod(QSSGRenderLayer::OITMethod m)
quint32 reportedNodeCount
QSSGShaderFeatures shaderFeatures
QSSGRenderLayer::OITMethod method
QRhiShaderResourceBindings * clearSrb
QSSGRenderableObjectList sortedTransparentObjects
QSSGRhiRenderableTexture * rhiCounterImage
QRhiTextureRenderTarget * renderTarget
Type passType() const final
void resetForFrame() final
QSSGRhiShaderPipelinePtr clearPipeline
QSSGRhiRenderableTexture * rhiDepthTexture
QSSGRhiGraphicsPipelineState ps
QRhiTexture * readbackImage
bool linkedListRequiresResize(QSize dim)
QSSGOITRenderContext * oitRenderContext
QRhiBuffer * rhiCounterBuffer
void resetForFrame() final
Type passType() const final
QSSGShaderFeatures shaderFeatures
QSSGRhiGraphicsPipelineState ps
static void render(const QSSGRenderContextInterface &ctx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedOpaqueObjects)
QSSGRenderableObjectList sortedOpaqueObjects
QRect viewport() const
Returns the viewport rectangle.
void drawLine(const QVector3D &startPoint, const QVector3D &endPoint, const QColor &color, bool isPersistent=false)
void recordRenderDebugObjects(QSSGRhiContext *rhiCtx, QSSGRhiGraphicsPipelineState *ps, QRhiShaderResourceBindings *srb, QRhiRenderPassDescriptor *rpDesc)
void drawPoint(const QVector3D &vertex, const QColor &color, bool isPersistent=false)
void prepareGeometry(QSSGRhiContext *rhiCtx, QRhiResourceUpdateBatch *rub)
static QColor levelOfDetailColor(quint32 lod)
void drawBounds(const QSSGBounds3 &bounds, const QColor &color, bool isPersistent=false)
QSSGLayerRenderPreparationResult(const QRectF &inViewport, QSSGRenderLayer &inLayer)
const QSSGLayerRenderPreparationResultFlags & getFlags() const
virtual ~QSSGRenderPass()
virtual void resetForFrame()=0
virtual Type passType() const =0
QSSGRenderableObjectFlags renderableFlags
friend class QSSGParticleRenderer
void releaseItem2DData(const QSSGRenderItem2D &item2D)
const std::unique_ptr< QSSGRhiQuadRenderer > & rhiQuadRenderer() const
quint32 frameDepth() const
float dpr() const
friend class QSSGRenderContextInterface
QRect scissorRect() const
void cleanupResources(QSet< QSSGRenderGraphObject * > &resources)
void setViewport(QRect inViewport)
void beginSubLayerRender(QSSGLayerRenderData &inLayer)
const std::unique_ptr< QSSGRhiCubeRenderer > & rhiCubeRenderer() const
void setDpr(float dpr)
void setScissorRect(QRect inScissorRect)
void endSubLayerRender(QSSGLayerRenderData &inLayer)
QSSGRenderContextInterface * contextInterface() const
void resetForFrame() final
std::shared_ptr< QSSGRenderReflectionMap > reflectionMapManager
QSSGRenderableObjectList reflectionPassObjects
std::vector< QSSGRenderReflectionProbe * > reflectionProbes
QSSGRhiGraphicsPipelineState ps
Type passType() const final
Type passType() const final
QSSGRhiRenderableTexture * rhiAoTexture
const QSSGRhiRenderableTexture * rhiDepthTexture
void resetForFrame() final
QSSGRhiShaderPipelinePtr ssaoShaderPipeline
QSSGAmbientOcclusionSettings aoSettings
const QSSGRenderCamera * camera
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
QSSGRhiGraphicsPipelineState ps
Type passType() const final
std::optional< SkyboxPass > skyboxPass
QSSGShaderFeatures shaderFeatures
QSSGRenderableObjectList sortedOpaqueObjects
std::optional< SkyboxCubeMapPass > skyboxCubeMapPass
QSSGRhiRenderableTexture * rhiScreenTexture
QSSGRenderableObjectList sortedScreenTextureObjects
const QSSGRhiRenderableTexture * rhiScreenTexture
QSSGRhiGraphicsPipelineState ps
Type passType() const final
QSSGRenderCamera * camera
QSSGBounds3 castingObjectsBox
QSSGShaderLightList globalLights
QSSGRenderableObjectList shadowPassObjects
QSSGRhiGraphicsPipelineState ps
QSSGBounds3 receivingObjectsBox
void resetForFrame() final
std::unique_ptr< QSSGRenderCamera > debugCamera
Type passType() const final
std::shared_ptr< QSSGRenderShadowMap > shadowMapManager
QSSGRhiRenderableTexture * offscreenTexture
QRhiShaderResourceBindings * backgroundSrb
Type passType() const final
QSSGRhiShaderPipelinePtr pipeline
QSSGRhiGraphicsPipelineState ps
QRhiRenderPassDescriptor * rpDesc
void resetForFrame() final
Type passType() const final
QRhiRenderPassDescriptor * rpDesc
QSSGRenderLayer * layer
QSSGRhiShaderPipelinePtr skyBoxCubeShader
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
Type passType() const final
void resetForFrame() final
QRhiRenderPassDescriptor * rpDesc
Type passType() const final
QSSGRenderLayer * layer
QSSGRhiGraphicsPipelineState ps
QSSGRenderableObjectList sortedTransparentObjects
static void render(const QSSGRenderContextInterface &ctx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedTransparentObjects)
QSSGShaderFeatures shaderFeatures
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
Type passType() const final
Type passType() const final
QList< QSSGRenderExtension * > extensions
void resetForFrame() final
void resetForFrame() final
bool hasData() const
QList< QSSGRenderUserPassBase * > userPasses
Type passType() const final
static constexpr size_t MAX_SUBPASS_DEPTH
std::vector< UserPassData > userPassData
std::set< QSSGResourceId > visitedPasses
void resetForFrame() final
QSSGRenderableObjectList renderedOpaqueDepthPrepassObjects
Type passType() const final
QSSGRhiGraphicsPipelineState ps
QSSGRenderableObjectList renderedDepthWriteObjects
QSSGRenderResult::Key toInternalRenderResultKey(QSSGFrameData::RenderResult id)
Combined button and popup list for selecting options.
qsizetype rhiPrepareOverrideMaterialUserPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, QSSGRenderGraphObject *overrideMaterial, QSSGLayerRenderData &inData, QSSGRenderableObjectList &inObjects, QSSGShaderFeatures featureSet)
bool setupDrawInputs(QSSGRhiContext *rhiCtx, QRhiGraphicsPipeline *ps, const QSSGSubsetRenderable &renderable, QRhiBuffer *instanceIndexBuffer, QRhiCommandBuffer::VertexInput *vertexBuffers, int &vertexBufferCount, quint32 &instances)
void rhiRenderUserAugmentedPass(QSSGRhiContext *rhiCtx, QSSGRenderableObjectList &inObjects)
quint32 rhiCalculateABufferSize(int nodeCount)
void rhiRenderAoTexture(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, QSSGRenderer &renderer, QSSGRhiShaderPipeline &shaderPipeline, QSSGRhiGraphicsPipelineState &ps, const QSSGAmbientOcclusionSettings &ao, const QSSGRhiRenderableTexture &rhiAoTexture, const QSSGRhiRenderableTexture &rhiDepthTexture, const QSSGRenderCamera &camera)
bool anyAutoLodInstances(const QSSGSubsetRenderable &renderable)
bool bindInstanceIndices(QRhiGraphicsPipeline *ps, QRhiBuffer *instanceIndexBuffer, QRhiCommandBuffer::VertexInput *vertexBuffers, int *vertexBufferCount)
bool rhiPrepareNormalPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, QSSGLayerRenderData &inData, const QSSGRenderableObjectList &sortedOpaqueObjects)
bool rhiPrepareMotionVectorTexture(QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex)
void rhiRenderReflectionMap(const QSSGRenderContextInterface &context, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGRhiGraphicsPipelineState *ps, QSSGRenderReflectionMap &reflectionMapManager, const std::vector< QSSGRenderReflectionProbe * > &reflectionProbes, const QSSGRenderableObjectList &reflectionPassObjects, QSSGRenderer &renderer)
void rhiRenderNormalPass(QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedOpaqueObjects, bool *needsSetViewport)
Q_QUICK3DRUNTIMERENDER_EXPORT void rhiRenderRenderable(QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &state, QSSGRenderableObject &object, bool *needsSetViewport, QSSGRenderTextureCubeFace cubeFace=QSSGRenderTextureCubeFaceNone, qsizetype userPassIndex=-1)
void rhiDrawNonIndexed(QSSGRhiContext *rhiCtx, QRhiCommandBuffer *cb, const QSSGSubsetRenderable &renderable, quint32 instances)
qsizetype rhiPrepareAugmentedUserPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, const QSSGUserShaderAugmentation &shaderAugmentation, const QSSGLayerRenderData &inData, QSSGRenderableObjectList &inObjects, QSSGShaderFeatures featureSet)
bool rhiPrepareDepthPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, QSSGLayerRenderData &inData, const QSSGRenderableObjectList &sortedOpaqueObjects, const QSSGRenderableObjectList &sortedTransparentObjects, int samples, int viewCount)
qsizetype rhiPrepareOriginalMaterialUserPass(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGRhiGraphicsPipelineState &basePipelineState, QRhiRenderPassDescriptor *rpDesc, const QSSGLayerRenderData &inData, QSSGRenderableObjectList &inObjects, QSSGShaderFeatures featureSet)
bool rhiPrepareScreenTexture(QSSGRhiContext *rhiCtx, const QSize &size, bool wantsMips, QSSGRhiRenderableTexture *renderableTex, quint8 viewCount)
QRect correctViewportCoordinates(const QRectF &layerViewport, const QRect &deviceRect)
void addAccumulatorImageBindings(QSSGRhiShaderPipeline *shaderPipeline, QSSGRhiShaderResourceBindingList &bindings)
bool rhiPrepareDepthTexture(QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex, quint8 viewCount, int samples=1)
void rhiRenderMotionVector(QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &state, const QSSGRenderableObjectList *motionVectorPassObjects, int bucketsCount)
void rhiDrawAutoLodInstanced(QSSGRhiContext *rhiCtx, QRhiCommandBuffer *cb, QRhiCommandBuffer::VertexInput *vertexBuffers, int vertexBufferCount, QRhiBuffer *indexBuffer, const QSSGSubsetRenderable &renderable)
Q_AUTOTEST_EXPORT bool rhiPrepareAoTexture(QSSGRhiContext *rhiCtx, const QSize &size, QSSGRhiRenderableTexture *renderableTex, quint8 viewCount)
quint32 rhiCalculateABufferSize(const QSize &size, int levels)
void rhiRenderDepthPass(QSSGRhiContext *rhiCtx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedOpaqueObjects, const QSSGRenderableObjectList &sortedTransparentObjects, bool *needsSetViewport)
void addDebugFrustum(const QSSGBoxPoints &frustumPoints, const QColor &color, QSSGDebugDrawSystem *debugDrawSystem)
void addDebugBox(const QSSGBoxPoints &boxUnsorted, const QColor &color, QSSGDebugDrawSystem *debugDrawSystem)
void addDirectionalLightDebugBox(const QSSGBoxPoints &box, QSSGDebugDrawSystem *debugDrawSystem)
#define M_PI_2
Definition qmath.h:205
#define M_PI
Definition qmath.h:201
QSSGLayerRenderPreparationResultFlag
QVarLengthArray< QSSGShaderLight, 16 > QSSGShaderLightList
static void setupCubeShadowCameras(const QSSGLayerRenderData &inData, const QSSGRenderLight *inLight, float shadowMapFar, QSSGRenderCamera inCameras[6])
static void updateUniformsForDefaultMaterial(QSSGRhiShaderPipeline &shaderPipeline, QSSGRhiContext *rhiCtx, const QSSGLayerRenderData &inData, char *ubufData, QSSGRhiGraphicsPipelineState *ps, QSSGSubsetRenderable &subsetRenderable, const QSSGRenderCameraList &cameras, const QVector2D *depthAdjust, const QMatrix4x4 *alteredModelViewProjection, const QSSGRenderGraphObject *materialOverride=nullptr)
static QSSGRhiShaderPipelinePtr shadersForParticleMaterial(QSSGRhiGraphicsPipelineState *ps, QSSGParticlesRenderable &particleRenderable, const QSSGShaderFeatures &featureSet)
static QSSGRhiShaderPipelinePtr shadersForDefaultMaterial(QSSGRhiGraphicsPipelineState *ps, QSSGSubsetRenderable &subsetRenderable, const QSSGShaderFeatures &featureSet, const QSSGUserShaderAugmentation &shaderAugmentation={})
static std::unique_ptr< QSSGRenderCamera > computeShadowCameraFromFrustum(const QMatrix4x4 &lightMatrix, const QMatrix4x4 &lightMatrixInverted, const QVector3D &lightPivot, const QVector3D &lightForward, const QVector3D &lightUp, const float shadowMapResolution, const float pcfRadius, const QSSGBoxPoints &frustumPoints, float frustumStartT, float frustumEndT, float frustumRadius, bool lockShadowmapTexels, const QSSGBounds3 &castingBox, const QSSGBounds3 &receivingBox, QSSGDebugDrawSystem *debugDrawSystem, const bool drawCascades, const bool drawSceneCascadeIntersection)
static QRhiViewport calculateAtlasViewport(QSize atlasPixelSize, const QSSGShadowMapEntry::AtlasEntry &atlasEntry, bool yIsUp)
static QSSGBoxPoints sliceFrustum(const QSSGBoxPoints &frustumPoints, float t0, float t1)
static void rhiPrepareSkyBox_helper(const QSSGRenderContextInterface &context, QSSGPassKey passKey, QSSGRenderLayer &layer, QSSGRenderCameraList &cameras, QSSGRenderer &renderer, QSSGReflectionMapEntry *entry=nullptr, QSSGRenderTextureCubeFace cubeFace=QSSGRenderTextureCubeFaceNone, uint tonemapMode=0)
static QT_BEGIN_NAMESPACE constexpr float QSSG_PI
static void rhiPrepareResourcesForReflectionMap(const QSSGRenderContextInterface &context, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGReflectionMapEntry *pEntry, QSSGRhiGraphicsPipelineState *ps, const QSSGRenderableObjectList &sortedOpaqueObjects, QSSGRenderCamera &inCamera, QSSGRenderer &renderer, QSSGRenderTextureCubeFace cubeFace)
static void rhiPrepareResourcesForShadowMap(QSSGRhiContext *rhiCtx, const QSSGLayerRenderData &inData, QSSGPassKey passKey, QSSGShadowMapEntry *pEntry, QSSGRhiGraphicsPipelineState *ps, const QVector2D *depthAdjust, const QSSGRenderableObjectList &sortedOpaqueObjects, QSSGRenderCamera &inCamera, bool orthographic, QSSGRenderTextureCubeFace cubeFace, quint32 cascadeIndex)
static void addOpaqueDepthPrePassBindings(QSSGRhiContext *rhiCtx, QSSGRhiShaderPipeline *shaderPipeline, QSSGRenderableImage *renderableImage, QSSGRhiShaderResourceBindingList &bindings, bool isCustomMaterialMeshSubset=false)
static QSSGBoxPoints computeFrustumBounds(const QMatrix4x4 &projection)
static void addNormalTextureBindings(QSSGRhiContext *rhiCtx, QSSGRhiShaderPipeline *shaderPipeline, QSSGRhiShaderResourceBindingList &bindings)
static const QRhiShaderResourceBinding::StageFlags RENDERER_VISIBILITY_ALL
static QRhiShaderResourceBindings * drawCallDataSrb(QSSGRhiContextPrivate *rhiCtxD, QSSGRhiDrawCallData &dcd, const QSSGRhiShaderResourceBindingList &bindings)
static constexpr float QSSG_HALFPI
static int setupInstancing(QSSGSubsetRenderable *renderable, QSSGRhiGraphicsPipelineState *ps, QSSGRhiContext *rhiCtx, const QSSGLayerRenderData &inData, const QVector3D &cameraDirection, const QVector3D &cameraPosition, InstanceLevels instanceLevels, const QSSGRhiShaderPipeline &shaders)
void rhiPrepareRenderableImp(QSSGRhiContext *rhiCtx, QSSGPassKey passKey, const QSSGLayerRenderData &inData, QSSGRenderableObject &inObject, QRhiRenderPassDescriptor *renderPassDescriptor, QSSGRhiGraphicsPipelineState *ps, QSSGShaderFeatures featureSet, int samples, int viewCount, bool screenMapPass, QSSGRenderCamera *alteredCamera, QMatrix4x4 *alteredModelViewProjection, QSSGRenderTextureCubeFace cubeFace, QSSGReflectionMapEntry *entry, bool oit)
static void setupCubeReflectionCameras(const QSSGLayerRenderData &inData, const QSSGRenderReflectionProbe *inProbe, QSSGRenderCamera inCameras[6])
static void fillTargetBlend(QRhiGraphicsPipeline::TargetBlend *targetBlend, QSSGRenderDefaultMaterial::MaterialBlendMode materialBlend)
static void addDepthTextureBindings(QSSGRhiContext *rhiCtx, QSSGRhiShaderPipeline *shaderPipeline, QSSGRhiShaderResourceBindingList &bindings, QBitArray *specifiedBindings=nullptr)
static QVarLengthArray< std::unique_ptr< QSSGRenderCamera >, 4 > setupCascadingCamerasForShadowMap(const QSSGLayerRenderData &data, const QSSGRenderCamera &inCamera, const QSSGRenderLight *inLight, const int shadowMapResolution, const float pcfRadius, const float clipNear, const float clipFar, const QSSGBounds3 &castingObjectsBox, const QSSGBounds3 &receivingObjectsBox, bool lockShadowmapTexels, QSSGDebugDrawSystem *debugDrawSystem, bool drawCascades, bool drawSceneCascadeIntersection)
QVector< QSSGRenderableObjectHandle > renderables
QSSGBakedLightingModel(const QSSGRenderModel *model, const QVector< QSSGRenderableObjectHandle > &renderables)
const QSSGRenderModel * model
QSSGRenderLight::SoftShadowQuality maxSoftShadowQuality
QSSGDefaultMaterialPreparationResult(QSSGShaderDefaultMaterialKey inMaterialKey)
QSSGShaderDefaultMaterialKey materialKey
QRhiReadbackResult * pendingResult
QList< QRhiReadbackResult * > completedResults
QRhiTextureRenderTarget * oitRenderTarget
QRhiResourceUpdateBatch * rub
QRhiRenderPassDescriptor * renderPassDescriptor
QSSGRhiRenderableTextureV2Ptr renderableTexture
std::optional< SkyboxCubeMapPass > skyboxCubeMapPass
std::vector< UserPassData > subPassData
QSSGRhiGraphicsPipelineState ps
QSSGShaderDefineList shaderDefines
QRhiDepthStencilClearValue depthStencilClearValue
QSSGRenderableObjectList renderables
std::optional< SkyboxPass > skyboxPass
QSSGRenderUserPass * passNode
std::optional< Item2DPass > item2DPass