| 1 | // Copyright (C) 2021 The Qt Company Ltd. |
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only |
| 3 | |
| 4 | #ifndef QSSG_RHI_PARTICLES_H |
| 5 | #define QSSG_RHI_PARTICLES_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 <QtQuick3DRuntimeRender/qtquick3druntimerenderglobal.h> |
| 19 | #include <QtQuick3DRuntimeRender/private/qssgrenderableobjects_p.h> |
| 20 | #include <QtQuick3DRuntimeRender/private/qssgrenderparticles_p.h> |
| 21 | #include <QtGui/QMatrix4x4> |
| 22 | #include <QtGui/QMatrix3x3> |
| 23 | |
| 24 | QT_BEGIN_NAMESPACE |
| 25 | |
| 26 | class QSSGLayerRenderData; |
| 27 | struct QSSGRenderableImage; |
| 28 | struct QSSGRenderLayer; |
| 29 | struct QSSGRenderLight; |
| 30 | struct QSSGRenderCamera; |
| 31 | struct QSSGReflectionMapEntry; |
| 32 | class QRhiTexture; |
| 33 | |
| 34 | class QSSGParticleRenderer |
| 35 | { |
| 36 | public: |
| 37 | static void updateUniformsForParticles(QSSGRhiShaderPipeline &shaderPipeline, |
| 38 | QSSGRhiContext *rhiCtx, |
| 39 | char *ubufData, |
| 40 | QSSGParticlesRenderable &renderable, |
| 41 | const QSSGRenderCameraList &cameras); |
| 42 | static void updateUniformsForParticleModel(QSSGRhiShaderPipeline &shaderPipeline, |
| 43 | char *ubufData, |
| 44 | const QSSGRenderModel *model, quint32 offset); |
| 45 | |
| 46 | static void rhiPrepareRenderable(QSSGRhiShaderPipeline &shaderPipeline, QSSGPassKey passKey, |
| 47 | QSSGRhiContext *rhiCtx, |
| 48 | QSSGRhiGraphicsPipelineState *ps, |
| 49 | QSSGParticlesRenderable &renderable, |
| 50 | const QSSGLayerRenderData &inData, |
| 51 | QRhiRenderPassDescriptor *renderPassDescriptor, |
| 52 | int samples, |
| 53 | int viewCount, |
| 54 | QSSGRenderCamera *alteredCamera = nullptr, |
| 55 | QSSGRenderTextureCubeFace cubeFace = QSSGRenderTextureCubeFaceNone, |
| 56 | QSSGReflectionMapEntry *entry = nullptr); |
| 57 | static void rhiRenderRenderable(QSSGRhiContext *rhiCtx, |
| 58 | QSSGParticlesRenderable &renderable, |
| 59 | bool *needsSetViewport, |
| 60 | QSSGRenderTextureCubeFace cubeFace, |
| 61 | const QSSGRhiGraphicsPipelineState &state); |
| 62 | static void prepareParticlesForModel(QSSGRhiShaderPipeline &shaderPipeline, |
| 63 | QSSGRhiContext *rhiCtx, |
| 64 | QSSGRhiShaderResourceBindingList &bindings, |
| 65 | const QSSGRenderModel *model); |
| 66 | }; |
| 67 | |
| 68 | QT_END_NAMESPACE |
| 69 | |
| 70 | #endif |
| 71 | |