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
qplatformvulkaninstance.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QPLATFORMVULKANINSTANCE_H
6#define QPLATFORMVULKANINSTANCE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is part of the QPA API and is not meant to be used
13// in applications. Usage of this API may make your code
14// source and binary incompatible with future versions of Qt.
15//
16
17#include <QtGui/qtguiglobal.h>
18
19#if QT_CONFIG(vulkan) || defined(Q_QDOC)
20
21#include <qvulkaninstance.h>
22
23QT_BEGIN_NAMESPACE
24
25class QPlatformVulkanInstancePrivate;
26
27class Q_GUI_EXPORT QPlatformVulkanInstance
28{
29 Q_DECLARE_PRIVATE(QPlatformVulkanInstance)
30
31public:
32 QPlatformVulkanInstance();
33 virtual ~QPlatformVulkanInstance();
34
35 virtual QVulkanInfoVector<QVulkanLayer> supportedLayers() const = 0;
36 virtual QVulkanInfoVector<QVulkanExtension> supportedExtensions() const = 0;
37 virtual QVersionNumber supportedApiVersion() const = 0;
38 virtual void createOrAdoptInstance() = 0;
39 virtual bool isValid() const = 0;
40 virtual VkResult errorCode() const = 0;
41 virtual VkInstance vkInstance() const = 0;
42 virtual QByteArrayList enabledLayers() const = 0;
43 virtual QByteArrayList enabledExtensions() const = 0;
44 virtual PFN_vkVoidFunction getInstanceProcAddr(const char *name) = 0;
45 virtual bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) = 0;
46 virtual void presentAboutToBeQueued(QWindow *window);
47 virtual void presentQueued(QWindow *window);
48 virtual void setDebugFilters(const QList<QVulkanInstance::DebugFilter> &filters);
49 virtual void setDebugUtilsFilters(const QList<QVulkanInstance::DebugUtilsFilter> &filters);
50 virtual void beginFrame(QWindow *window);
51 virtual void endFrame(QWindow *window);
52
53private:
54 QScopedPointer<QPlatformVulkanInstancePrivate> d_ptr;
55 Q_DISABLE_COPY(QPlatformVulkanInstance)
56};
57
58QT_END_NAMESPACE
59
60#endif // QT_CONFIG(vulkan)
61
62#if defined(Q_QDOC)
63/*
64 The following include file did not exist for clang-qdoc running
65 in macOS, but the classes are documented in qvulkanfunctions.cpp.
66 clang-qdoc must parse the class declarations in an include file,
67 or else it can't find a place to put the documentation for the
68 classes. Apparently these classes are created at build time if
69 Vulkan is present.
70 */
71#ifndef QVULKANFUNCTIONS_H
72#define QVULKANFUNCTIONS_H
73
74#include <QtGui/qtguiglobal.h>
75
76#if QT_CONFIG(vulkan) || defined(Q_QDOC)
77
78#ifndef VK_NO_PROTOTYPES
79#define VK_NO_PROTOTYPES
80#endif
81#include <vulkan/vulkan.h>
82
83#include <QtCore/qscopedpointer.h>
84
85QT_BEGIN_NAMESPACE
86
87class QVulkanInstance;
88class QVulkanFunctionsPrivate;
89class QVulkanDeviceFunctionsPrivate;
90
91class Q_GUI_EXPORT QVulkanFunctions
92{
93public:
94 ~QVulkanFunctions();
95
96private:
97 Q_DISABLE_COPY(QVulkanFunctions)
98 QVulkanFunctions(QVulkanInstance *inst);
99
100 QScopedPointer<QVulkanFunctionsPrivate> d_ptr;
101 friend class QVulkanInstance;
102};
103
104class Q_GUI_EXPORT QVulkanDeviceFunctions
105{
106public:
107 ~QVulkanDeviceFunctions();
108
109private:
110 Q_DISABLE_COPY(QVulkanDeviceFunctions)
111 QVulkanDeviceFunctions(QVulkanInstance *inst, VkDevice device);
112
113 QScopedPointer<QVulkanDeviceFunctionsPrivate> d_ptr;
114 friend class QVulkanInstance;
115};
116
117QT_END_NAMESPACE
118
119#endif // QT_CONFIG(vulkan) || defined(Q_QDOC)
120#endif // QVULKANFUNCTIONS_H;
121#endif // Q_QDOC
122
123#endif // QPLATFORMVULKANINSTANCE_H