Update VMA to v3.1.0

* We make BDA opt-in as it applies to all memory allocations.
This commit is contained in:
baldurk
2024-11-20 13:34:31 +00:00
parent 030f3430ee
commit 9916defb14
5 changed files with 15037 additions and 9811 deletions
+1 -1
View File
@@ -1 +1 @@
VulkanMemoryAllocator from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator at v2.1.0
VulkanMemoryAllocator from https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator at v3.1.0
File diff suppressed because it is too large Load Diff
+3
View File
@@ -85,5 +85,8 @@
// then include volk
#include "3rdparty/volk/volk.h"
// avoid warning about unused variables
#define VMA_DEBUG_LOG_FORMAT(format, ...) (void)(__VA_ARGS__);
// finally VMA
#include "3rdparty/VulkanMemoryAllocator/vk_mem_alloc.h"
+15 -1
View File
@@ -93,6 +93,8 @@ void main()
#pragma warning(push)
#pragma warning(disable : 4127)
#pragma warning(disable : 4324)
#pragma warning(disable : 4505)
#include "vk_headers.h"
@@ -717,6 +719,8 @@ bool VulkanGraphicsTest::Init()
}
VmaVulkanFunctions funcs = {
vkGetInstanceProcAddr,
vkGetDeviceProcAddr,
vkGetPhysicalDeviceProperties,
vkGetPhysicalDeviceMemoryProperties,
vkAllocateMemory,
@@ -733,17 +737,27 @@ bool VulkanGraphicsTest::Init()
vkDestroyBuffer,
vkCreateImage,
vkDestroyImage,
vkCmdCopyBuffer,
vkGetBufferMemoryRequirements2KHR,
vkGetImageMemoryRequirements2KHR,
vkBindBufferMemory2KHR,
vkBindImageMemory2KHR,
vkGetPhysicalDeviceMemoryProperties2KHR,
vkGetDeviceBufferMemoryRequirements,
vkGetDeviceImageMemoryRequirements,
};
VmaAllocatorCreateInfo allocInfo = {};
allocInfo.instance = instance;
allocInfo.physicalDevice = phys;
allocInfo.device = device;
allocInfo.frameInUseCount = 4;
allocInfo.pVulkanFunctions = &funcs;
allocInfo.vulkanApiVersion = devVersion;
if(hasExt(VK_KHR_DEDICATED_ALLOCATION_EXTENSION_NAME) && vmaDedicated)
allocInfo.flags |= VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT;
if((hasExt(VK_KHR_BUFFER_DEVICE_ADDRESS_EXTENSION_NAME) || devVersion >= VK_MAKE_VERSION(1, 2, 0)) &&
vmaBDA)
allocInfo.flags |= VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT;
vmaCreateAllocator(&allocInfo, &allocator);
+1
View File
@@ -334,6 +334,7 @@ struct VulkanGraphicsTest : public GraphicsTest
// VMA
bool vmaDedicated = false;
bool vmaBDA = false;
VmaAllocator allocator = VK_NULL_HANDLE;
private: