diff options
author | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-10-04 11:25:19 +0200 |
---|---|---|
committer | Johan Klokkhammer Helsing <johan.helsing@qt.io> | 2019-10-25 10:09:05 +0200 |
commit | 3d161cef55eacafc4495e3ba0bcb86089c544dc1 (patch) | |
tree | aa3dd33b99f8d1e870a1595b5b14796313976b24 /src/client/qwaylandintegration.cpp | |
parent | a382762ed9692d11679d769437eba7ff2df544d1 (diff) |
Client: Add Vulkan support for Wayland
Inspired by the xcb version.
hellovulkantriangle runs smootly, but freezes in some multi-monitor
setups.
[ChangeLog][QPA plugin] Added Vulkan support.
Fixes: QTBUG-78000
Change-Id: I8711b5b47e4b71cde78295aab9acb3f5945b141b
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/client/qwaylandintegration.cpp')
-rw-r--r-- | src/client/qwaylandintegration.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/client/qwaylandintegration.cpp b/src/client/qwaylandintegration.cpp index ce72c3340..9bdd9cc12 100644 --- a/src/client/qwaylandintegration.cpp +++ b/src/client/qwaylandintegration.cpp @@ -94,6 +94,11 @@ #include <QtXkbCommonSupport/private/qxkbcommon_p.h> #endif +#if QT_CONFIG(vulkan) +#include "qwaylandvulkaninstance_p.h" +#include "qwaylandvulkanwindow_p.h" +#endif + QT_BEGIN_NAMESPACE namespace QtWaylandClient { @@ -158,6 +163,11 @@ QPlatformWindow *QWaylandIntegration::createPlatformWindow(QWindow *window) cons && mDisplay->clientBufferIntegration()) return mDisplay->clientBufferIntegration()->createEglWindow(window); +#if QT_CONFIG(vulkan) + if (window->surfaceType() == QSurface::VulkanSurface) + return new QWaylandVulkanWindow(window); +#endif // QT_CONFIG(vulkan) + return new QWaylandShmWindow(window); } @@ -278,6 +288,13 @@ QPlatformTheme *QWaylandIntegration::createPlatformTheme(const QString &name) co return QGenericUnixTheme::createUnixTheme(name); } +#if QT_CONFIG(vulkan) +QPlatformVulkanInstance *QWaylandIntegration::createPlatformVulkanInstance(QVulkanInstance *instance) const +{ + return new QWaylandVulkanInstance(instance); +} +#endif // QT_CONFIG(vulkan) + // May be called from non-GUI threads QWaylandClientBufferIntegration *QWaylandIntegration::clientBufferIntegration() const { |