More coding and more tests. Basic functionality is working now.

This commit is contained in:
Adam Sawicki 2021-10-28 14:46:45 +02:00
parent dc644281ac
commit e1812303d6
2 changed files with 32 additions and 26 deletions

View file

@ -6860,10 +6860,7 @@ public:
const VkAllocationCallbacks m_AllocationCallbacks;
VmaVirtualBlock_T(const VmaVirtualBlockCreateInfo& createInfo);
~VmaVirtualBlock_T()
{
vma_delete(GetAllocationCallbacks(), m_Metadata);
}
~VmaVirtualBlock_T();
VkResult Init()
{
return VK_SUCCESS;
@ -16665,6 +16662,15 @@ VmaVirtualBlock_T::VmaVirtualBlock_T(const VmaVirtualBlockCreateInfo& createInfo
m_Metadata->Init(createInfo.size);
}
VmaVirtualBlock_T::~VmaVirtualBlock_T()
{
// This is an important assert!!!
// Hitting it means you have some memory leak - unreleased virtual allocations.
VMA_ASSERT(m_Metadata->IsEmpty() && "Some virtual allocations were not freed before destruction of this virtual block!");
vma_delete(GetAllocationCallbacks(), m_Metadata);
}
VkResult VmaVirtualBlock_T::Allocate(const VmaVirtualAllocationCreateInfo& createInfo, VkDeviceSize& outOffset)
{
outOffset = VK_WHOLE_SIZE;