mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 13:20:54 +00:00
Update VMA to v3.1.0
* We make BDA opt-in as it applies to all memory allocations.
This commit is contained in:
@@ -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
|
||||
|
||||
+15017
-9809
File diff suppressed because it is too large
Load Diff
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -334,6 +334,7 @@ struct VulkanGraphicsTest : public GraphicsTest
|
||||
|
||||
// VMA
|
||||
bool vmaDedicated = false;
|
||||
bool vmaBDA = false;
|
||||
VmaAllocator allocator = VK_NULL_HANDLE;
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user