diff --git a/docs/html/index.html b/docs/html/index.html
index 921a093..fc99c02 100644
--- a/docs/html/index.html
+++ b/docs/html/index.html
@@ -83,7 +83,7 @@ License: MIT
diff --git a/docs/html/lost_allocations.html b/docs/html/lost_allocations.html
index d24420f..6c3dee3 100644
--- a/docs/html/lost_allocations.html
+++ b/docs/html/lost_allocations.html
@@ -77,17 +77,7 @@ $(function() {
Q: How do you inform the library when new frame starts?
You need to call function vmaSetCurrentFrameIndex().
Example code:
-struct MyBuffer
{
VkBuffer m_Buf = nullptr;
VmaAllocation m_Alloc = nullptr;
void EnsureBuffer();
};
void MyBuffer::EnsureBuffer()
{
if(m_Buf != VK_NULL_HANDLE)
{
{
return;
}
}
VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
bufCreateInfo.size = 1024;
bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &m_Buf, &m_Alloc,
nullptr);
}
When using lost allocations, you may see some Vulkan validation layer warnings about overlapping regions of memory bound to different kinds of buffers and images. This is still valid as long as you implement proper handling of lost allocations (like in the example above) and don't use them.
-The library uses following algorithm for allocation, in order:
-
-- Try to find free range of memory in existing blocks.
-- If failed, try to create a new block of
VkDeviceMemory
, with preferred block size.
-- If failed, try to create such block with size/2 and size/4.
-- If failed and VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT flag was specified, try to find space in existing blocks, possilby making some other allocations lost.
-- If failed, try to allocate separate
VkDeviceMemory
for this allocation, just like when you use VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
-- If failed, choose other memory type that meets the requirements specified in VmaAllocationCreateInfo and go to point 1.
-- If failed, return
VK_ERROR_OUT_OF_DEVICE_MEMORY
.
-
+struct MyBuffer
{
VkBuffer m_Buf = nullptr;
VmaAllocation m_Alloc = nullptr;
void EnsureBuffer();
};
void MyBuffer::EnsureBuffer()
{
if(m_Buf != VK_NULL_HANDLE)
{
{
return;
}
}
VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
bufCreateInfo.size = 1024;
bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &m_Buf, &m_Alloc,
nullptr);
}
When using lost allocations, you may see some Vulkan validation layer warnings about overlapping regions of memory bound to different kinds of buffers and images. This is still valid as long as you implement proper handling of lost allocations (like in the example above) and don't use them.