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
qssgrendermesh_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
5#ifndef QSSG_RENDER_MESH_H
6#define QSSG_RENDER_MESH_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
20
21#include <QtQuick3DUtils/private/qssgbounds3_p.h>
22#include <QtQuick3DUtils/private/qssgmeshbvh_p.h>
23
25
27{
30 QSSGBounds3 bounds; // Vertex buffer bounds
32 struct {
37 } rhi;
38
39 struct Lod {
42 float distance = 0.0f;
43 };
45
46 QSSGRenderSubset() = default;
57 {
58 if (this != &inOther) {
59 count = inOther.count;
60 offset = inOther.offset;
61 bounds = inOther.bounds;
62 bvhRoot = inOther.bvhRoot;
63 rhi = inOther.rhi;
64 lods = inOther.lods;
65 }
66 return *this;
67 }
68
69 quint32 lodCount(int lodLevel) const {
70 if (lodLevel == 0 || lods.isEmpty())
71 return count;
72 if (lodLevel > lods.count())
73 lodLevel = lods.count() - 1;
74 else
75 lodLevel -= 1;
76
77 return lods[lodLevel].count;
78 }
79
80 quint32 lodOffset(int lodLevel) const {
81 if (lodLevel == 0 || lods.isEmpty())
82 return offset;
83 if (lodLevel > lods.count())
84 lodLevel = lods.count() - 1;
85 else
86 lodLevel -= 1;
87
88 return lods[lodLevel].offset;
89 }
90
91};
92
108QT_END_NAMESPACE
109
110#endif
QSSGRenderMesh(QSSGRenderDrawMode inDrawMode, QSSGRenderWinding inWinding)
std::unique_ptr< QSSGMeshBVH > bvh
QSSGRenderDrawMode drawMode
QSSGRenderWinding winding
QSSGRhiBufferPtr indexBuffer
QSSGRhiInputAssemblerState ia
quint32 lodOffset(int lodLevel) const
QSSGMeshBVHNode::Handle bvhRoot
quint32 lodCount(int lodLevel) const
QVector< Lod > lods
QSSGRenderSubset & operator=(const QSSGRenderSubset &inOther)
QRhiTexture * targetsTexture
QSSGRhiBufferPtr vertexBuffer
QSSGRenderSubset(const QSSGRenderSubset &inOther)
QSSGRenderSubset()=default