1// Copyright (C) 2023 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
3
4#ifndef QSSGRENDERHELPERS_P_H
5#define QSSGRENDERHELPERS_P_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/private/qtquick3druntimerenderglobal_p.h>
19#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
20
21#include <QtCore/qsize.h>
22
23#include <QtGui/qmatrix4x4.h>
24
25QT_BEGIN_NAMESPACE
26
27class QSSGRhiContext;
28class QSSGFrameData;
29struct QSSGRenderableObject;
30class QRhiRenderPassDescriptor;
31struct QSSGRhiGraphicsPipelineState;
32struct QSSGRenderCamera;
33struct QSSGRenderableNodeEntry;
34
35class QSSGRenderContextInterface;
36struct QSSGModelContext;
37
38
39using QSSGRenderableNodes = QVector<QSSGRenderableNodeEntry>;
40
41class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGModelHelpers
42{
43public:
44 using RenderableFilter = std::function<bool(QSSGModelContext *)>;
45
46 static void ensureMeshes(const QSSGRenderContextInterface &contextInterface,
47 QSSGRenderableNodes &renderableModels);
48
49 static bool createRenderables(QSSGRenderContextInterface &contextInterface,
50 const QSSGRenderableNodes &renderableModels,
51 const QSSGRenderCamera &camera,
52 RenderableFilter filter,
53 float lodThreshold = 0.0f);
54
55
56
57private:
58 QSSGModelHelpers();
59};
60
61class Q_QUICK3DRUNTIMERENDER_EXPORT QSSGRenderHelpers
62{
63public:
64 static void rhiPrepareRenderable(QSSGRhiContext &rhiCtx,
65 QSSGPassKey passKey,
66 const QSSGFrameData &frameData,
67 QSSGRenderableObject &inObject,
68 QRhiRenderPassDescriptor *renderPassDescriptor,
69 QSSGRhiGraphicsPipelineState *ps,
70 int samples);
71
72 static void rhiRenderRenderable(QSSGRhiContext &rhiCtx,
73 const QSSGRhiGraphicsPipelineState &state,
74 QSSGRenderableObject &object,
75 bool *needsSetViewport);
76
77
78private:
79 QSSGRenderHelpers();
80};
81
82QT_END_NAMESPACE
83
84#endif // QSSGRENDERHELPERS_P_H
85

source code of qtquick3d/src/runtimerender/extensionapi/qssgrenderhelpers_p.h