diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-01-31 15:04:33 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2017-03-17 16:12:03 +0000 |
commit | f1a23a546720e4f1541404185ff8e765463e6bf6 (patch) | |
tree | a7c0235656a1edc387b87b22779a82ef909fa2cc /src/gui/kernel/qwindow.cpp | |
parent | a512c9c2f79309b76d84e4f56eef233064592ef0 (diff) |
Basic Vulkan enablers
For Android, Windows and xcb. Verified on Win10 with NVIDIA, Win10
with AMD, Android with Tegra K1, Android aarch64 with Tegra X1, and
Linux aarch64 with Tegra X1 (Jetson TX1, L4T).
Introduce QPA-based Vulkan library loader, core function resolver, and
instance creation support. In addition to creating a new VkInstance,
adopting an existing one from an external engine is supported as well.
The WSI specifics are hidden in the platform plugins. Vulkan-capable
windows use the new surface type VulkanSurface and are associated with
a QVulkanInstance.
On Windows VULKAN_SDK is picked up automatically so finding vulkan.h
needs no additional manual steps once the LunarG SDK is installed.
[ChangeLog][QtGui] Added support for rendering to QWindow via the Vulkan
graphics API.
Task-number: QTBUG-55981
Change-Id: I50fa92d313fa440e0cc73939c6d7510ca317fbc9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r-- | src/gui/kernel/qwindow.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp index 887d79f455..8471102aee 100644 --- a/src/gui/kernel/qwindow.cpp +++ b/src/gui/kernel/qwindow.cpp @@ -2797,6 +2797,30 @@ QDebug operator<<(QDebug debug, const QWindow *window) } #endif // !QT_NO_DEBUG_STREAM +#if QT_CONFIG(vulkan) + +/*! + Associates this window with the specified Vulkan \a instance. + + \a instance must stay valid as long as this QWindow instance exists. + */ +void QWindow::setVulkanInstance(QVulkanInstance *instance) +{ + Q_D(QWindow); + d->vulkanInstance = instance; +} + +/*! + \return the associrated Vulkan instance or \c null if there is none. + */ +QVulkanInstance *QWindow::vulkanInstance() const +{ + Q_D(const QWindow); + return d->vulkanInstance; +} + +#endif // QT_CONFIG(vulkan) + QT_END_NAMESPACE #include "moc_qwindow.cpp" |