summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2019-10-01 14:36:29 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2019-10-03 09:38:01 +0200
commit5bc972a4118927be7d2b81e4ff66be5bc274fdaa (patch)
tree04fd1b7e421901d79d9c9f501b58cd68729bc25a
parentf1c7814a55903dad5a5e77683bdcca5fc3805394 (diff)
rhi: vulkan: Disable vkmemalloc's own synchronization
No need for those mutexes. Task-number: QTBUG-78908 Change-Id: I60c32df1f8729098f1894eff7c71e7fbcbd23ecf Reviewed-by: Christian Strømme <christian.stromme@qt.io>
-rw-r--r--src/gui/rhi/qrhivulkan.cpp3
1 files changed, 3 insertions, 0 deletions
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;