1 | // Copyright (C) 2022 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 | |
4 | #ifndef QVULKANINSTANCE_P_H |
5 | #define QVULKANINSTANCE_P_H |
6 | |
7 | #include <QtGui/private/qtguiglobal_p.h> |
8 | |
9 | #if QT_CONFIG(vulkan) || defined(Q_QDOC) |
10 | |
11 | #include "qvulkaninstance.h" |
12 | #include <private/qvulkanfunctions_p.h> |
13 | #include <QtCore/QHash> |
14 | |
15 | // |
16 | // W A R N I N G |
17 | // ------------- |
18 | // |
19 | // This file is not part of the Qt API. It exists for the convenience |
20 | // of a number of Qt sources files. This header file may change from |
21 | // version to version without notice, or even be removed. |
22 | // |
23 | // We mean it. |
24 | // |
25 | |
26 | QT_BEGIN_NAMESPACE |
27 | |
28 | class Q_GUI_EXPORT QVulkanInstancePrivate |
29 | { |
30 | public: |
31 | QVulkanInstancePrivate(QVulkanInstance *q) |
32 | : q_ptr(q), |
33 | vkInst(VK_NULL_HANDLE), |
34 | errorCode(VK_SUCCESS) |
35 | { } |
36 | ~QVulkanInstancePrivate() { reset(); } |
37 | static QVulkanInstancePrivate *get(QVulkanInstance *q) { return q->d_ptr.data(); } |
38 | |
39 | bool ensureVulkan(); |
40 | void reset(); |
41 | |
42 | QVulkanInstance *q_ptr; |
43 | QScopedPointer<QPlatformVulkanInstance> platformInst; |
44 | VkInstance vkInst; |
45 | QVulkanInstance::Flags flags; |
46 | QByteArrayList layers; |
47 | QByteArrayList extensions; |
48 | QVersionNumber apiVersion; |
49 | VkResult errorCode; |
50 | QScopedPointer<QVulkanFunctions> funcs; |
51 | QHash<VkDevice, QVulkanDeviceFunctions *> deviceFuncs; |
52 | QList<QVulkanInstance::DebugFilter> debugFilters; // legacy filters based on VK_EXT_debug_report |
53 | QList<QVulkanInstance::DebugUtilsFilter> debugUtilsFilters; // the modern version based on VK_EXT_debug_utils |
54 | }; |
55 | |
56 | QT_END_NAMESPACE |
57 | |
58 | #endif // QT_CONFIG(vulkan) |
59 | |
60 | #endif // QVULKANINSTANCE_P_H |
61 |