From defbf3d9755e2fbc8574554935cef2ee4ef1eb2e Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Tue, 23 Jan 2018 13:58:07 +0100 Subject: [PATCH] Minor fix in documentation. --- docs/html/custom_memory_pools.html | 2 +- docs/html/struct_vma_allocator_create_info.html | 8 ++++---- docs/html/vk__mem__alloc_8h_source.html | 2 +- src/vk_mem_alloc.h | 8 ++++---- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index bff6411..573c0fb 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -79,7 +79,7 @@ $(function() {
  • When making an allocation, set VmaAllocationCreateInfo::pool to this handle. You don't need to specify any other parameters of this structure, like usage.
  • Example:

    -
    // Create a pool that could have at most 2 blocks, 128 MB each.
    VmaPoolCreateInfo poolCreateInfo = {};
    poolCreateInfo.memoryTypeIndex = ...
    poolCreateInfo.blockSize = 128ull * 1024 * 1024;
    poolCreateInfo.maxBlockCount = 2;
    VmaPool pool;
    vmaCreatePool(allocator, &poolCreateInfo, &pool);
    // Allocate a buffer out of it.
    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;
    VmaAllocationCreateInfo allocCreateInfo = {};
    allocCreateInfo.pool = pool;
    VkBuffer buf;
    VmaAllocation alloc;
    vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);

    You have to free all allocations made from this pool before destroying it.

    +
    // Create a pool that could have at most 2 blocks, 128 MiB each.
    VmaPoolCreateInfo poolCreateInfo = {};
    poolCreateInfo.memoryTypeIndex = ...
    poolCreateInfo.blockSize = 128ull * 1024 * 1024;
    poolCreateInfo.maxBlockCount = 2;
    VmaPool pool;
    vmaCreatePool(allocator, &poolCreateInfo, &pool);
    // Allocate a buffer out of it.
    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;
    VmaAllocationCreateInfo allocCreateInfo = {};
    allocCreateInfo.pool = pool;
    VkBuffer buf;
    VmaAllocation alloc;
    vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);

    You have to free all allocations made from this pool before destroying it.

    vmaDestroyBuffer(allocator, buf, alloc);
    vmaDestroyPool(allocator, pool);