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 | |
4 | #pragma once |
5 | |
6 | #if defined(VULKAN_H_) && !defined(VK_USE_PLATFORM_XCB_KHR) |
7 | #error "vulkan.h included without xcb WSI" |
8 | #endif |
9 | |
10 | #define VK_USE_PLATFORM_XCB_KHR |
11 | |
12 | #include <QtGui/private/qbasicvulkanplatforminstance_p.h> |
13 | #include <QLibrary> |
14 | |
15 | QT_BEGIN_NAMESPACE |
16 | |
17 | class QXcbWindow; |
18 | |
19 | class QXcbVulkanInstance : public QBasicPlatformVulkanInstance |
20 | { |
21 | public: |
22 | QXcbVulkanInstance(QVulkanInstance *instance); |
23 | ~QXcbVulkanInstance(); |
24 | |
25 | void createOrAdoptInstance() override; |
26 | bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override; |
27 | void presentQueued(QWindow *window) override; |
28 | |
29 | VkSurfaceKHR createSurface(QXcbWindow *window); |
30 | |
31 | private: |
32 | QVulkanInstance *m_instance; |
33 | PFN_vkGetPhysicalDeviceXcbPresentationSupportKHR m_getPhysDevPresSupport; |
34 | PFN_vkCreateXcbSurfaceKHR m_createSurface; |
35 | }; |
36 | |
37 | QT_END_NAMESPACE |
38 |