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

source code of qtbase/src/plugins/platforms/xcb/qxcbvulkaninstance.h