summaryrefslogtreecommitdiffstats
path: root/src/gui/vulkan/qvulkaninstance.h
Commit message (Collapse)AuthorAgeFilesLines
* Modernize the VK_EXT_debug_utils callbackLaszlo Agocs2023-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | ...as suggested by review comments. Switching to std::function implies that we cannot easily do the install-remove pattern anymore as there is no way to compare an std::function to something other than null. Instead of making it more complicated by returning a key or something like that, change the remove function to a clear (that now clears both the legacy VK_EXT_debug_report and the new VK_EXT_debug_utils callback lists). Also add a missing call that registers the new-style callbacks that are installed before create(). Pick-to: 6.5 Change-Id: I66c1dd8e8dcc8eee0f5eb9671f94c2c80319dcaf Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* vulkan: Add flag to opt out from enumerating Portability phys.devicesLaszlo Agocs2022-09-261-1/+2
| | | | | | Task-number: QTBUG-106912 Change-Id: I1cb4adae4bed62f31d781a89a03b70885411f91f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* vulkan: Port to VK_EXT_debug_utilsLaszlo Agocs2022-08-101-0/+21
| | | | | | | Fixes: QTBUG-89762 Change-Id: Ie32043578968cbeda7c7f87990b98c10f5d06ff8 Reviewed-by: Andy Nichols <andy.nichols@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* vulkan: Have a dummy format type if there is no Vulkan headerLaszlo Agocs2022-06-271-0/+1
| | | | | | | | | | | | | | | ...at application build time. Follow what is already done for some other Vk* types. Supports 1df2cf6bad7207f16ddca17344cc1324e50f287e in qtdeclarative, which puts now also VkFormat into a header. We need the function declaration to compile without a Vulkan SDK (so without vulkan.h). Pick-to: 6.4 Fixes: QTBUG-104501 Change-Id: I09c87149a53a45f03c9f75b87baec4323db16b1d Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Export the QVulkanInstancePrivate classJiDe Zhang2022-05-041-0/+1
| | | | | | | | | | | | | | | When needs by the QVulkanInstance::setVkInstance to use a existing VkInstance to a QQuickWindow, the VkInstance maybe is from a non Qt render system, in the case, the QPlatformVulkanInstance object of QVulkanInstance is can't create from the QPA, the all vulkan information is need get from the VkInstance owner(eg, getInstanceProcAddr). But providing it with a public interface is not a good idea, so by exporting a private class, you can use a private interface where needed to achieve the above purpose. Task-number: QTBUG-103021 Change-Id: I0312adcf55cfd7d49889ed112ab237c0b3ab3ef6 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make getter const, add const overloadsVolker Hilsheimer2021-03-291-1/+6
| | | | | | | | | | | | | | | The supportedApiVersions member is new in Qt 6.1, make it const. We can't change supportedLayers and supportedExtensions, but we can add const overloads that call the non-const version for now. This way, those APIs can also be called on const QVulkanInstance instances or references. Addresses header review comment. Pick-to: 6.1 Change-Id: Ie99d74f62cad72990b42566e56234b9c686e86de Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* vulkan: Add instance-level version getterLaszlo Agocs2021-01-181-0/+1
| | | | | | | | | | | ...as described in the Vulkan >= 1.1 spec. One can now call supportedApiVersion() (before create(), similarly to the other supported* functions) to determine the available Vulkan (instance-level) version. Fixes: QTBUG-90333 Change-Id: Ibe8482402b7f07e4abc48c88252ff0365e4e2faa Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-301-2/+2
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Guard vulkan.h inclusion with __has_includeLaszlo Agocs2020-10-161-5/+21
| | | | | | | | | | | | | | | | | | | | | | | | ...and provide our dummy typedefs when vulkan.h is not available. Originally this was there for qdoc, but from the qtdeclarative API review it becomes clear that we need this also when an application - that includes Qt Quick headers which in turn want to use VkImage and co. for type safety - is built on a system without vulkan.h against a Vulkan-enabled Qt build. Also fix some of the typedefs which were technically incorrect. (not that it matters much since the dummy typedefs still do not allow calling exported Qt functions that use the real Vk* types since the function signatures like won't match in some cases (would need to replicate too much hocus pocus from vulkan.h for that), but that's fine since our goal here is to keep application compilation going when it encounters a Vk* type in a Qt header, not about enabling actually calling those functions) Task-number: QTBUG-87450 Change-Id: I855b4478c8707587b28db2408e282145129a0194 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Port headersclean check to CMakeKai Koehne2020-08-251-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Configure Qt with -DQT_FEATURE_headersclean=ON to enable the check. There will be separate target for each module include (e.g. QtCore_header_check), but the check will also be done when the module is built for the first time. There are notable differences to the qmake version: - the build does not pick up anymore default defines or flags from the module, or Qt. Instead options like -fPIC they have to be listed explicitly. Also for this reason, we have to skip the vulkan-related headers from the check, since vulkan/vulkan.h is not necessarily in the compiler's default search path. - some checks for nowadays unsupported compiler versions are removed. - -Wdouble-promotion -Wshorten-64-to-32 is not added for clang builds; the qmake code path did never enforce that on CI machines (it was non-Apple clang only), and the check currently fails on these configurations. Fixes: QTBUG-82615 Change-Id: I1cd303677b1472116910b6c27748f96436feb35e Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Add more doc fixes for Vulkan typesLaszlo Agocs2020-08-031-0/+3
| | | | | | | | Add dummy typedefs just for qdoc, this way the types show up in the generated docs. Change-Id: I408eeb5c4c1cbbb8cd7df8ca3c9c6b7c64b0ca88 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Use QList instead of QVector in guiJarek Kobus2020-06-291-4/+4
| | | | | | | | Applied to headers only. Source file to be changed separately. Task-number: QTBUG-84469 Change-Id: Ic08a899321eaffc46b8461aaee3dbaa4d2c727a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Make qdoc generate usable docs for QVulkanInstanceLaszlo Agocs2020-06-251-0/+4
| | | | | | | | | | | It is not just that the unknown native types (e.g. VkInstance) lead to showing the type as 'int' in some functions, the bigger problem was that a number of functions were not present in the generated documentation at all. Pick-to: 5.15 Change-Id: Id71fe20c3a70a8d3b75bbc693a2a7ee94bb74642 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Change qHash() to work with size_t instead of uintLars Knoll2020-04-091-2/+2
| | | | | | | | | | | This is required, so that QHash and QSet can hold more than 2^32 items on 64 bit platforms. The actual hashing functions for strings are still 32bit, this will be changed in a follow-up commit. Change-Id: I4372125252486075ff3a0b45ecfa818359fe103b Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Vulkan: Add platform hooks before presentingJohan Klokkhammer Helsing2019-10-081-0/+1
| | | | | | | | | | This allows the Wayland plugin to circumvent the frame callback handling of the driver (which blocks until the frame is presented, potentially forever, if the window is minimized). Task-number: QTBUG-78000 Change-Id: Ia7d347019dfeae3bfcfad3d0cca3f4fffdc8c7a9 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* vulkan: Add debug message filteringLaszlo Agocs2019-05-281-0/+5
| | | | | | | | | | | | | | | | [ChangeLog][QtGui] Added support for filtering Vulkan debug messages in QVulkanInstance. This is especially useful for processing or suppressing messages from the validation layers. Change-Id: Idf0d7889085948daf5b1a53d2a9b11081e967609 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>
* Replace Q_DECL_NOEXCEPT with noexcept in QtGuiAllan Sandfeld Jensen2019-04-051-6/+6
| | | | | Change-Id: I43803b88fea8083782d73ce157c466b022208740 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Drop qvulkan headers from QtGui master headerLaszlo Agocs2017-11-031-0/+4
| | | | | | | | | | | | | ...in order to allow applications built against Vulkan-enabled pre-built packages to include <QtGui> on systems without Vulkan headers. This has the downside of not being able to pull in qvulkan* headers via the master header. This is an acceptable compromise for now. Task-number: QTBUG-64073 Change-Id: I63c5834dcec60e66aba34c003d4bfe8e7d31607f Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* QVulkan{Layer,Extension}: various fixesMarc Mutz2017-04-051-8/+36
| | | | | | | | | | | | - don't export simple structs - make op== non-member - add op!= (required by EqualityComparable) - add qHash() (should be defined by Qt for every EqualityComparable class) - add Q_DECLARE_TYPEINFO Change-Id: Ia14ac3fea48a6a0ad1d8993c9408afe77bbe6c1a Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* doc: Fix several qdoc warnings in new softwareMartin Smith2017-03-311-0/+7
| | | | | | | | | | This change fixes several common qdoc warnings in this new software. However, because vulkan/vulkan.h is not always available, a few typedefs were also added to define some standard vulkan types for clang to see when vulkan.h is not available. Change-Id: Id3db8c0a59b0c415829c1873a868aba0e84fe21c Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* doc: Ensure that clangqdoc sees QVulkanInstance declMartin Smith2017-03-311-1/+1
| | | | | | | | clangqdoc must see the declaration in vulkan regardless of whether Qt is configured with vulkan. Change-Id: I91fcaa4c39121b70e10c4fc3e854e49d959a6c02 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Basic Vulkan enablersLaszlo Agocs2017-03-171-0/+163
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>