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
qssgrhiparticles_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_RHI_PARTICLES_H
7#define QSSG_RHI_PARTICLES_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/qtquick3druntimerenderglobal.h>
21#include <QtQuick3DRuntimeRender/private/qssgrenderableobjects_p.h>
22#include <QtQuick3DRuntimeRender/private/qssgrenderparticles_p.h>
23#include <QtGui/QMatrix4x4>
24#include <QtGui/QMatrix3x3>
25
26QT_BEGIN_NAMESPACE
27
28class QSSGLayerRenderData;
29struct QSSGRenderableImage;
30struct QSSGRenderLayer;
31struct QSSGRenderLight;
32class QSSGRenderCamera;
34class QRhiTexture;
35
36class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGParticleRenderer
37{
38public:
39 static void updateUniformsForParticles(const QSSGLayerRenderData &inData, QSSGRhiShaderPipeline &shaderPipeline,
40 QSSGRhiContext *rhiCtx,
41 char *ubufData,
42 QSSGParticlesRenderable &renderable,
43 const QSSGRenderCameraList &cameras);
44 static void updateUniformsForParticleModel(QSSGRhiShaderPipeline &shaderPipeline,
45 char *ubufData,
46 const QSSGRenderModel *model, quint32 offset);
47
48 static QSSGRhiShaderPipelinePtr getShaderPipelineParticles(QSSGRenderer &renderer,
49 QSSGParticlesRenderable &inRenderable,
50 const QSSGShaderFeatures &inFeatureSet);
51
52 static QSSGRhiShaderPipelinePtr generateRhiShaderPipeline(QSSGRenderer &renderer,
53 QSSGParticlesRenderable &inRenderable,
54 const QSSGShaderFeatures &inFeatureSet,
55 QByteArray &shaderString,
56 const QSSGShaderParticleMaterialKeyProperties &shaderKeyProperties);
57
58 static void rhiPrepareRenderable(QSSGRhiShaderPipeline &shaderPipeline, QSSGPassKey passKey,
59 QSSGRhiContext *rhiCtx,
60 QSSGRhiGraphicsPipelineState *ps,
61 QSSGParticlesRenderable &renderable,
62 const QSSGLayerRenderData &inData,
63 QRhiRenderPassDescriptor *renderPassDescriptor,
64 int samples,
65 int viewCount,
66 QSSGRenderCamera *alteredCamera = nullptr,
67 QSSGRenderTextureCubeFace cubeFace = QSSGRenderTextureCubeFaceNone,
68 QSSGReflectionMapEntry *entry = nullptr,
69 bool oit = false);
70 static void rhiRenderRenderable(QSSGRhiContext *rhiCtx,
71 QSSGParticlesRenderable &renderable,
72 bool *needsSetViewport,
73 QSSGRenderTextureCubeFace cubeFace,
74 const QSSGRhiGraphicsPipelineState &state);
75 static void prepareParticlesForModel(QSSGRhiShaderPipeline &shaderPipeline,
76 QSSGRhiContext *rhiCtx,
77 QSSGRhiShaderResourceBindingList &bindings,
78 const QSSGRenderModel *model);
79 static QSSGShaderFeatures particleShaderFeatures(const QSSGShaderFeatures& features);
80 static void setShaderCacheEnabled(bool enabled);
81};
82
83QT_END_NAMESPACE
84
85#endif
\keyword 16-bit Floating Point Support\inmodule QtCore \inheaderfile QFloat16
Definition qfloat16.h:56
Combined button and popup list for selecting options.
Q_CORE_EXPORT void qFloatToFloat16(qfloat16 *, const float *, qsizetype length) noexcept
#define QSSGRHICTX_STAT(ctx, f)
#define QSSG_MAX_NUM_LIGHTS
static QByteArray particlesLogPrefix()
static const char * s_lightPrefix
static QByteArray convertParticleData(QByteArray &dest, const QByteArray &data, bool convert)
static void fillTargetBlend(QRhiGraphicsPipeline::TargetBlend &targetBlend, QSSGRenderParticles::BlendMode mode)
static bool s_shaderCacheEnabled
static void sortParticles(const QSSGLayerRenderData &renderData, QByteArray &result, QList< QSSGRhiSortData > &sortData, const QSSGParticleBuffer &buffer, const QSSGRenderParticles &particles, const QVector3D &cameraDirection, bool animatedParticles)
static QT_BEGIN_NAMESPACE const QRhiShaderResourceBinding::StageFlags VISIBILITY_ALL
#define COPY_FEATURE(f)
AutoFormatGenerator(QSSGStageGeneratorBase &g)
QSSGStageGeneratorBase & gen
QVector4D spotLightPos[4]
QVector4D spotLightColor[4]
QVector4D pointLightColor[4]
QVector4D pointLightPos[4]
QVector4D spotLightDir[4]
void addUniformArray(const QByteArray &name, const QByteArray &type, quint32 size)
void addInterpolant(const QByteArray &name, const QByteArray &type)
ShaderGeneratorCommon(QSSGProgramGenerator &gen)
void addUniform(const QByteArray &name, const QByteArray &type)
void addFlatInterpolant(const QByteArray &name, const QByteArray &type)
QSSGStageGeneratorBase * vs
QSSGStageGeneratorBase * fs
void addPrefix(const QByteArray &prefix)
void addDefinition(const QByteArray &name, const QByteArray &value)