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
qssgrendererutil_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_RENDERER_UTIL_H
6
#
define
QSSG_RENDERER_UTIL_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
<
QtQuick3DUtils
/
private
/
qssgrenderbasetypes_p
.
h
>
20
21
QT_BEGIN_NAMESPACE
22
23
namespace
QSSGRendererUtil
24
{
25
inline
constexpr
quint32
nextMultipleOf4
(quint32 value) {
26
return
(value + 3) & ~3;
27
}
28
}
29
30
class
QSSGRenderPath
31
{
32
public
:
33
QSSGRenderPath
() =
default
;
34
explicit
inline
QSSGRenderPath
(
const
QString &p,
const
QString &lightmapKey = {})
noexcept
35
:
m_path
(
p
),
m_lightmapKey
(
lightmapKey
),
m_key
(
qHash
(
p
+
lightmapKey
,
QHashSeed
::
globalSeed
()))
36
{
37
}
38
39
inline
bool
isNull
()
const
{
return
m_path.isNull(); }
40
inline
bool
isEmpty
()
const
{
return
m_path.isEmpty(); }
41
QString
path
()
const
{
return
m_path; }
42
private
:
43
friend
bool
operator
==(
const
QSSGRenderPath
&,
const
QSSGRenderPath
&);
44
friend
size_t
qHash
(
const
QSSGRenderPath
&,
size_t
)
Q_DECL_NOTHROW
;
45
QString m_path;
46
QString m_lightmapKey;
47
size_t m_key = 0;
48
};
49
50
inline
bool
operator
==(
const
QSSGRenderPath
&p1,
const
QSSGRenderPath
&p2)
51
{
52
return
(p1.m_key == p2.m_key) && (p1.m_path == p2.m_path) && (p1.m_lightmapKey == p2.m_lightmapKey);
53
}
54
55
inline
size_t qHash(
const
QSSGRenderPath &path, size_t seed) Q_DECL_NOTHROW
56
{
57
return
(path.m_key) ? path.m_key : qHash(path.m_path + path.m_lightmapKey, seed);
58
}
59
60
QT_END_NAMESPACE
61
62
#
endif
QSSGRenderPath
Definition
qssgrendererutil_p.h:31
QSSGRenderPath::QSSGRenderPath
QSSGRenderPath()=default
QSSGRenderPath::qHash
friend size_t qHash(const QSSGRenderPath &, size_t) Q_DECL_NOTHROW
Definition
qssgrendererutil_p.h:55
QSSGRenderPath::path
QString path() const
Definition
qssgrendererutil_p.h:41
QSSGRenderPath::QSSGRenderPath
QSSGRenderPath(const QString &p, const QString &lightmapKey={}) noexcept
Definition
qssgrendererutil_p.h:34
QSSGRenderPath::operator==
friend bool operator==(const QSSGRenderPath &, const QSSGRenderPath &)
Definition
qssgrendererutil_p.h:50
QSSGRenderPath::isEmpty
bool isEmpty() const
Definition
qssgrendererutil_p.h:40
QSSGRenderPath::isNull
bool isNull() const
Definition
qssgrendererutil_p.h:39
QSSGRendererUtil
Definition
qssgrendererutil_p.h:24
QSSGRendererUtil::nextMultipleOf4
constexpr quint32 nextMultipleOf4(quint32 value)
Definition
qssgrendererutil_p.h:25
qtquick3d
src
runtimerender
qssgrendererutil_p.h
Generated on
for Qt by
1.14.0