From b19740c4e5c093616d722b095a4b6e6fa110f916 Mon Sep 17 00:00:00 2001 From: Jean-Sebastien Bevilacqua Date: Tue, 26 Sep 2017 13:20:05 +0200 Subject: [PATCH] Fix vulkan calls Some calls are made in a static way --- src/vk_mem_alloc.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/src/vk_mem_alloc.h b/src/vk_mem_alloc.h index cb4b57b..61b9456 100644 --- a/src/vk_mem_alloc.h +++ b/src/vk_mem_alloc.h @@ -6393,7 +6393,13 @@ VkResult VmaAllocator_T::AllocateOwnMemory( { if(m_UnmapPersistentlyMappedMemoryCounter == 0) { - res = vkMapMemory(m_hDevice, hMemory, 0, VK_WHOLE_SIZE, 0, &pMappedData); + res = (*this->GetVulkanFunctions().vkMapMemory)( + m_hDevice, + hMemory, + 0, + VK_WHOLE_SIZE, + 0, + &pMappedData); if(res < 0) { VMA_DEBUG_LOG(" vkMapMemory FAILED"); @@ -7007,7 +7013,7 @@ void VmaAllocator_T::FreeOwnMemory(VmaAllocation allocation) if(allocation->GetMappedData() != VMA_NULL) { - vkUnmapMemory(m_hDevice, hMemory); + (*this->GetVulkanFunctions().vkUnmapMemory)(m_hDevice, hMemory); } FreeVulkanMemory(memTypeIndex, allocation->GetSize(), hMemory); @@ -7608,8 +7614,13 @@ VkResult vmaMapMemory( VMA_DEBUG_GLOBAL_MUTEX_LOCK - return vkMapMemory(allocator->m_hDevice, allocation->GetMemory(), - allocation->GetOffset(), allocation->GetSize(), 0, ppData); + return (*allocator->GetVulkanFunctions().vkMapMemory)( + allocator->m_hDevice, + allocation->GetMemory(), + allocation->GetOffset(), + allocation->GetSize(), + 0, + ppData); } void vmaUnmapMemory( @@ -7620,7 +7631,7 @@ void vmaUnmapMemory( VMA_DEBUG_GLOBAL_MUTEX_LOCK - vkUnmapMemory(allocator->m_hDevice, allocation->GetMemory()); + (*allocator->GetVulkanFunctions().vkUnmapMemory)(allocator->m_hDevice, allocation->GetMemory()); } void vmaUnmapPersistentlyMappedMemory(VmaAllocator allocator)