Browse Source

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.
Sasha Szpakowski 2 years ago
parent
commit
70a18e115f
1 changed files with 0 additions and 2 deletions
  1. 0 2
      src/modules/graphics/vulkan/Buffer.cpp

+ 0 - 2
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)