diff options
| author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-14 16:40:14 +0100 |
|---|---|---|
| committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-01-19 14:17:55 +0100 |
| commit | c6d602990901bb44b9268b1603b25d3c76c97683 (patch) | |
| tree | 23a5cc95fa7e3bb9f0a8b22dd722da1a252b2c2b /src/gui/vulkan/qvulkanfunctions.cpp | |
| parent | 12d8bb0709bf7982061cb0c3e608e4a581892e35 (diff) | |
Update QVulkan(Device)Functions to Vulkan 1.2
This also needs improvements to qvkgen. What we get with this patch
are the Vulkan 1.1 and 1.2 core API's additional 11 instance-level
and 30 device-level commands present in QVulkanFunctions and
QVulkanDeviceFunctions.
All of these are attempted to be resolved upon construction. When the
implementation does not return a valid function pointer for some of them
(e.g. because it is a Vulkan 1.0 instance or physical device), calling
the corresponding wrapper functions will lead to unspecified behavior.
This is in line with how QOpenGLExtraFunctions works. The simple
autotest added to exercise some Vulkan 1.1 APIs demonstrates this in
action.
The member functions in the generated qvulkan(device)functions header
and source files are ifdefed by VK_VERSION_1_{0,1,2}. This is essential
because otherwise a Qt build made on a system with Vulkan 1.2
headers would cause compilation breaks in application build environments
with Vulkan 1.0/1.1 headers when including qvulkanfunctions.h (due to
missing the 1.1/1.2 types and constants, some of which are used in the
function prototypes). In practice this should be alright - the only
caveat to keep in mind is that the Qt builds meant to be distributed
to a wide variety of systems need to be made with a sufficiently new
version of the Vulkan headers installed, just to ensure that the
1.1 and 1.2 wrapper functions are compiled into the Qt libraries.
Task-number: QTBUG-90219
Change-Id: I48360a8a2e915d2709fe82993f65e99b2ccd5d53
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/vulkan/qvulkanfunctions.cpp')
| -rw-r--r-- | src/gui/vulkan/qvulkanfunctions.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/gui/vulkan/qvulkanfunctions.cpp b/src/gui/vulkan/qvulkanfunctions.cpp index 73dbeb9ab62..decf5edd3f0 100644 --- a/src/gui/vulkan/qvulkanfunctions.cpp +++ b/src/gui/vulkan/qvulkanfunctions.cpp @@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE \wrapper \brief The QVulkanFunctions class provides cross-platform access to the - instance level core Vulkan 1.0 API. + instance level core Vulkan 1.2 API. Qt and Qt applications do not link to any Vulkan libraries by default. Instead, all functions are resolved dynamically at run time. Each @@ -81,6 +81,18 @@ QT_BEGIN_NAMESPACE \l{https://www.khronos.org/registry/vulkan/specs/1.0/man/html/vkGetInstanceProcAddr.html}{the man page for vkGetInstanceProcAddr} for more information. + \note The member function prototypes for Vulkan 1.1 and 1.2 commands are + ifdefed with the appropriate \c{VK_VERSION_1_x} that is defined by the + Vulkan headers. Therefore these functions will only be callable by an + application when the system's (on which the application is built) Vulkan + header is new enough and it contains 1.1 and 1.2 Vulkan API definitions. + When building Qt from source, this has an additional consequence: the + Vulkan headers on the build environment must also be 1.1 and 1.2 capable in + order to get a Qt build that supports resolving the 1.1 and 1.2 API + commands. If either of these conditions is not met, applications will only + be able to call the Vulkan 1.0 commands through QVulkanFunctions and + QVulkanDeviceFunctions. + \sa QVulkanInstance, QVulkanDeviceFunctions, QWindow::setVulkanInstance(), QWindow::setSurfaceType() */ @@ -92,7 +104,7 @@ QT_BEGIN_NAMESPACE \wrapper \brief The QVulkanDeviceFunctions class provides cross-platform access to - the device level core Vulkan 1.0 API. + the device level core Vulkan 1.2 API. Qt and Qt applications do not link to any Vulkan libraries by default. Instead, all functions are resolved dynamically at run time. Each |
