1 | // Copyright (C) 2019 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 QWAYLANDVULKANINSTANCE_P_H |
5 | #define QWAYLANDVULKANINSTANCE_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_WAYLAND_KHR) |
19 | #error "vulkan.h included without Wayland WSI" |
20 | #endif |
21 | |
22 | #define VK_USE_PLATFORM_WAYLAND_KHR |
23 | |
24 | #include <QtGui/private/qbasicvulkanplatforminstance_p.h> |
25 | #include <QLibrary> |
26 | |
27 | QT_BEGIN_NAMESPACE |
28 | |
29 | namespace QtWaylandClient { |
30 | |
31 | class QWaylandWindow; |
32 | |
33 | class QWaylandVulkanInstance : public QBasicPlatformVulkanInstance |
34 | { |
35 | public: |
36 | explicit QWaylandVulkanInstance(QVulkanInstance *instance); |
37 | ~QWaylandVulkanInstance() override; |
38 | |
39 | void createOrAdoptInstance() override; |
40 | bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; |
41 | void presentAboutToBeQueued(QWindow *window) override; |
42 | |
43 | VkSurfaceKHR createSurface(QWaylandWindow *window); |
44 | |
45 | void beginFrame(QWindow *window) override; |
46 | void endFrame(QWindow *window) override; |
47 | |
48 | private: |
49 | QVulkanInstance *m_instance = nullptr; |
50 | PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR m_getPhysDevPresSupport = nullptr; |
51 | PFN_vkCreateWaylandSurfaceKHR m_createSurface = nullptr; |
52 | int mFrameCallbackTimeout = 100; |
53 | }; |
54 | |
55 | } // namespace QtWaylandClient |
56 | |
57 | QT_END_NAMESPACE |
58 | |
59 | #endif // QWAYLANDVULKANINSTANCE_P_H |
60 | |