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.

Pick-to: 6.6 6.5
Change-Id: I4e693820c95a5e0174846afb20e42aadd56034d6
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
This commit is contained in:
Laszlo Agocs 2023-07-19 11:10:28 +02:00
parent 108b101441
commit f9d473ac72

View File

@ -771,12 +771,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) {