summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <[email protected]>2023-07-19 11:10:28 +0200
committerQt Cherry-pick Bot <[email protected]>2023-08-03 16:55:21 +0000
commit182670bcbfc5f16da0a99fcfa6c7532dc960d0d2 (patch)
tree0e2a7f019d02986ba065561b888843302fbb9504
parent0d7a4e5e9e9afb1e1c4d4bf35c259aedd3dc3493 (diff)
rhi: vulkan: use the clamped api version for vma
caps.apiVersion is inst->apiVersion() limited by the version the physical device reports. Therefore, use caps.apiVersion when setting up the memory allocator, like it is done everywhere else. This is expected prevent vma init failures on lavapipe in some Linux distros. Change-Id: I4e693820c95a5e0174846afb20e42aadd56034d6 Reviewed-by: Andy Nichols <[email protected]> (cherry picked from commit f9d473ac726fe012fe05a9e6f7502ca50c2245e5) Reviewed-by: Qt Cherry-pick Bot <[email protected]>
-rw-r--r--src/gui/rhi/qrhivulkan.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp
index 064c197af9b..db6206e4cc5 100644
--- a/src/gui/rhi/qrhivulkan.cpp
+++ b/src/gui/rhi/qrhivulkan.cpp
@@ -670,12 +670,9 @@ bool QRhiVulkan::create(QRhi::Flags flags)
allocatorInfo.device = dev;
allocatorInfo.pVulkanFunctions = &funcs;
allocatorInfo.instance = inst->vkInstance();
- const QVersionNumber apiVer = inst->apiVersion();
- if (!apiVer.isNull()) {
- allocatorInfo.vulkanApiVersion = VK_MAKE_VERSION(apiVer.majorVersion(),
- apiVer.minorVersion(),
- apiVer.microVersion());
- }
+ allocatorInfo.vulkanApiVersion = VK_MAKE_VERSION(caps.apiVersion.majorVersion(),
+ caps.apiVersion.minorVersion(),
+ caps.apiVersion.microVersion());
VmaAllocator vmaallocator;
VkResult err = vmaCreateAllocator(&allocatorInfo, &vmaallocator);
if (err != VK_SUCCESS) {