From 70a18e115ff5d3605d215d4db5a0f03d8bfe5dec Mon Sep 17 00:00:00 2001 From: Sasha Szpakowski Date: Tue, 14 Feb 2023 20:18:26 -0400 Subject: [PATCH] vulkan: don't set CREATE_DEDICATED_MEMORY flag for buffer memory. It was being set all the time because of a code bug, but also documentation recommends using it very sparingly - partly because systems have a hard limit on the number of individual allocations (and they can also be a lot slower). We might want to revisit more selective use of the flag in the future. --- src/modules/graphics/vulkan/Buffer.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/modules/graphics/vulkan/Buffer.cpp b/src/modules/graphics/vulkan/Buffer.cpp index 5eaf03f6d..31b130cd9 100644 --- a/src/modules/graphics/vulkan/Buffer.cpp +++ b/src/modules/graphics/vulkan/Buffer.cpp @@ -78,8 +78,6 @@ bool Buffer::loadVolatile() allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; if (dataUsage == BUFFERDATAUSAGE_READBACK) allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT | VMA_ALLOCATION_CREATE_MAPPED_BIT; - else if ((bufferInfo.usage | VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT) || (bufferInfo.usage | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT)) - allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; auto result = vmaCreateBuffer(allocator, &bufferInfo, &allocCreateInfo, &buffer, &allocation, &allocInfo); if (result != VK_SUCCESS)