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
qvkkhrdisplayvulkaninstance.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QVKKHRDISPLAYVULKANINSTANCE_H
6#define QVKKHRDISPLAYVULKANINSTANCE_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtGui/private/qbasicvulkanplatforminstance_p.h>
20#include <QtCore/qsize.h>
21#include <QtCore/qstring.h>
22#include <QtCore/qloggingcategory.h>
23
24#include <climits> // For UINT_MAX
25
27
29
31{
32public:
33 QVkKhrDisplayVulkanInstance(QVulkanInstance *instance);
34
36 bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override;
37 void presentAboutToBeQueued(QWindow *window) override;
38
39 VkSurfaceKHR createSurface(QWindow *window);
40
41 QSize displaySize() const { return QSize(int(m_width), int(m_height)); }
42 QString displayName() const { return m_displayName; }
43 QSizeF physicalSize() const { return m_physicalSize; }
44
45 using CreatedCallback = void (*)(QVkKhrDisplayVulkanInstance *, void *);
46 void setCreatedCallback(CreatedCallback callback, void *userData) {
47 m_createdCallback = callback;
48 m_createdCallbackUserData = userData;
49 }
50
51private:
52 bool chooseDisplay();
53
54 QVulkanInstance *m_instance;
55 VkPhysicalDevice m_physDev = VK_NULL_HANDLE;
56 PFN_vkEnumeratePhysicalDevices m_enumeratePhysicalDevices = nullptr;
57 PFN_vkGetPhysicalDeviceSurfaceSupportKHR m_getPhysicalDeviceSurfaceSupportKHR = nullptr;
58#if VK_KHR_display
65#endif
66
67 CreatedCallback m_createdCallback = nullptr;
68 void *m_createdCallbackUserData = nullptr;
69 VkDisplayKHR m_display = VK_NULL_HANDLE;
70 VkDisplayModeKHR m_displayMode = VK_NULL_HANDLE;
71 uint32_t m_width = 0;
72 uint32_t m_height = 0;
73 QString m_displayName;
74 QSizeF m_physicalSize;
75 uint32_t m_planeIndex = UINT_MAX;
76 uint32_t m_planeStackIndex = UINT_MAX;
77};
78
79QT_END_NAMESPACE
80
81#endif
void flush(QWindow *window, const QRegion &region, const QPoint &offset) override
Flushes the given region from the specified window.
QPaintDevice * paintDevice() override
Implement this function to return the appropriate paint device.
void resize(const QSize &size, const QRegion &staticContents) override
bool hasCapability(QPlatformIntegration::Capability cap) const override
QPlatformBackingStore * createPlatformBackingStore(QWindow *window) const override
Factory function for QPlatformBackingStore.
QPlatformTheme * createPlatformTheme(const QString &name) const override
QVkKhrDisplayIntegration(const QStringList &parameters)
QPlatformVulkanInstance * createPlatformVulkanInstance(QVulkanInstance *instance) const override
QPlatformServices * services() const override
QPlatformInputContext * inputContext() const override
Returns the platforms input context.
QPlatformNativeInterface * nativeInterface() const override
QPlatformFontDatabase * fontDatabase() const override
Accessor for the platform integration's fontdatabase.
QAbstractEventDispatcher * createEventDispatcher() const override
Factory function for the GUI event dispatcher.
void initialize() override
Performs initialization steps that depend on having an event dispatcher available.
void * nativeResourceForWindow(const QByteArray &resource, QWindow *window) override
QPlatformWindow * createPlatformWindow(QWindow *window) const override
Factory function for QPlatformWindow.
QRect geometry() const override
Reimplement in subclass to return the pixel geometry of the screen.
QImage::Format format() const override
Reimplement in subclass to return the image format which corresponds to the screen format.
void setVk(QVkKhrDisplayVulkanInstance *inst)
int depth() const override
Reimplement in subclass to return current depth of the screen.
QSizeF physicalSize() const override
Reimplement this function in subclass to return the physical size of the screen, in millimeters.
QString name() const override
VkSurfaceKHR createSurface(QWindow *window)
bool supportsPresent(VkPhysicalDevice physicalDevice, uint32_t queueFamilyIndex, QWindow *window) override
void presentAboutToBeQueued(QWindow *window) override
QVkKhrDisplayVulkanInstance(QVulkanInstance *instance)
void setCreatedCallback(CreatedCallback callback, void *userData)
void(*)(QVkKhrDisplayVulkanInstance *, void *) CreatedCallback
void setGeometry(const QRect &r) override
This function is called by Qt whenever a window is moved or resized using the QWindow API.
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)
static int resourceType(const QByteArray &key)