summaryrefslogtreecommitdiffstats
path: root/src/gui/vulkan
Commit message (Collapse)AuthorAgeFilesLines
* Rename files for header generationLucie Gérard2024-03-201-0/+0
| | | | | | | Pick-to: 6.7 Task-number: QTBUG-121039 Change-Id: I45eec26e93e5aa3e4a08ef4b326427338f63e3f2 Reviewed-by: Kai Köhne <kai.koehne@qt.io>
* vulkan: Make setEnabledFeatures2Modifier an overloadLaszlo Agocs2024-02-132-9/+7
| | | | | | Pick-to: 6.7 Change-Id: I74087324e4ea54af0165f3e30b73b2df61104a41 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* QVulkanWindow::setEnabledFeatures2Modifier(): pass parameter by valueIvan Solovev2024-02-122-3/+3
| | | | | | | | | | | | | | The method takes an std::function as a parameter, so it makes sense to pass it by value to avoid copying when passing lambdas. Amends bd78047df34fda3a56b8db069fc97280831ac696 Found in 6.7 API review Pick-to: 6.7 Change-Id: Ic0608a176bfd26b5b44fae48f29d84737e81a413 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* QVulkanWindow: sync surface size logic with QRhiLaszlo Agocs2023-12-042-1/+28
| | | | | | | | | | | | | The legacy QWindow convenience subclass does not have the robust logic that was later implemented for the Vulkan backend of QRhi. (i.e., never trust the QWindow; problem with QVulkanWindow is that it half-trusts those values still, which leads to the classic pixel-size-differs-by-one problem) Pick-to: 6.6 6.5 6.2 Fixes: QTBUG-118568 Change-Id: I5f83999e86a9907efe08b38ca069bae20152a4e0 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* QVulkanWindow: Add a way to control post-1.0 Vulkan featuresLaszlo Agocs2023-11-063-18/+75
| | | | | | | | | | | | | | | | | | | | | | So now instead of filling out a VkPhysicalDeviceFeatures and sending it in via VkDeviceCreateInfo::pEnabledFeatures, we rather create a VkPhysicalDeviceFeatures2, which contains a VkPhysicalDeviceFeatures (for 1.0 stuff) and a pNext chain, and chain it via pNext to the VkDeviceCreateInfo. QVulkanWindow will not do anything with post-1.0 features by default. (in this regard it deviates from the QRhi Vulkan backend which already tackles 1.1, 1.2, and 1.3 features as well, but this is not going to change) However, applications may want to enable some of those still. To enable this, add a new callback. When set, the callback is invoked and the alternative behavior described above is activated. Fixes: QTBUG-117966 Change-Id: I8560a6b23421f545ee760e714cbe2ec2f6078406 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* qvulkanwindow: use qimage rvalue overalods moreAnton Kudryavtsev2023-10-311-1/+1
| | | | | | Pick-to: 6.6 Change-Id: I71bb0df5dbf1993284ec907f637a8696898dddb1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
* Do automatic r-b swap in QVulkanWindow's grab for BGRA8Laszlo Agocs2023-10-301-1/+10
| | | | | | | | | | | | | | While it would also be acceptable to leave this conversion to the user, the returned image's format (that it's QImage::Format_RGBA8888) is not documented. That needs to be corrected in any case. Then, we may just as well add and document that for the most commonly used swapchain color buffer format the r-b swap is performed automatically. Pick-to: 6.6 6.5 6.2 Fixes: QTBUG-118244 Change-Id: I7ec8324ec3a0f5c1f2a7a592501d5ff59e3e8cc5 Reviewed-by: Kristoffer Skau <kristoffer.skau@qt.io> Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* vulkan: Do not set the portability bit with old SDKsLaszlo Agocs2023-09-251-2/+7
| | | | | | | | | | | | | Because it's a validation error with old ones, but required in some cases from 1.3.216 on (MoltenVK). Ridiculous. Amends 7fbc741d107ab679f6abd680ec909ce9b2bf333a and b018bc6e2d27b95024ee8f1b8c719199df47c264. Fixes: QTBUG-117412 Pick-to: 6.6 6.5 Change-Id: I9b4cacbe611d4e557ee1c156527142eb919d6b77 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* Doc: Add notes that QVulkanFunctions supports Vulkan 1.3Andreas Eliasson2023-09-051-12/+12
| | | | | | | | QVulkanFunctions and QVulkanDeviceFunctions now also support Vulkan 1.3. Fixes: QTBUG-116465 Change-Id: I74f6188330dec1b776b4c6db423b9152ea71d1c3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: Remove references to non-existing current() methodAndreas Eliasson2023-08-171-3/+4
| | | | | | | | | | There seems to be no current() method. Replace with the vkInstance method. Fixes: QTBUG-115853 Pick-to: 6.6 6.5 6.4 6.2 Change-Id: Ifc0f741186092862b498fe4be2d39076b92fa725 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Unity Build: Resolve a variable redefinition errorAmir Masoud Abdol2023-07-031-3/+3
| | | | | | | | | | | The `qvk_sampleCounts` variable is defined in `qrhivulkan.cpp` as well. This causes an issue when building with unity build. To resolve the problem, I renamed the variable in `qvulkanwindow.cpp`. Fixes: QTBUG-114918 Pick-to: 6.5 6.6 Change-Id: I0b38c6b3e30792dd6f770d4dea8cb4c7789961d1 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* rhi: Make it a QPA-style private but semi-public APILaszlo Agocs2023-05-212-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qrhi.h, qshader.h, qshaderdescription.h (and qshaderbaker.h from shadertools; done separately) become "RHI APIs", following the concept of QPA APIs. Mirror completely what is done for QPA headers, but using the "rhi" prefix for the headers. This involves updating syncqt to handle the new category of headers. (a note on the regex: matching everything starting with "qrhi" is not acceptable due to incorrectly matching existing and future headers, hence specifying the four header names explicitly) There is going to be one difference to QPA: the documentation for everything RHI is going to be public and part of the regular docs, not hidden with \internal. In addition to the header renaming and adding the comments and documentation notes and warnings, there is one significant change here: there is no longer a need to do API-specific includes, such as qrhid3d11[_p].h, qrhivulkan[_p].h, etc. These are simply merged into a single header that is then included from qrhi.h. This means that users within Qt, and any future applications can just do #include <rhi/qrhi.h> (or rhi/qshader.h if the QRhi stuff is not relevant), no other headers are needed. There are no changes to functionality in this patch. Only the documentation is expanded, quite a lot, to eliminate all qdoc warnings and make the generated API docs complete. An example, with a quite extensive doc page is added as well. Task-number: QTBUG-113331 Change-Id: I91c749826348f14320cb335b1c83e9d1ea2b1d8b Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Call into platform hooks for start and end framesDavid Edmundson2023-04-282-0/+13
| | | | | | | | This closely matches QPlatformOpenGLContext which in turn, where it can be used by backends to guard low level resources. Change-Id: Ia44cebced6cdf94497279c47d3c35c0e02e4cb0e Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Modernize the VK_EXT_debug_utils callbackLaszlo Agocs2023-02-022-16/+19
| | | | | | | | | | | | | | | | | | | | | ...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>
* Doc: Show signatures of typedef'sKai Köhne2023-01-121-2/+13
| | | | | | | | qdoc doesn't do this by default. Pick-to: 6.5 Change-Id: Idd4885be2fdac951b2ed555088f9b3f7989157ab Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: Document further GUI API as new in 6.5Kai Köhne2023-01-121-1/+1
| | | | | | Pick-to: 6.5 Change-Id: I83402aec120a2f6a78b245029b94d3519f94d7f3 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Doc: Fix qt_attribution.json files using Path for filesKai Köhne2023-01-101-1/+1
| | | | | | | | | | Since qttools commit 39fdcb8e7a, qtattributionsscanner fails if 'Path' is not a directory. Use the 'Files' attribute instead. Pick-to: 6.4 6.5 Fixes: QTBUG-110002 Change-Id: I65fecdcb852ce9abea55f168cd939804bae9ae80 Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-215-14/+14
| | | | | | | | | | | | | | | | | | | | | | | 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>
* Port from qAsConst() to std::as_const()Marc Mutz2022-10-112-6/+6
| | | | | | | | | | | | | | | | We've been requiring C++17 since Qt 6.0, and our qAsConst use finally starts to bother us (QTBUG-99313), so time to port away from it now. Since qAsConst has exactly the same semantics as std::as_const (down to rvalue treatment, constexpr'ness and noexcept'ness), there's really nothing more to it than a global search-and-replace, with manual unstaging of the actual definition and documentation in dist/, src/corelib/doc/ and src/corelib/global/. Task-number: QTBUG-99313 Change-Id: I4c7114444a325ad4e62d0fcbfd347d2bbfb21541 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
* Port from container.count()/length() to size()Marc Mutz2022-10-042-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is semantic patch using ClangTidyTransformator: auto QtContainerClass = expr(hasType(namedDecl(hasAnyName(<classes>)))).bind(o) makeRule(cxxMemberCallExpr(on(QtContainerClass), callee(cxxMethodDecl(hasAnyName({"count", "length"), parameterCountIs(0))))), changeTo(cat(access(o, cat("size"), "()"))), cat("use 'size()' instead of 'count()/length()'")) a.k.a qt-port-to-std-compatible-api with config Scope: 'Container'. <classes> are: // sequential: "QByteArray", "QList", "QQueue", "QStack", "QString", "QVarLengthArray", "QVector", // associative: "QHash", "QMultiHash", "QMap", "QMultiMap", "QSet", // Qt has no QMultiSet Change-Id: Ibe8837be96e8d30d1846881ecd65180c1bc459af Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* vulkan: Add flag to opt out from enumerating Portability phys.devicesLaszlo Agocs2022-09-263-6/+12
| | | | | | Task-number: QTBUG-106912 Change-Id: I1cb4adae4bed62f31d781a89a03b70885411f91f Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* vulkan: Re-enable VK_KHR_portability driversLaszlo Agocs2022-09-262-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Vulkan loader as of SDK 1.3.216 and MoltenVK decided that all existing applications need to stop working with non-conformant Vulkan implementations such as MoltenVK, unless they start specifying the right soup of instance flags, extensions, and device extensions. Set VK_INSTANCE_CREATE_ENUMERATE_PORTABILITY_BIT_KHR in VkInstanceCreateInfo::flags. Automatically request VK_KHR_portability_enumeration, if supported, on the instance. This handles the instance side. On the device side we can add support in QRhi so Qt Quick continues to work with MoltenVK. This involves requesting VK_KHR_portability_subset on the device whenever the extension is reported as supported (not doing so would be an error) However, applications creating their own VkDevice will need to take care of this themselves. This device extension requires VK_KHR_get_physical_device_properties2 on the instance (which QRhi does not control). This is no problem with Qt Quick as that already does this automatically, but in the unlikely case of wrapping an existing VkInstance in QVulkanInstance it will be up to the creator of VkInstance to enable that as well. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-106912 Change-Id: Idaf277549b3ec982e99bfc49e4ad6a67976c141a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Apply Q_CONSTINIT where beneficialSona Kurazyan2022-09-011-1/+1
| | | | | | | | | | Applied Q_CONSTINIT to variables with static storage duration, but skipped the POD types with core constant initializers. Task-number: QTBUG-100486 Change-Id: Iaabf824e9cb0f29a405a149912200d4e4b3573c1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* rhi: Fix instance API version when only 1.1 is supportedLaszlo Agocs2022-08-161-1/+1
| | | | | | | | | | | Looks like something inherited from the Qt Quick code that got moved into the helper. Setting a request of API version 1.2 is harmless in practice, but to be correct the version should be 1.1 when 1.2 and newer are not reported by the instance. Change-Id: I62d2c143972d6753e4311c6907ccf846ae0e9088 Pick-to: 6.4 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* vulkan: Port to VK_EXT_debug_utilsLaszlo Agocs2022-08-107-47/+196
| | | | | | | 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>
* Skip potentially costly features in QVulkanWindowLaszlo Agocs2022-08-041-10/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QVulkanWindow has recently been updated both in 5.15 and 6.x to start enabling at least the 1.0 core features, because modern validation layers are likely to complain if a feature is used without the corresponding flag enabled upon device creation, even if the driver does not actually care. There is a catch here however, namely that some features may be true opt-in flags, e.g. robustBufferAccess, and when enabled, they may incur a performance penalty. So we will keep that one feature disabled even when it is reported as supported. It is unfortunate that VkPhysicalDeviceFeatures mixes together flags that are most likely used only to query if some feature is supported by the implementation while not serving as a real toggle (because opting in/out is meaningless for the implementations in practice), and flags that have significant effects when the feature is enabled, for example when it comes to performance. As QVulkanWindow only cares about 1.0, and 1.1+ features are to be handled by the application via the features-modifier callback, we can get away by just disabling robustBufferAccess and passing in everything else supported as-is for vkCreateDevice. Task-number: QTBUG-105158 Pick-to: 6.4 Change-Id: I963402ab50f6e5d3fa6824680f69cff8568b669a Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Bump QVulkan(Device)Functions to Vulkan 1.3Laszlo Agocs2022-08-042-1453/+7623
| | | | | | | | | | | | | | Update vk.xml to 1.3.223 and make qvkgen output the Vulkan 1.3 functions as well. [ChangeLog][QtGui] QVulkanFunctions and QVulkanDeviceFunctions are updated to expose the Vulkan 1.3 API as long as the build environment's vulkan.h is 1.3-capable. Fixes: QTBUG-105270 Change-Id: Iabe04f0a74cdbd94efcc1869f545da058a553fed Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* vulkan: Request an 1.3 instance if supportedLaszlo Agocs2022-08-031-9/+11
| | | | | | | | This affects the users of the QVulkanInstance creation helper, which are Qt Quick and the backingstore compositor for texture-based widgets. Change-Id: I6c3eccfade3cf9be7811dda66aca9d63ece4534c Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Add default value for seed param to all qHash overloadsKai Köhne2022-07-201-2/+2
| | | | | | Pick-to: 6.4 Change-Id: I4d559ccd60ec54d2584dceecaece7e0899c0eea9 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* 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>
* Doc: Fix documentation for vulkan licensesKai Köhne2022-05-302-1/+65
| | | | | | | | | | [ChangeLog][Third-Party Code] Vulkan API Registry is available not only under MIT License, but also Apache License 2.0. Make this explicit in the license documentation. Pick-to: 6.2 6.3 Change-Id: I6f07a7970319aef0a26f291de1eff7c316195802 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-1614-532/+28
| | | | | | | | | | | | | 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-043-28/+97
| | | | | | | | | | | | | | | 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>
* QtGui: includemocsMarc Mutz2022-04-291-0/+2
| | | | | | | | | | | Including moc files directly into their classes' TU tends to improve codegen and enables extended compiler warnings, e.g. about unused private functions or fields. Pick-to: 6.3 6.2 5.15 Task-number: QTBUG-102886 Change-Id: I1945741794c25679a9d94c0d68c8642e2c823502 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Gui: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+1
| | | | | Change-Id: I27321235d9c8428de0cff1e22a618299b9e5a97f Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* QVulkanWindow: fix QByteArray::count deprecation warningMårten Nordheim2022-03-171-1/+1
| | | | | | | By using QBA::size Change-Id: I716c0e27230cd46e92ca5521d9a19cb296e221bd Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* vulkan: Try loading libvulkan.so.1 firstLaszlo Agocs2022-03-112-9/+35
| | | | | | | Change-Id: I876899fbfc126136f2842e9361e21ac10af8f14b Pick-to: 6.3 Fixes: QTBUG-101592 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Make sure all qtbase private headers include at least one otherThiago Macieira2022-02-241-1/+2
| | | | | | | | | | See script in qtbase/util/includeprivate for the rules. Since these files are being touched anyway, I also ran the updatecopyright.pl script too. Change-Id: Ib056b47dde3341ef9a52ffff13ef677e471674b6 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* Convert Vulkan instance setup from Qt Quick into a Gui helperLaszlo Agocs2022-02-153-1/+202
| | | | | | | | | Make it possible to reuse what's in QSGRhiSupport from other modules as well. Both Gui (texture-based widget/backingstore composition) and Multimedia are potential users of this in the future. Change-Id: I1b50cc5efd6811e9bc95f6287b9576931d4bcc44 Reviewed-by: Christian Strømme <christian.stromme@qt.io>
* QVulkanWindow: make it possible to override the enabled featuresLaszlo Agocs2022-01-203-2/+50
| | | | | | | | | | | | | | | We already have a precedent for this: the QueueCreateInfoModifier callback. Following the pattern, add a EnabledFeaturesModifier that can alter the VkPhysicalDeviceFeatures that is passed to vkCreateDevice(). [ChangeLog][QtGui][QVulkanWindow] QVulkanWindow can now invoke a callback to alter the VkPhysicalDeviceFeatures object used to create the Vulkan device. This allows enabling 1.1, 1.2, and extension features. Fixes: QTBUG-99803 Change-Id: I5ede0c6bc3430cbb304d4961eb9e44faad5ce4d7 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Enable all supported 1.0 device features in QVulkanWindowLaszlo Agocs2022-01-201-0/+23
| | | | | | | | | | [ChangeLog][QtGui][QVulkanWindow] QVulkanWindow is now enabling all Vulkan 1.0 features reported as supported from the physical device. Pick-to: 6.2 6.3 5.15 Task-number: QTBUG-99803 Change-Id: Ib9cfcd449904c67b07e0e2d4ade5bcaeb4cb0ce6 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix queue passed to vkQueuePresentLaszlo Agocs2022-01-201-1/+1
| | | | | | | | | | | | | | | | | We do not test actively test setups where a separate graphics and present queue is used because there is no combined queue at all. (it won't be tested because we neither want to nor have the possibility to do so) However, QVulkanWindow (unlike, say, QRhi's Vulkan backend) attempts to support this. It turns out the argument passed to vkQueuePresent is wrong: the present is to be submitted to the present queue. So fix this up. Pick-to: 6.3 6.2 5.15 Fixes: QTBUG-73470 Change-Id: Ic9b589aba52e3326637216b98a074e27fdc3e3b9 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Doc: Use \inmodule for all classes and headersTopi Reinio2022-01-171-0/+3
| | | | | | | | | | | | | | | QDoc made some assumptions about the module a class/header belongs to, based on the source file path. This feature is rather error-prone and unnecessarily complex and will be removed from QDoc. Define modules explicitly to avoid documentation warnings when this removal happens. Pick-to: 6.2 6.3 Change-Id: I7947d197db5ac36c12e816caa19bb2f74eda8849 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io>
* codechecker: Add assert for implicit conditionEskil Abrahamsen Blomfeldt2021-06-181-0/+1
| | | | | | | | | | Since memReq is initialized inside the loop, codechecker complained that we might use uninitialized data if count == 0. So we assert that this is not the case to get rid of the warning. Change-Id: I82152942d2bb61723e9e41489c87bfde9f8bec15 Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* vulkan: Update legacy tests and examples to the modern validation layerLaszlo Agocs2021-05-311-1/+1
| | | | | | Fixes: QTBUG-88388 Change-Id: Ib072f203ada5d692dea8d35da2b24db0deac0297 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
* Fix build without features.libraryTasuku Suzuki2021-05-192-3/+0
| | | | | | Change-Id: I53eaaea149324d2495e794ba8bd58544e648e48e Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Make getter const, add const overloadsVolker Hilsheimer2021-03-292-2/+17
| | | | | | | | | | | | | | | 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>
* Fix QVulkanWindow on WaylandEskil Abrahamsen Blomfeldt2021-03-121-1/+1
| | | | | | | | | | | | | | | | The Wayland backend needs 4 buffers and is failing when making QVulkanWindow since there was a hardcoded limit at 3. The Vulkan-backend to RHI already has smarter handling of this. We want to limit the changes we do to the "legacy" QVulkanWindow, so we keep the hardcoded max value but increase it to 4 to accommodate the requirements on Wayland. Task-number: QTBUG-91418 Change-Id: I830bc30d1c2eeac1b076c50d35d5d138fd46dace Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
* Update QVulkan(Device)Functions to Vulkan 1.2Laszlo Agocs2021-01-196-1861/+11774
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>