From 5bc972a4118927be7d2b81e4ff66be5bc274fdaa Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Tue, 1 Oct 2019 14:36:29 +0200 Subject: [PATCH] rhi: vulkan: Disable vkmemalloc's own synchronization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No need for those mutexes. Task-number: QTBUG-78908 Change-Id: I60c32df1f8729098f1894eff7c71e7fbcbd23ecf Reviewed-by: Christian Strømme --- src/gui/rhi/qrhivulkan.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gui/rhi/qrhivulkan.cpp b/src/gui/rhi/qrhivulkan.cpp index 3a2c35b589..c7d28a4f18 100644 --- a/src/gui/rhi/qrhivulkan.cpp +++ b/src/gui/rhi/qrhivulkan.cpp @@ -568,6 +568,9 @@ bool QRhiVulkan::create(QRhi::Flags flags) VmaAllocatorCreateInfo allocatorInfo; memset(&allocatorInfo, 0, sizeof(allocatorInfo)); + // A QRhi is supposed to be used from one single thread only. Disable + // the allocator's own mutexes. This gives a performance boost. + allocatorInfo.flags = VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT; allocatorInfo.physicalDevice = physDev; allocatorInfo.device = dev; allocatorInfo.pVulkanFunctions = &afuncs;