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
qssgrenderdefaultmaterialshadergenerator_p.h
Go to the documentation of this file.
1// Copyright (C) 2008-2012 NVIDIA Corporation.
2// Copyright (C) 2019 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
4// Qt-Security score:significant reason:default
5
6
7#ifndef QSSG_RENDER_DEFAULT_MATERIAL_SHADER_GENERATOR_H
8#define QSSG_RENDER_DEFAULT_MATERIAL_SHADER_GENERATOR_H
9
10//
11// W A R N I N G
12// -------------
13//
14// This file is not part of the Qt API. It exists purely as an
15// implementation detail. This header file may change from version to
16// version without notice, or even be removed.
17//
18// We mean it.
19//
20
21#include <QtQuick3DRuntimeRender/private/qssgrendershadercodegenerator_p.h>
22#include <QtQuick3DRuntimeRender/private/qssgrendershadowmap_p.h>
23#include <QtQuick3DRuntimeRender/private/qssgrenderlight_p.h>
24#include <QtQuick3DRuntimeRender/private/qssgrenderableimage_p.h>
25#include <QtQuick3DRuntimeRender/private/qssgrenderableobjects_p.h>
26#include <QtQuick3DRuntimeRender/private/qssgrendershaderkeys_p.h>
27
28QT_BEGIN_NAMESPACE
29
30struct QSSGLayerGlobalRenderProperties;
31struct QSSGMaterialVertexPipeline;
32
33struct Q_QUICK3DRUNTIMERENDER_EXPORT QSSGMaterialShaderGenerator
34{
35 ~QSSGMaterialShaderGenerator() = default;
36
37 static const char* getSamplerName(QSSGRenderableImage::Type type);
38
39 static QSSGRhiShaderPipelinePtr generateMaterialRhiShader(const QByteArray &inShaderKeyPrefix,
40 const QByteArray &inCacheKey,
41 QSSGMaterialVertexPipeline &vertexGenerator,
42 const QSSGShaderDefaultMaterialKey &key,
43 const QSSGShaderDefaultMaterialKeyProperties &inProperties,
44 const QSSGShaderFeatures &inFeatureSet,
45 const QSSGRenderGraphObject &inMaterial,
46 QSSGShaderLibraryManager &shaderLibraryManager,
47 QSSGShaderCache &theCache,
48 const QSSGUserShaderAugmentation &shaderAugmentation = {});
49
50 static void setRhiMaterialProperties(const QSSGRenderContextInterface &,
51 QSSGRhiShaderPipeline &shaders,
52 char *ubufData,
53 QSSGRhiGraphicsPipelineState *inPipelineState,
54 const QSSGRenderGraphObject &inMaterial,
55 const QSSGShaderDefaultMaterialKey &inKey,
56 const QSSGShaderDefaultMaterialKeyProperties &inProperties,
57 const QSSGRenderCameraList &inCameras,
58 const QSSGRenderMvpArray &inModelViewProjections,
59 const QMatrix3x3 &inNormalMatrix,
60 const QMatrix4x4 &inGlobalTransform,
61 const QMatrix4x4 &clipSpaceCorrMatrix,
62 const QMatrix4x4 &localInstanceTransform,
63 const QMatrix4x4 &globalInstanceTransform,
64 const QSSGDataView<float> &inMorphWeights,
65 QSSGRenderableImage *inFirstImage,
66 float inOpacity,
67 const QSSGLayerRenderData &inRenderProperties,
68 const QSSGShaderLightListView &inLights,
69 const QSSGShaderReflectionProbe &reflectionProbe,
70 bool receivesShadows,
71 bool receivesReflections,
72 const QVector2D *shadowDepthAdjust,
73 QRhiTexture *lightmapTexture);
74
75 static const char *directionalLightProcessorArgumentList();
76 static const char *pointLightProcessorArgumentList();
77 static const char *spotLightProcessorArgumentList();
78 static const char *ambientLightProcessorArgumentList();
79 static const char *specularLightProcessorArgumentList();
80 static const char *shadedFragmentMainArgumentList();
81 static const char *postProcessorArgumentList();
82 static const char *iblProbeProcessorArgumentList();
83 static const char *vertexMainArgumentList();
84 static const char *vertexInstancedMainArgumentList();
85
86private:
87 QSSGMaterialShaderGenerator() = delete;
88 Q_DISABLE_COPY(QSSGMaterialShaderGenerator)
89};
90
91namespace QtQuick3DEditorHelpers {
92namespace CustomMaterial {
93// NOTE: Returns a copy of the actual list, cache as needed!
95}
96}
97
98QT_END_NAMESPACE
99#endif
QSSGRhiShaderPipelinePtr debugObjectShader
QSSGRhiGraphicsPipelineState ps
void renderPass(QSSGRenderer &renderer) final
Type passType() const final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
void renderPass(QSSGRenderer &renderer) final
QSSGRhiGraphicsPipelineState ps
QSSGRenderLayer * layer
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGRhiShaderPipelinePtr gridShader
void resetForFrame() final
Type passType() const final
Type passType() const final
std::vector< QSGRenderer * > prepdItem2DRenderers
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
void resetForFrame() final
static constexpr int MaxBuckets
QSSGRhiGraphicsPipelineState ps
QSSGRenderMotionVectorMapPtr motionVectorMapManager
QSSGRenderableObjectList motionVectorPassObjects[MaxBuckets]
Type passType() const final
QSSGRhiRenderableTexture * rhiMotionVectorTexture
QSSGRenderCamera * camera
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
QSSGShaderFeatures shaderFeatures
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QRhiShaderResourceBindings * compositeSrb
QSSGRhiShaderPipelinePtr compositeShaderPipeline
QSSGRenderLayer::OITMethod method
void resetForFrame() final
Type passType() const final
void renderPass(QSSGRenderer &renderer) 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
void resetForFrame() final
QSSGRhiShaderPipelinePtr clearPipeline
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGRhiRenderableTexture * rhiDepthTexture
QSSGRhiGraphicsPipelineState ps
QRhiTexture * readbackImage
bool linkedListRequiresResize(QSize dim)
Type passType() const final
void renderPass(QSSGRenderer &renderer) final
QSSGOITRenderContext * oitRenderContext
QRhiBuffer * rhiCounterBuffer
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
Type passType() const final
void renderPass(QSSGRenderer &renderer) 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 decreaseMemoryStat(QSSGRenderMesh *mesh)
void setRenderContextInterface(QSSGRenderContextInterface *ctx)
QSSGRenderImageTexture loadSkinmap(QSSGRenderTextureData *skin)
void increaseMemoryStat(QSSGRenderMesh *mesh)
static std::unique_ptr< QSSGMeshBVH > loadMeshBVH(const QSSGRenderPath &inSourcePath)
const QHash< ImageCacheKey, ImageData > & getImageMap() const
const QHash< QSGTexture *, ImageData > & getSGImageMap() const
const QHash< CustomImageCacheKey, ImageData > & getCustomTextureMap() const
static QRhiTexture::Format toRhiFormat(const QSSGRenderTextureFormat format)
void registerUserRenderPassManager(const QSSGUserRenderPassManagerPtr &userPassManager)
static std::unique_ptr< QSSGMeshBVH > loadMeshBVH(QSSGRenderGeometry *geometry)
void releaseResourcesForLayer(QSSGRenderLayer *layer)
void cleanupUnreferencedBuffers(quint32 frameId, QSSGRenderLayer *layer)
static QSSGMesh::Mesh loadMeshData(const QSSGRenderPath &inSourcePath)
QSSGMesh::Mesh loadLightmapMesh(const QSSGRenderModel &model)
QSSGMesh::Mesh loadMeshData(const QSSGRenderGeometry *geometry)
QSSGRenderImageTexture loadRenderImage(const QSSGRenderImage *image, MipMode inMipMode=MipModeFollowRenderImage, LoadRenderImageFlags flags=LoadWithFlippedY)
QSSGRenderMesh * loadMesh(const QSSGRenderModel &model)
static void unregisterMeshData(const QString &assetId)
static QString primitivePath(const QString &primitive)
void releaseTextureData(const QSSGRenderTextureData *data)
QSSGRenderMesh * getMeshForPicking(const QSSGRenderModel &model, const QString &lightmap) const
void releaseGeometry(QSSGRenderGeometry *geometry, const QString &lightmapSource=QString())
QSSGRenderImageTexture loadTextureData(QSSGRenderTextureData *data, MipMode inMipMode)
QSSGRenderImageTexture loadLightmap(const QSSGRenderModel &model)
void setLightmapSource(const QString &source)
static void registerMeshData(const QString &assetId, const QVector< QSSGMesh::Mesh > &meshData)
void setCurrentlyLightmapBaking(bool value)
static QString runtimeMeshSourceName(const QString &assetId, qsizetype meshId)
void resetUsageCounters(quint32 frameId, QSSGRenderLayer *layer)
QSSGBounds3 getModelBounds(const QSSGRenderModel *model)
void releaseTextureData(const CustomImageCacheKey &key)
void processResourceLoader(const QSSGRenderResourceLoader *loader)
bool prepareForRender(const QSSGRenderModel &inModel, const QSSGRenderSubset &inSubset, QSSGRenderCustomMaterial &inMaterial)
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)
void drawBounds(const QSSGBounds3 &bounds, const QColor &color, bool isPersistent=false)
InstanceTransforms getInstanceTransforms(QSSGRenderNodeHandle h) const
float getGlobalOpacity(const QSSGRenderNode &node) const
LayerNodeView getLayerNodeView(const QSSGRenderLayer &layer) const
float getGlobalOpacity(QSSGRenderNodeHandle h, float defaultValue=1.0f) const
InstanceTransformStore instanceTransforms
GlobalOpacityStore globalOpacities
QMatrix4x4 getGlobalTransform(QSSGRenderNodeHandle h) const
QMatrix4x4 getGlobalTransform(const QSSGRenderNode &node) const
LayerNodeView getLayerNodeView(QSSGRenderLayerHandle h) const
QMatrix4x4 getGlobalTransform(QSSGRenderNodeHandle h, const QMatrix4x4 &defaultValue) const
VersionType stateGeneration() const
InstanceTransforms getInstanceTransforms(const QSSGRenderNode &node) const
VersionType version() const
GlobalTransformStore globalTransforms
NormalMatrixStore normalMatrices
LayerNodeViewStore layerNodes
QSSGLayerRenderPreparationResult(const QRectF &inViewport, QSSGRenderLayer &inLayer)
const QSSGLayerRenderPreparationResultFlags & getFlags() const
QSSGRenderMvpArray modelViewProjections
const QMatrix4x4 globalTransform
const QMatrix3x3 normalMatrix
QSSGDataRef< QSSGSubsetRenderable > subsets
static GlobalStateResult updateGlobalNodeState(QSSGRenderNode *node, const VersionType version)
updateGlobalNodeState
static bool calcInstanceTransforms(QSSGRenderNode *node, const VersionType version, QSSGGlobalRenderNodeData::GlobalTransformStore &globalTransforms, QSSGGlobalRenderNodeData::InstanceTransformStore &instanceTransforms)
calcInstanceTransforms
void releaseRenderData(const QSSGRenderItem2D &item)
void updateItem2DData(QSSGItem2DsView &items, QSSGRenderer *renderer, const QSSGRenderCameraDataList &renderCameraData)
Item2DRenderer getItem2DRenderer(const QSSGRenderItem2D &item) const
const QSSGGlobalRenderNodeDataPtr & globalNodeData() const
ModelViewProjections getModelViewProjection(const QSSGRenderItem2D &item) const
ModelViewProjections getModelViewProjection(QSSGRenderNodeHandle h) const
ModelViewProjections getModelViewProjection(QSSGRenderNodeHandle h) const
void updateModelData(QSSGModelsView &models, QSSGRenderer *renderer, const QSSGRenderCameraDataList &renderCameraData)
QMatrix3x3 getNormalMatrix(const QSSGRenderModel &model) const
const QSSGGlobalRenderNodeDataPtr & globalNodeData() const
QSSGRenderMesh * getMesh(const QSSGRenderModel &model) const
ModelViewProjections getModelViewProjection(const QSSGRenderModel &model) const
MaterialList getMaterials(const QSSGRenderModel &model) const
QMatrix3x3 getNormalMatrix(QSSGRenderNodeHandle h, QMatrix3x3 defaultValue) const
virtual ~QSSGRenderPass()
virtual void resetForFrame()=0
virtual Type passType() const =0
virtual void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data)=0
virtual void renderPass(QSSGRenderer &renderer)=0
QSSGRenderableObjectFlags renderableFlags
QSSGRenderableObject(Type ty, QSSGRenderableObjectFlags inFlags, const QVector3D &inWorldCenterPt, const QSSGBounds3 &inBounds, float inDepthBias, float inMinThreshold=-1, float inMaxThreshold=-1)
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 renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
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 renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
QSSGRhiShaderPipelinePtr ssaoShaderPipeline
QSSGAmbientOcclusionSettings aoSettings
void renderPass(QSSGRenderer &renderer) final
const QSSGRenderCamera * camera
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
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
void renderPass(QSSGRenderer &renderer) final
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
Type passType() const final
QSSGRenderCamera * camera
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGBounds3 castingObjectsBox
QSSGShaderLightList globalLights
QSSGRenderableObjectList shadowPassObjects
QSSGRhiGraphicsPipelineState ps
QSSGBounds3 receivingObjectsBox
void resetForFrame() final
std::unique_ptr< QSSGRenderCamera > debugCamera
Type passType() const final
void renderPass(QSSGRenderer &renderer) final
std::shared_ptr< QSSGRenderShadowMap > shadowMapManager
QSSGRhiRenderableTexture * offscreenTexture
QRhiShaderResourceBindings * backgroundSrb
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
Type passType() const final
QSSGRhiShaderPipelinePtr pipeline
QSSGRhiGraphicsPipelineState ps
void renderPass(QSSGRenderer &renderer) final
QRhiRenderPassDescriptor * rpDesc
void renderPass(QSSGRenderer &renderer) final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
Type passType() const final
QRhiRenderPassDescriptor * rpDesc
QSSGRenderLayer * layer
void renderPass(QSSGRenderer &renderer) final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
QSSGRhiShaderPipelinePtr skyBoxCubeShader
QSSGRhiGraphicsPipelineState ps
void resetForFrame() final
Type passType() const final
void renderPass(QSSGRenderer &renderer) final
void resetForFrame() final
QRhiRenderPassDescriptor * rpDesc
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
Type passType() const final
QSSGRenderLayer * layer
QSSGRhiGraphicsPipelineState ps
QSSGRenderableObjectList sortedTransparentObjects
static void render(const QSSGRenderContextInterface &ctx, const QSSGRhiGraphicsPipelineState &ps, const QSSGRenderableObjectList &sortedTransparentObjects)
void renderPass(QSSGRenderer &renderer) final
QSSGShaderFeatures shaderFeatures
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
Type passType() const final
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void renderPass(QSSGRenderer &renderer) final
Type passType() const final
QList< QSSGRenderExtension * > extensions
void resetForFrame() final
bool hasData() const
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
void resetForFrame() final
void renderPass(QSSGRenderer &renderer) final
static constexpr size_t MAX_SUBPASS_DEPTH
QList< QSSGRenderUserPass * > userPasses
std::vector< UserPassData > userPassData
void preparePassImpl(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderUserPass *passNode, std::vector< UserPassData > &outData, QSSGRhiRenderableTextureV2Ptr renderableTexture)
Type passType() const final
void prepareSubPass(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderUserPass *subPassNode, std::vector< UserPassData > &subPassData, const QSSGRhiRenderableTextureV2Ptr &renderableTexture)
void prepareTopLevelPass(QSSGRenderer &renderer, QSSGLayerRenderData &data, QSSGRenderUserPass *passNode)
std::set< QSSGResourceId > visitedPasses
void resetForFrame() final
void renderPass(QSSGRenderer &renderer) final
QSSGRenderableObjectList renderedOpaqueDepthPrepassObjects
Type passType() const final
QSSGRhiGraphicsPipelineState ps
void renderPrep(QSSGRenderer &renderer, QSSGLayerRenderData &data) final
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)
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 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)
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)
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
Q_DECLARE_TYPEINFO(QSSGRenderableObjectHandle, Q_PRIMITIVE_TYPE)
QSSGRenderableObjectFlag
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
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 int setupInstancing(QSSGSubsetRenderable *renderable, QSSGRhiGraphicsPipelineState *ps, QSSGRhiContext *rhiCtx, const QVector3D &cameraDirection, const QVector3D &cameraPosition)
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)
QSqlQueryModel * model
[16]
QVector< QSSGRenderableObjectHandle > renderables
QSSGBakedLightingModel(const QSSGRenderModel *model, const QVector< QSSGRenderableObjectHandle > &renderables)
const QSSGRenderModel * model
QHash< QSSGRenderLayer *, uint32_t > usageCounts
QHash< QSSGRenderLayer *, uint32_t > usageCounts
QSSGDefaultMaterialPreparationResult(QSSGShaderDefaultMaterialKey inMaterialKey)
QSSGShaderDefaultMaterialKey materialKey
bool isCompatible(const QSSGMeshProcessingOptions &other) const
QRhiReadbackResult * pendingResult
QList< QRhiReadbackResult * > completedResults
QRhiTextureRenderTarget * oitRenderTarget
QRhiResourceUpdateBatch * rub
QRhiRenderPassDescriptor * renderPassDescriptor
std::optional< QSSGClippingFrustum > clippingFrustum
QSSGShaderLightListView lights
QSSGRenderableNodeEntry()=default
void setRendersWithLightmap(bool inRendersWithLightmap)
void setCompletelyTransparent(bool inTransparent)
void setCastsReflections(bool inCastsReflections)
void setCastsShadows(bool inCastsShadows)
void setReceivesReflections(bool inReceivesReflections)
void setUsedInBakedLighting(bool inUsedInBakedLighting)
void setHasTransparency(bool inHasTransparency)
void setReceivesShadows(bool inReceivesShadows)
QSSGRenderableObjectHandle(QSSGRenderableObject *o, float camDistSq, QSSGRenderNodeTag tag)
QSSGRenderableObjectHandle()=default
bool operator<(const QSSGShaderLight &o) const
QSSGRenderLight * light
QSSGRhiRenderableTextureV2Ptr renderableTexture
std::optional< SkyboxCubeMapPass > skyboxCubeMapPass
std::vector< UserPassData > subPassData
QSSGRhiGraphicsPipelineState ps
QSSGShaderDefineList shaderDefines
QRhiDepthStencilClearValue depthStencilClearValue
QSSGRenderableObjectList renderables
std::optional< SkyboxPass > skyboxPass
std::optional< Item2DPass > item2DPass