summaryrefslogtreecommitdiffstats
path: root/src/gui/vulkan
Commit message (Collapse)AuthorAgeFilesLines
* QVulkanWindow: Force render on paint eventDavid Edmundson2025-06-021-0/+1
| | | | | | | | | | | | When a paint event is dispatched from the platform, application code should redraw contents and submit a frame regardless of whether contents have changed. This fixes an issue where the window does not always update after being minimized on wayland, and would also be needed for non-composited X11 when exposure changes. Pick-to: 6.10 6.9 6.8 Change-Id: I506872f439e0c16d71ad13def1c8b58a0491dd73 Reviewed-by: Laszlo Agocs <[email protected]>
* Modernize and fix frame sync in QVulkanWindowLaszlo Agocs2025-05-122-76/+55
| | | | | | | | | | | | | | Follow 24d62ffd720b5bec5d07b07b8d2c9dda7635f3c0 for QVulkanWindow. The Vulkan backend of QRhi has diverged from QVulkanWindow even before that recent fix, having many changes over the years that are not present in QVulkanWindow. Introduce some of these now, to make things work with the newer validation layer bundled with the Vulkan 1.4 SDKs. Task-number: QTBUG-135645 Change-Id: Ic630e9a57c344843c171871b5a0386ed18027b22 Reviewed-by: Andy Nichols <[email protected]>
* qHashMulti: switch to passing the seed to the qHash() function in 7.0Thiago Macieira2025-05-091-2/+2
| | | | | | | | | | | | | | | | | | | | | Amends 707129fd5a7c6390fbdf4270119226df2a427fcd. This is much better for our string types because qHashBits() has a faster implementation when seed!=0. The algorithm is the same, except that QHashCombine now separates the seed from the combined hash, not merging the two unrelated concepts together. We can't fix it in Qt 6.x because it changes the hashing algorithm of existing types that used qHashMulti(), which will have been inlined throughout user code. The deprecated constructor is there only until the rest of Qt is fixed. Since this is a private class, that won't stay for long. Task-number: QTBUG-134683 Fixes: QTBUG-134690 Change-Id: I2167e154f083089d12a1fffd61c1ab8670731156 Reviewed-by: Edward Welbourne <[email protected]>
* Expose the Vulkan 1.4 core APILaszlo Agocs2025-03-113-2204/+10699
| | | | | | | | | | | | | | | | | | | Non-trivial update this time. Recent vk.xml adds the option of listing "vulkiansc" in the api attribute, which we did not handle before in qvkgen for command elements at all, and was not treated as a comma-separated list for feature elements. Fix these up. Also add 1.4 in QVulkanDefaultInstance, so that 1.4 goes into VkApplicationInfo.apiVersion, when available, incl. in Qt Quick. [ChangeLog][QtGui] QVulkanFunctions and QVulkanDeviceFunctions are updated to expose the Vulkan 1.4 API as long as Qt is built against Vulkan 1.4 headers. [ChangeLog][Third-Party Code] Updated vk.xml to 1.4.308. Change-Id: I8bc4bb578575bcbb189286a26617cd0052241be5 Reviewed-by: Andy Nichols <[email protected]>
* Use QThread::isMainThread() in a few placesThiago Macieira2025-02-261-1/+1
| | | | | | | | | | | | | | | It's thread-safe, whereas trying to load qApp isn't in Qt 6.x (will be in 7.0) and dereferencing it to call QObject::thread() will probably never be. It's also faster, being a single function call instead of two or three. This is not an exhaustive search, it's just a few places I found while searching for QThread::instance(). Pick-to: 6.9 6.8 Change-Id: I3b4e1c75bb3966e2cd2dfffd79bfc8a40f6cf40b Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
* QVulkanDefaultInstance: warn if setting flags has no effectLaszlo Agocs2025-01-231-1/+3
| | | | | | | Pick-to: 6.9 Change-Id: Ib939e56f0e8bc3e04725fb3660d30a8d3e13fad3 Reviewed-by: Andy Nichols <[email protected]> Reviewed-by: Kristoffer Skau <[email protected]>
* Replace qdebug.h includes in public headers with forward-declarationsAhmad Samir2025-01-151-1/+2
| | | | | | | | | | | | | | | | | | | qdebug.h includes many Qt and STL headers, so if you include a Qt header you get all those transitive includes, which may affect build time. - Where appropriate use the printf-like syntax of qDebug() and co., these don't need the QDebug streaming operators - qfloat16 is used in an inline member function, so include it explicitly [ChangeLog][Potentially Source Incompatible Changes] Various Qt public headers don't include QDebug any more; if you need QDebug's streaming you'll have to include it in your code. Task-number: QTBUG-132439 Pick-to: 6.9 Change-Id: I750587e17a3b38fa226cd3af8eaccc8da580f436 Reviewed-by: Thiago Macieira <[email protected]>
* CMake: Use the $<VERSION> placeholder in qt_attribution.jsonAlexandru Croitor2025-01-091-1/+1
| | | | | | | | | | For all CPE and PURL fields where it makes sense, to avoid duplication. Pick-to: 6.8 6.9 Task-number: QTBUG-132181 Change-Id: Icd1c5267e4e9b582eea28150ebd1b2cca3852229 Reviewed-by: Joerg Bornemann <[email protected]>
* Replace qgetenv() calls converted to QString with qEnvironmentVariable()Thiago Macieira2025-01-011-1/+1
| | | | | | | | It's slightly more efficient. Pick-to: 6.9 Change-Id: Id5ac04fc27eee108c8e5fffd786c3d5f793a0a9d Reviewed-by: Ahmad Samir <[email protected]>
* Create qdoc macros for C++ class docs 2.1: qHash()Marc Mutz2024-11-271-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Add a family of qdoc macros to document the various qHash() overloads we have. This patch does not change the \relates of the qHash() functions, they remain as inconsistent as they have been. Created QTBUG-129815 to clean things up. Since this author expects the \relates to change in the future, there are different \qhash commands, and all except \qhashbuiltin take the class name as an argument, for use in a centrally-choreographed fix for QTBUG-129815. As drive-by's, fix: - missing documentation about Key having to support qHash() in the associative Qt containers - drop noexcept and default arguments from \fn lines that needed to have their argument names changed - move the QStringView overload from qhash.cpp to qstringview.cpp (as it \relates to the former) Fixes: QTBUG-129574 Pick-to: 6.8 6.5 Change-Id: I8e8c2edc27422cbe5823f56baf3a24d7f7050836 Reviewed-by: Ivan Solovev <[email protected]> Reviewed-by: Jaishree Vyas <[email protected]>
* CMake: Add PURL and CPE info to 3rd party attribution filesAlexandru Croitor2024-11-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The change adds CPE and PURL keys to all qt_attribution.json files in the repo. In case if no sensible CPE or PURL exists, a "Comment" field is added with the text "no relevant CPE or PURL found". If only one of them does not exist, it is written as such in the Comment field. This allows filtering for files that haven't had the information added yet vs those that were looked up but no relevant information was found. For sources that are not hosted on github, a generic PURL is used with a download_url fragment pointing either to the exact location where the sources can be downloaded, or to the homepage of the project. The generic package name was chosen based on the 'Id' key of the attribution entry where it was present, and is not authoritative. For PURL github packages, the 'git tag' name was specified into the 'version' part of the PURL, rather than the 'version number', because SBOM processing tooling handle that better than the version number. For example for the freetype package, we specify the string 'VER-2-13-3' rather than the tag name '2.13.3'. We might revisit this in the future. [ChangeLog][Third-Party Code] Added PURL and CPE information to the attribution files of 3rd party sources. Pick-to: 6.5 6.8 Task-number: QTBUG-122899 Task-number: QTBUG-129602 Change-Id: Iad126242cafc3ea0b678c5c36b26f857039b1dbd Reviewed-by: Alexey Edelev <[email protected]>
* Logging: use qCDebug/Warning/Info when for categorized loggingVolker Hilsheimer2024-07-162-4/+4
| | | | | | | | | | | | | When building qt with QT_NO_DEBUG/WARNING/INFO_OUTPUT set, then the qDebug/Warning/Info macros expand to `QMessageLogger::noDebug`. That helper is not defined to take a logging category or category function, so using `qDebug(lcX, ...)` breaks the build. The correct way to emit categorized logging is to use the qCDebug/Warning/Info macros. Task-number: QTBUG-125589 Pick-to: 6.8 6.7 6.5 Change-Id: I968b0e826871a09023c11fec9e51caa5a2c4dc0b Reviewed-by: Jonas Karlsson <[email protected]>
* Straighten out various logging categoriesUlf Hermann2024-06-193-3/+5
| | | | | | | | | | | | Either make them static or declare them in a header. We want them to be static wherever possible, in order to reduce the number of visible symbols. If they can't be static, however, they should at least be declared in only one place. Task-number: QTBUG-67692 Change-Id: I6f3b596ed4f0adc9873dd0a5f54f055a991a6207 Reviewed-by: Thiago Macieira <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* 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 <[email protected]>
* vulkan: Make setEnabledFeatures2Modifier an overloadLaszlo Agocs2024-02-132-9/+7
| | | | | | Pick-to: 6.7 Change-Id: I74087324e4ea54af0165f3e30b73b2df61104a41 Reviewed-by: Ivan Solovev <[email protected]>
* 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 <[email protected]> Reviewed-by: Laszlo Agocs <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* qvulkanwindow: use qimage rvalue overalods moreAnton Kudryavtsev2023-10-311-1/+1
| | | | | | Pick-to: 6.6 Change-Id: I71bb0df5dbf1993284ec907f637a8696898dddb1 Reviewed-by: Allan Sandfeld Jensen <[email protected]>
* 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 <[email protected]> Reviewed-by: Christian Strømme <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Kristoffer Skau <[email protected]> Reviewed-by: Christian Strømme <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Volker Hilsheimer <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Mårten Nordheim <[email protected]>
* 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 <[email protected]>
* vulkan: Port to VK_EXT_debug_utilsLaszlo Agocs2022-08-107-47/+196
| | | | | | | Fixes: QTBUG-89762 Change-Id: Ie32043578968cbeda7c7f87990b98c10f5d06ff8 Reviewed-by: Andy Nichols <[email protected]> Reviewed-by: Qt CI Bot <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Andy Nichols <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]> Reviewed-by: Lars Knoll <[email protected]> Reviewed-by: Jörg Bornemann <[email protected]>
* 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 <[email protected]>
* 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 <[email protected]>
* Gui: Do not depend on transitive includesFabian Kosmale2022-03-171-0/+1
| | | | | Change-Id: I27321235d9c8428de0cff1e22a618299b9e5a97f Reviewed-by: Marc Mutz <[email protected]>
* QVulkanWindow: fix QByteArray::count deprecation warningMårten Nordheim2022-03-171-1/+1
| | | | | | | By using QBA::size Change-Id: I716c0e27230cd46e92ca5521d9a19cb296e221bd Reviewed-by: Sona Kurazyan <[email protected]>