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
qcocoavulkaninstance.h
Go to the documentation of this file.
1// Copyright (C) 2018 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 QCOCOAVULKANINSTANCE_H
6#define QCOCOAVULKANINSTANCE_H
7
8// Include mvk_vulkan.h first. The order is important since
9// mvk_vulkan.h just defines VK_USE_PLATFORM_MACOS_MVK (or the IOS
10// variant) and includes vulkan.h. If something else included vulkan.h
11// before this then we wouldn't get the MVK specifics...
12#include <MoltenVK/mvk_vulkan.h>
13
14#include <QtCore/QHash>
15#include <QtGui/private/qbasicvulkanplatforminstance_p.h>
16
17QT_BEGIN_NAMESPACE
18
19class QCocoaVulkanInstance : public QBasicPlatformVulkanInstance
20{
21public:
22 QCocoaVulkanInstance(QVulkanInstance *instance);
23 ~QCocoaVulkanInstance();
24
25 void createOrAdoptInstance() override;
26
27 VkSurfaceKHR *surface(QWindow *window);
28
29private:
30 VkSurfaceKHR createSurface(CALayer *layer);
31
32 QVulkanInstance *m_instance = nullptr;
33 QLibrary m_lib;
34 VkSurfaceKHR m_nullSurface = nullptr;
35 PFN_vkCreateMacOSSurfaceMVK m_createSurface = nullptr;
36 PFN_vkCreateMetalSurfaceEXT m_createMetalSurface = nullptr;
37};
38
39QT_END_NAMESPACE
40
41#endif // QXCBVULKANINSTANCE_H