diff --git a/src/VmaUsage.h b/src/VmaUsage.h index eea6697..59df6c3 100644 --- a/src/VmaUsage.h +++ b/src/VmaUsage.h @@ -58,6 +58,8 @@ include all public interface declarations. Example: //#define VMA_USE_STL_SHARED_MUTEX 0 //#define VMA_DEBUG_GLOBAL_MUTEX 1 //#define VMA_MEMORY_BUDGET 0 +#define VMA_STATIC_VULKAN_FUNCTIONS 0 +#define VMA_DYNAMIC_VULKAN_FUNCTIONS 1 //#define VMA_VULKAN_VERSION 1002000 // Vulkan 1.2 #define VMA_VULKAN_VERSION 1001000 // Vulkan 1.1 diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h index b3a8b76..bab1047 100644 --- a/src/vk_mem_alloc.h +++ b/src/vk_mem_alloc.h @@ -15808,6 +15808,17 @@ void VmaAllocator_T::ImportVulkanFunctions_Dynamic() VMA_FETCH_DEVICE_FUNC(vkDestroyImage, PFN_vkDestroyImage, "vkDestroyImage"); VMA_FETCH_DEVICE_FUNC(vkCmdCopyBuffer, PFN_vkCmdCopyBuffer, "vkCmdCopyBuffer"); +#if VMA_VULKAN_VERSION >= 1001000 + if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) + { + VMA_FETCH_DEVICE_FUNC(vkGetBufferMemoryRequirements2KHR, PFN_vkGetBufferMemoryRequirements2, "vkGetBufferMemoryRequirements2"); + VMA_FETCH_DEVICE_FUNC(vkGetImageMemoryRequirements2KHR, PFN_vkGetImageMemoryRequirements2, "vkGetImageMemoryRequirements2"); + VMA_FETCH_DEVICE_FUNC(vkBindBufferMemory2KHR, PFN_vkBindBufferMemory2, "vkBindBufferMemory2"); + VMA_FETCH_DEVICE_FUNC(vkBindImageMemory2KHR, PFN_vkBindImageMemory2, "vkBindImageMemory2"); + VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2, "vkGetPhysicalDeviceMemoryProperties2"); + } +#endif + #if VMA_DEDICATED_ALLOCATION if(m_UseKhrDedicatedAllocation) { @@ -15825,7 +15836,7 @@ void VmaAllocator_T::ImportVulkanFunctions_Dynamic() #endif // #if VMA_BIND_MEMORY2 #if VMA_MEMORY_BUDGET - if(m_UseExtMemoryBudget && m_VulkanApiVersion < VK_MAKE_VERSION(1, 1, 0)) + if(m_UseExtMemoryBudget) { VMA_FETCH_INSTANCE_FUNC(vkGetPhysicalDeviceMemoryProperties2KHR, PFN_vkGetPhysicalDeviceMemoryProperties2KHR, "vkGetPhysicalDeviceMemoryProperties2KHR"); }