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
qquickgraphicsdevice_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#ifndef QQUICKGRAPHICSDEVICE_P_H
6#define QQUICKGRAPHICSDEVICE_P_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 <QtQuick/private/qtquickglobal_p.h>
20#include <QAtomicInt>
22
24
25class Q_QUICK_EXPORT QQuickGraphicsDevicePrivate
26{
27public:
28 static QQuickGraphicsDevicePrivate *get(QQuickGraphicsDevice *p) { return p->d; }
29 static const QQuickGraphicsDevicePrivate *get(const QQuickGraphicsDevice *p) { return p->d; }
30 QQuickGraphicsDevicePrivate();
31 QQuickGraphicsDevicePrivate(const QQuickGraphicsDevicePrivate &other);
32
33 enum class Type {
34 Null,
35 OpenGLContext,
36 Adapter,
37 DeviceAndContext,
38 DeviceAndCommandQueue,
39 PhysicalDevice,
40 DeviceObjects,
41 Rhi,
42 RhiAdapter
43 };
44
45 QAtomicInt ref;
46 Type type = Type::Null;
47
48 struct Adapter {
49 quint32 luidLow;
50 qint32 luidHigh;
51 int featureLevel;
52 };
53
54 struct DeviceAndContext {
55 void *device;
56 void *context;
57 };
58
59 struct DeviceAndCommandQueue {
60 void *device;
61 void *cmdQueue;
62 };
63
64 struct PhysicalDevice {
65 void *physicalDevice;
66 };
67
68 struct DeviceObjects {
69 void *physicalDevice;
70 void *device;
71 int queueFamilyIndex;
72 int queueIndex;
73 };
74
75 union {
76 QOpenGLContext *context;
77 Adapter adapter;
78 DeviceAndContext deviceAndContext;
79 DeviceAndCommandQueue deviceAndCommandQueue;
80 PhysicalDevice physicalDevice;
81 DeviceObjects deviceObjects;
82 QRhi *rhi;
83 QRhiAdapter *rhiAdapter;
84 } u;
85};
86
87QT_END_NAMESPACE
88
89#endif // QQUICKGRAPHICSDEVICE_P_H