From 48db0e0da0067dc979857f62c1a1df3e8046ded2 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Mon, 1 Sep 2025 11:32:44 +0200 Subject: [PATCH 01/16] Fixed link to product page on GPUOpen.com --- README.md | 2 +- include/vk_mem_alloc.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 15d9cae9..3bbfece8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Easy to integrate Vulkan memory allocation library. **Changelog:** See [CHANGELOG.md](CHANGELOG.md) -**Product page:** [Vulkan Memory Allocator on GPUOpen](https://gpuopen.com/gaming-product/vulkan-memory-allocator/) +**Product page:** [Vulkan Memory Allocator on GPUOpen](https://gpuopen.com/vulkan-memory-allocator/) [![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.svg)](http://isitmaintained.com/project/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator "Average time to resolve an issue") diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 4ba3fe4e..1ec05e4e 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -29,7 +29,7 @@ Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved. \n License: MIT \n -See also: [product page on GPUOpen](https://gpuopen.com/gaming-product/vulkan-memory-allocator/), +See also: [product page on GPUOpen](https://gpuopen.com/vulkan-memory-allocator/), [repository on GitHub](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) From 1feaa24c480953440c33a135664d9e2128946484 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Mon, 1 Sep 2025 13:56:44 +0200 Subject: [PATCH 02/16] Fixes and improvements in TestWin32Handles --- src/Tests.cpp | 34 ++++++++++++++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/Tests.cpp b/src/Tests.cpp index 9c9c7bbc..0b4dc6d4 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -8492,15 +8492,20 @@ static void TestWin32Handles() return; wprintf(L"Test Win32 handles\n"); + + constexpr VkExternalMemoryHandleTypeFlagBits handleType = + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + constexpr static VkExportMemoryAllocateInfoKHR exportMemAllocInfo{ VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, nullptr, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT + handleType }; + constexpr static VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo{ VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR, nullptr, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT + handleType }; VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; @@ -8508,6 +8513,29 @@ static void TestWin32Handles() bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; bufCreateInfo.pNext = &externalMemBufCreateInfo; + bool requiresDedicated = true; + { + VkPhysicalDeviceExternalBufferInfo externalBufferInfo = { + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO }; + externalBufferInfo.flags = bufCreateInfo.flags; + externalBufferInfo.usage = bufCreateInfo.usage; + externalBufferInfo.handleType = handleType; + + VkExternalBufferProperties externalBufferProperties = { + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES }; + + vkGetPhysicalDeviceExternalBufferProperties(g_hPhysicalDevice, + &externalBufferInfo, &externalBufferProperties); + if((externalBufferProperties.externalMemoryProperties.externalMemoryFeatures & + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT) == 0) + { + wprintf(L"WARNING: External memory not exportable, skipping test.\n"); + return; + } + requiresDedicated = (externalBufferProperties.externalMemoryProperties.externalMemoryFeatures & + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT) != 0; + } + VmaAllocationCreateInfo allocCreateInfo = {}; allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; @@ -8526,6 +8554,8 @@ static void TestWin32Handles() for (size_t test = 0; test < 2; ++test) { + if(test == 0 && requiresDedicated) + continue; // Skip this case because it would fail. if (test == 1) allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; From 1ea4660c87b19e51b47e84225b9dfb7a5d8e9aa9 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Tue, 2 Sep 2025 16:10:05 +0200 Subject: [PATCH 03/16] A minor fix --- src/VulkanSample.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/VulkanSample.cpp b/src/VulkanSample.cpp index 7a844ede..c55523ed 100644 --- a/src/VulkanSample.cpp +++ b/src/VulkanSample.cpp @@ -485,7 +485,7 @@ void VulkanUsage::Init() VkApplicationInfo appInfo = { VK_STRUCTURE_TYPE_APPLICATION_INFO }; appInfo.pApplicationName = APP_TITLE_A; appInfo.applicationVersion = VK_MAKE_VERSION(1, 0, 0); - appInfo.pEngineName = "Adam Sawicki Engine"; + appInfo.pEngineName = APP_TITLE_A; appInfo.engineVersion = VK_MAKE_VERSION(1, 0, 0); appInfo.apiVersion = GetVulkanApiVersion(); From 1b086e6b8fb43f863f667078ac064950ba8ed6bf Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Tue, 2 Sep 2025 16:29:40 +0200 Subject: [PATCH 04/16] Fixed creation of g_hRenderPass to fix Validation Layer error about synchronization --- src/VulkanSample.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/VulkanSample.cpp b/src/VulkanSample.cpp index c55523ed..5b9502d3 100644 --- a/src/VulkanSample.cpp +++ b/src/VulkanSample.cpp @@ -1153,12 +1153,26 @@ static void CreateSwapchain() subpassDesc.pColorAttachments = &colorAttachmentRef; subpassDesc.pDepthStencilAttachment = &depthStencilAttachmentRef; + VkSubpassDependency dependencies[1] = {}; + dependencies[0].srcSubpass = VK_SUBPASS_EXTERNAL; + dependencies[0].dstSubpass = 0; + dependencies[0].srcStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT; + dependencies[0].dstStageMask = VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | + VK_PIPELINE_STAGE_EARLY_FRAGMENT_TESTS_BIT | VK_PIPELINE_STAGE_LATE_FRAGMENT_TESTS_BIT; + dependencies[0].srcAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + dependencies[0].dstAccessMask = VK_ACCESS_COLOR_ATTACHMENT_WRITE_BIT | + VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_WRITE_BIT; + dependencies[0].dependencyFlags = 0; + VkRenderPassCreateInfo renderPassInfo = { VK_STRUCTURE_TYPE_RENDER_PASS_CREATE_INFO }; renderPassInfo.attachmentCount = (uint32_t)_countof(attachments); renderPassInfo.pAttachments = attachments; renderPassInfo.subpassCount = 1; renderPassInfo.pSubpasses = &subpassDesc; - renderPassInfo.dependencyCount = 0; + renderPassInfo.dependencyCount = 1; + renderPassInfo.pDependencies = dependencies; ERR_GUARD_VULKAN( vkCreateRenderPass(g_hDevice, &renderPassInfo, g_Allocs, &g_hRenderPass) ); SetDebugUtilsObjectName(VK_OBJECT_TYPE_RENDER_PASS, reinterpret_cast(g_hRenderPass), "g_hRenderPass"); } From a7e9bf4004ef2ab78607f0ce4b764f8e11874eb2 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Tue, 2 Sep 2025 16:46:01 +0200 Subject: [PATCH 05/16] Fixed usage of semaphore signaled on vkAcquireNextImageKHR Based on Article "Swapchain Semaphore Reuse" in Vulkan documentation. --- src/VulkanSample.cpp | 60 ++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 22 deletions(-) diff --git a/src/VulkanSample.cpp b/src/VulkanSample.cpp index 5b9502d3..ef075110 100644 --- a/src/VulkanSample.cpp +++ b/src/VulkanSample.cpp @@ -91,8 +91,9 @@ static VkCommandBuffer g_MainCommandBuffers[COMMAND_BUFFER_COUNT]; static VkFence g_MainCommandBufferExecutedFences[COMMAND_BUFFER_COUNT]; VkFence g_ImmediateFence; static uint32_t g_NextCommandBufferIndex; -// Notice we need as many semaphores as there are swapchain images -static std::vector g_hImageAvailableSemaphores; +// Signaled by vkAcquireNextImageKHR. +static VkSemaphore g_hImageAvailableSemaphores[COMMAND_BUFFER_COUNT]; +// Notice we need as many semaphores as there are swapchain images. static std::vector g_hRenderFinishedSemaphores; static uint32_t g_SwapchainImageCount = 0; static uint32_t g_SwapchainImageIndex = 0; @@ -1365,45 +1366,58 @@ static void CreateSwapchain() // Destroy the old semaphores and create new ones - if (g_hImageAvailableSemaphores.size() < g_SwapchainImageCount) { - g_hImageAvailableSemaphores.resize(g_SwapchainImageCount); - } if (g_hRenderFinishedSemaphores.size() < g_SwapchainImageCount) { g_hRenderFinishedSemaphores.resize(g_SwapchainImageCount); } VkSemaphoreCreateInfo semaphoreInfo = { VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO }; - for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) { - if (g_hImageAvailableSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) { - vkDestroySemaphore(g_hDevice, g_hImageAvailableSemaphores[swapchain_img_index], g_Allocs); - g_hImageAvailableSemaphores[swapchain_img_index] = VK_NULL_HANDLE; + for (std::size_t i = COMMAND_BUFFER_COUNT; i--; ) + { + if (g_hImageAvailableSemaphores[i] != VK_NULL_HANDLE) + { + vkDestroySemaphore(g_hDevice, g_hImageAvailableSemaphores[i], g_Allocs); + g_hImageAvailableSemaphores[i] = VK_NULL_HANDLE; } + } + for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) { if (g_hRenderFinishedSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) { vkDestroySemaphore(g_hDevice, g_hRenderFinishedSemaphores[swapchain_img_index], g_Allocs); g_hRenderFinishedSemaphores[swapchain_img_index] = VK_NULL_HANDLE; } } - for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) { - ERR_GUARD_VULKAN(vkCreateSemaphore(g_hDevice, &semaphoreInfo, g_Allocs, &g_hImageAvailableSemaphores[swapchain_img_index])); - std::string semaphoreName = "g_hImageAvailableSemaphores[" + std::to_string(swapchain_img_index) + "]"; - SetDebugUtilsObjectName(VK_OBJECT_TYPE_SEMAPHORE, reinterpret_cast(g_hImageAvailableSemaphores[swapchain_img_index]), semaphoreName); + for (std::size_t i = 0; i < COMMAND_BUFFER_COUNT; ++i) + { + ERR_GUARD_VULKAN(vkCreateSemaphore(g_hDevice, &semaphoreInfo, g_Allocs, &g_hImageAvailableSemaphores[i])); + std::string semaphoreName = "g_hImageAvailableSemaphores[" + std::to_string(i) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_SEMAPHORE, + reinterpret_cast(g_hImageAvailableSemaphores[i]), semaphoreName); + } + for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) + { ERR_GUARD_VULKAN(vkCreateSemaphore(g_hDevice, &semaphoreInfo, g_Allocs, &g_hRenderFinishedSemaphores[swapchain_img_index])); - semaphoreName = "g_hRenderFinishedSemaphores[" + std::to_string(swapchain_img_index) + "]"; - SetDebugUtilsObjectName(VK_OBJECT_TYPE_SEMAPHORE, reinterpret_cast(g_hRenderFinishedSemaphores[swapchain_img_index]), semaphoreName); + std::string semaphoreName = "g_hRenderFinishedSemaphores[" + std::to_string(swapchain_img_index) + "]"; + SetDebugUtilsObjectName(VK_OBJECT_TYPE_SEMAPHORE, + reinterpret_cast(g_hRenderFinishedSemaphores[swapchain_img_index]), semaphoreName); } } static void DestroySwapchain(bool destroyActualSwapchain) { - for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) { - if (g_hImageAvailableSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) { - vkDestroySemaphore(g_hDevice, g_hImageAvailableSemaphores[swapchain_img_index], g_Allocs); - g_hImageAvailableSemaphores[swapchain_img_index] = VK_NULL_HANDLE; + for (std::size_t i = 0; i < COMMAND_BUFFER_COUNT; i++) + { + if (g_hImageAvailableSemaphores[i] != VK_NULL_HANDLE) + { + vkDestroySemaphore(g_hDevice, g_hImageAvailableSemaphores[i], g_Allocs); + g_hImageAvailableSemaphores[i] = VK_NULL_HANDLE; } - if (g_hRenderFinishedSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) { + } + for (std::size_t swapchain_img_index = 0; swapchain_img_index < g_SwapchainImageCount; swapchain_img_index++) + { + if (g_hRenderFinishedSemaphores.at(swapchain_img_index) != VK_NULL_HANDLE) + { vkDestroySemaphore(g_hDevice, g_hRenderFinishedSemaphores[swapchain_img_index], g_Allocs); g_hRenderFinishedSemaphores[swapchain_img_index] = VK_NULL_HANDLE; } @@ -2405,9 +2419,11 @@ static void DrawFrame() ERR_GUARD_VULKAN( vkBeginCommandBuffer(hCommandBuffer, &commandBufferBeginInfo) ); SetDebugUtilsObjectName(VK_OBJECT_TYPE_COMMAND_BUFFER, reinterpret_cast(hCommandBuffer), "hCommandBuffer"); + const VkSemaphore imageAvailableSemaphore = g_hImageAvailableSemaphores[cmdBufIndex]; + // Acquire swapchain image uint32_t imageIndex = 0; - VkResult res = vkAcquireNextImageKHR(g_hDevice, g_hSwapchain, UINT64_MAX, g_hImageAvailableSemaphores.at(g_SwapchainImageIndex), VK_NULL_HANDLE, &imageIndex); + VkResult res = vkAcquireNextImageKHR(g_hDevice, g_hSwapchain, UINT64_MAX, imageAvailableSemaphore, VK_NULL_HANDLE, &imageIndex); if(res == VK_ERROR_OUT_OF_DATE_KHR) { RecreateSwapChain(); @@ -2485,7 +2501,7 @@ static void DrawFrame() // Submit command buffer - VkSemaphore submitWaitSemaphores[] = { g_hImageAvailableSemaphores.at(g_SwapchainImageIndex)}; + VkSemaphore submitWaitSemaphores[] = { imageAvailableSemaphore }; VkPipelineStageFlags submitWaitStages[] = { VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT }; VkSemaphore submitSignalSemaphores[] = { g_hRenderFinishedSemaphores.at(g_SwapchainImageIndex)}; VkSubmitInfo submitInfo = { VK_STRUCTURE_TYPE_SUBMIT_INFO }; From e83e606932cfc53b6cb10ec1712dec7fca467731 Mon Sep 17 00:00:00 2001 From: Ilya Doroshenko Date: Tue, 2 Sep 2025 19:34:52 +0200 Subject: [PATCH 06/16] Added vmaGetMemoryWin32Handle2 with selectable type of handle to export --- include/vk_mem_alloc.h | 84 ++++++++++++++++++++++++++++++------------ src/Tests.cpp | 4 +- 2 files changed, 62 insertions(+), 26 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 4ba3fe4e..e5e26f85 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -2167,8 +2167,18 @@ or by manually passing it through VmaAllocatorCreateInfo::pVulkanFunctions. For more information, see chapter \ref vk_khr_external_memory_win32. */ -VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle(VmaAllocator VMA_NOT_NULL allocator, - VmaAllocation VMA_NOT_NULL allocation, HANDLE hTargetProcess, HANDLE* VMA_NOT_NULL pHandle); +VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle( + VmaAllocator VMA_NOT_NULL allocator, + VmaAllocation VMA_NOT_NULL allocation, + HANDLE hTargetProcess, + HANDLE* VMA_NOT_NULL pHandle); + +VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle2( + VmaAllocator VMA_NOT_NULL allocator, + VmaAllocation VMA_NOT_NULL allocation, + VkExternalMemoryHandleTypeFlagBits handleType, + HANDLE hTargetProcess, + HANDLE* VMA_NOT_NULL pHandle); #endif // VMA_EXTERNAL_MEMORY_WIN32 /** \brief Maps memory represented by given allocation and returns pointer to it. @@ -6204,40 +6214,45 @@ class VmaWin32Handle { public: VmaWin32Handle() noexcept : m_hHandle(VMA_NULL) { } - explicit VmaWin32Handle(HANDLE hHandle) noexcept : m_hHandle(hHandle) { } - ~VmaWin32Handle() noexcept { if (m_hHandle != VMA_NULL) { ::CloseHandle(m_hHandle); } } + explicit VmaWin32Handle(HANDLE hHandle) noexcept + : m_hHandle(hHandle) + , m_IsNTHandle(IsNTHandle(hHandle)) + { + } + ~VmaWin32Handle() noexcept { if (m_hHandle != VMA_NULL && m_IsNTHandle) { ::CloseHandle(m_hHandle); } } VMA_CLASS_NO_COPY_NO_MOVE(VmaWin32Handle) public: // Strengthened - VkResult GetHandle(VkDevice device, VkDeviceMemory memory, PFN_vkGetMemoryWin32HandleKHR pvkGetMemoryWin32HandleKHR, HANDLE hTargetProcess, bool useMutex, HANDLE* pHandle) noexcept + VkResult GetHandle(VkDevice device, VkDeviceMemory memory, PFN_vkGetMemoryWin32HandleKHR pvkGetMemoryWin32HandleKHR, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, bool useMutex, HANDLE* pHandle) noexcept { *pHandle = VMA_NULL; // Try to get handle first. - if (m_hHandle != VMA_NULL) - { - *pHandle = Duplicate(hTargetProcess); - return VK_SUCCESS; - } - VkResult res = VK_SUCCESS; - // If failed, try to create it. + if (m_hHandle == VMA_NULL) { VmaMutexLockWrite lock(m_Mutex, useMutex); if (m_hHandle == VMA_NULL) { - res = Create(device, memory, pvkGetMemoryWin32HandleKHR, &m_hHandle); + res = Create(device, memory, pvkGetMemoryWin32HandleKHR, handleType, &m_hHandle); + if (res != VK_SUCCESS) { + m_hHandle = VMA_NULL; + return res; + } + m_IsNTHandle = IsNTHandle(m_hHandle); } } - - *pHandle = Duplicate(hTargetProcess); + if (res == VK_SUCCESS) { + // KMT handle is returned as is. + *pHandle = m_IsNTHandle ? Duplicate(hTargetProcess) : m_hHandle; + } return res; } operator bool() const noexcept { return m_hHandle != VMA_NULL; } private: // Not atomic - static VkResult Create(VkDevice device, VkDeviceMemory memory, PFN_vkGetMemoryWin32HandleKHR pvkGetMemoryWin32HandleKHR, HANDLE* pHandle) noexcept + static VkResult Create(VkDevice device, VkDeviceMemory memory, PFN_vkGetMemoryWin32HandleKHR pvkGetMemoryWin32HandleKHR, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE* pHandle) noexcept { VkResult res = VK_ERROR_FEATURE_NOT_PRESENT; if (pvkGetMemoryWin32HandleKHR != VMA_NULL) @@ -6245,7 +6260,7 @@ class VmaWin32Handle VkMemoryGetWin32HandleInfoKHR handleInfo{ }; handleInfo.sType = VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR; handleInfo.memory = memory; - handleInfo.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; + handleInfo.handleType = handleType; res = pvkGetMemoryWin32HandleKHR(device, &handleInfo, pHandle); } return res; @@ -6263,9 +6278,15 @@ class VmaWin32Handle } return hDupHandle; } + static bool IsNTHandle(HANDLE hHandle) noexcept + { + DWORD flags = 0; + return (hHandle != VMA_NULL) ? (::GetHandleInformation(hHandle, &flags) != 0) : false; + } private: HANDLE m_hHandle; VMA_RW_MUTEX m_Mutex; // Protects access m_Handle + bool m_IsNTHandle = false; // True if m_Handle is NT handle, false if it's a KMT handle. }; #else class VmaWin32Handle @@ -6273,6 +6294,7 @@ class VmaWin32Handle // ABI compatibility void* placeholder = VMA_NULL; VMA_RW_MUTEX placeholder2; + bool placeholder3 = false; }; #endif // VMA_EXTERNAL_MEMORY_WIN32 @@ -6347,6 +6369,7 @@ class VmaDeviceMemoryBlock VkResult CreateWin32Handle( const VmaAllocator hAllocator, PFN_vkGetMemoryWin32HandleKHR pvkGetMemoryWin32HandleKHR, + VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE* pHandle)noexcept; #endif // VMA_EXTERNAL_MEMORY_WIN32 @@ -6461,7 +6484,7 @@ struct VmaAllocation_T #endif #if VMA_EXTERNAL_MEMORY_WIN32 - VkResult GetWin32Handle(VmaAllocator hAllocator, HANDLE hTargetProcess, HANDLE* hHandle) noexcept; + VkResult GetWin32Handle(VmaAllocator hAllocator, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE* hHandle) noexcept; #endif // VMA_EXTERNAL_MEMORY_WIN32 private: @@ -10905,10 +10928,10 @@ VkResult VmaDeviceMemoryBlock::BindImageMemory( } #if VMA_EXTERNAL_MEMORY_WIN32 -VkResult VmaDeviceMemoryBlock::CreateWin32Handle(const VmaAllocator hAllocator, PFN_vkGetMemoryWin32HandleKHR pvkGetMemoryWin32HandleKHR, HANDLE hTargetProcess, HANDLE* pHandle) noexcept +VkResult VmaDeviceMemoryBlock::CreateWin32Handle(const VmaAllocator hAllocator, PFN_vkGetMemoryWin32HandleKHR pvkGetMemoryWin32HandleKHR, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE* pHandle) noexcept { VMA_ASSERT(pHandle); - return m_Handle.GetHandle(hAllocator->m_hDevice, m_hMemory, pvkGetMemoryWin32HandleKHR, hTargetProcess, hAllocator->m_UseMutex, pHandle); + return m_Handle.GetHandle(hAllocator->m_hDevice, m_hMemory, pvkGetMemoryWin32HandleKHR, handleType, hTargetProcess, hAllocator->m_UseMutex, pHandle); } #endif // VMA_EXTERNAL_MEMORY_WIN32 #endif // _VMA_DEVICE_MEMORY_BLOCK_FUNCTIONS @@ -11226,16 +11249,16 @@ void VmaAllocation_T::PrintParameters(class VmaJsonWriter& json) const } } #if VMA_EXTERNAL_MEMORY_WIN32 -VkResult VmaAllocation_T::GetWin32Handle(VmaAllocator hAllocator, HANDLE hTargetProcess, HANDLE* pHandle) noexcept +VkResult VmaAllocation_T::GetWin32Handle(VmaAllocator hAllocator, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE* pHandle) noexcept { auto pvkGetMemoryWin32HandleKHR = hAllocator->GetVulkanFunctions().vkGetMemoryWin32HandleKHR; switch (m_Type) { case ALLOCATION_TYPE_BLOCK: - return m_BlockAllocation.m_Block->CreateWin32Handle(hAllocator, pvkGetMemoryWin32HandleKHR, hTargetProcess, pHandle); + return m_BlockAllocation.m_Block->CreateWin32Handle(hAllocator, pvkGetMemoryWin32HandleKHR, handleType, hTargetProcess, pHandle); case ALLOCATION_TYPE_DEDICATED: EnsureExtraData(hAllocator); - return m_DedicatedAllocation.m_ExtraData->m_Handle.GetHandle(hAllocator->m_hDevice, m_DedicatedAllocation.m_hMemory, pvkGetMemoryWin32HandleKHR, hTargetProcess, hAllocator->m_UseMutex, pHandle); + return m_DedicatedAllocation.m_ExtraData->m_Handle.GetHandle(hAllocator->m_hDevice, m_DedicatedAllocation.m_hMemory, pvkGetMemoryWin32HandleKHR, handleType, hTargetProcess, hAllocator->m_UseMutex, pHandle); default: VMA_ASSERT(0); return VK_ERROR_FEATURE_NOT_PRESENT; @@ -16842,7 +16865,20 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle(VmaAllocator VMA_NOT { VMA_ASSERT(allocator && allocation && pHandle); VMA_DEBUG_GLOBAL_MUTEX_LOCK; - return allocation->GetWin32Handle(allocator, hTargetProcess, pHandle); + return allocation->GetWin32Handle(allocator, VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, hTargetProcess, pHandle); +} +VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle2(VmaAllocator VMA_NOT_NULL allocator, + VmaAllocation VMA_NOT_NULL allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE* VMA_NOT_NULL pHandle) +{ + VMA_ASSERT(allocator && allocation && pHandle); + VMA_ASSERT(handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR || + handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR || + handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR || + handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR || + handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR || + handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR); + VMA_DEBUG_GLOBAL_MUTEX_LOCK; + return allocation->GetWin32Handle(allocator, handleType, hTargetProcess, pHandle); } #endif // VMA_EXTERNAL_MEMORY_WIN32 #endif // VMA_STATS_STRING_ENABLED diff --git a/src/Tests.cpp b/src/Tests.cpp index 9c9c7bbc..800dfe2b 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -380,7 +380,7 @@ VkResult MainTest(Result& outResult, const Config& config) time_point timeBeg = std::chrono::high_resolution_clock::now(); - std::atomic allocationCount = 0; + std::atomic allocationCount{ 0 }; VkResult res = VK_SUCCESS; uint32_t memUsageProbabilitySum = @@ -545,7 +545,7 @@ VkResult MainTest(Result& outResult, const Config& config) } }; - std::atomic numThreadsReachedMaxAllocations = 0; + std::atomic numThreadsReachedMaxAllocations{ 0 }; HANDLE threadsFinishEvent = CreateEvent(NULL, TRUE, FALSE, NULL); auto ThreadProc = [&](uint32_t randSeed) -> void From 16ad2f8f40c2ce79149ee8e010d8f0aef24362dd Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 09:00:00 +0200 Subject: [PATCH 07/16] Updated and reorganized documentation after adding function vmaGetMemoryWin32Handle2 Rebuilt the docs using Doxygen 1.14.0. --- README.md | 4 +- docs/html/allocation_annotation.html | 33 +- docs/html/annotated.html | 23 +- docs/html/choosing_memory_type.html | 57 +- docs/html/classes.html | 21 +- docs/html/clipboard.js | 4 +- docs/html/configuration.html | 51 +- docs/html/custom_memory_pools.html | 59 +- docs/html/debugging_memory_usage.html | 55 +- docs/html/defragmentation.html | 45 +- docs/html/deprecated.html | 33 +- .../dir_d44c64559bbebec7f509842c48db8b23.html | 30 +- docs/html/doxygen.css | 1493 ++++++++++------- docs/html/doxygen_crawl.html | 18 +- docs/html/dynsections.js | 71 +- docs/html/enabling_buffer_device_address.html | 43 +- docs/html/faq.html | 50 +- docs/html/files.html | 25 +- docs/html/functions.html | 47 +- docs/html/functions_vars.html | 47 +- docs/html/general_considerations.html | 51 +- docs/html/globals.html | 26 +- docs/html/globals_enum.html | 21 +- docs/html/globals_eval.html | 23 +- docs/html/globals_func.html | 24 +- docs/html/globals_type.html | 25 +- docs/html/group__group__alloc.html | 489 +++--- docs/html/group__group__init.html | 123 +- docs/html/group__group__stats.html | 61 +- docs/html/group__group__virtual.html | 91 +- docs/html/index.html | 31 +- docs/html/memory_mapping.html | 53 +- docs/html/menu.js | 13 +- docs/html/navtree.css | 230 ++- docs/html/other_api_interop.html | 163 +- docs/html/pages.html | 21 +- docs/html/quick_start.html | 93 +- docs/html/resource_aliasing.html | 33 +- docs/html/search/all_0.js | 6 +- docs/html/search/all_14.js | 334 ++-- docs/html/search/all_15.js | 2 +- docs/html/search/all_2.js | 2 +- docs/html/search/all_4.js | 6 +- docs/html/search/all_7.js | 2 +- docs/html/search/all_8.js | 4 +- docs/html/search/all_b.js | 4 +- docs/html/search/all_e.js | 2 +- docs/html/search/functions_0.js | 37 +- docs/html/search/pages_0.js | 35 +- docs/html/search/pages_1.js | 6 +- docs/html/search/pages_10.js | 8 +- docs/html/search/pages_11.js | 14 +- docs/html/search/pages_12.js | 12 +- docs/html/search/pages_13.js | 11 +- docs/html/search/pages_14.js | 15 + docs/html/search/pages_15.js | 8 + docs/html/search/pages_2.js | 22 +- docs/html/search/pages_3.js | 19 +- docs/html/search/pages_4.js | 8 +- docs/html/search/pages_5.js | 10 +- docs/html/search/pages_6.js | 3 +- docs/html/search/pages_7.js | 5 +- docs/html/search/pages_8.js | 9 +- docs/html/search/pages_9.js | 7 +- docs/html/search/pages_a.js | 6 +- docs/html/search/pages_b.js | 21 +- docs/html/search/pages_c.js | 7 +- docs/html/search/pages_d.js | 9 +- docs/html/search/pages_e.js | 10 +- docs/html/search/pages_f.js | 6 +- docs/html/search/search.css | 177 +- docs/html/search/search.js | 24 +- docs/html/search/searchdata.js | 2 +- docs/html/statistics.html | 29 +- docs/html/staying_within_budget.html | 37 +- docs/html/struct_vma_allocation.html | 29 +- ...ct_vma_allocation_create_info-members.html | 21 +- .../struct_vma_allocation_create_info.html | 51 +- .../struct_vma_allocation_info-members.html | 21 +- docs/html/struct_vma_allocation_info.html | 44 +- .../struct_vma_allocation_info2-members.html | 21 +- docs/html/struct_vma_allocation_info2.html | 46 +- docs/html/struct_vma_allocator.html | 29 +- ...uct_vma_allocator_create_info-members.html | 21 +- .../struct_vma_allocator_create_info.html | 66 +- .../struct_vma_allocator_info-members.html | 21 +- docs/html/struct_vma_allocator_info.html | 34 +- docs/html/struct_vma_budget-members.html | 21 +- docs/html/struct_vma_budget.html | 38 +- .../struct_vma_defragmentation_context.html | 27 +- ...ruct_vma_defragmentation_info-members.html | 21 +- .../html/struct_vma_defragmentation_info.html | 41 +- ...ruct_vma_defragmentation_move-members.html | 21 +- .../html/struct_vma_defragmentation_move.html | 40 +- ...efragmentation_pass_move_info-members.html | 21 +- ...ct_vma_defragmentation_pass_move_info.html | 41 +- ...uct_vma_defragmentation_stats-members.html | 21 +- .../struct_vma_defragmentation_stats.html | 43 +- ...truct_vma_detailed_statistics-members.html | 21 +- docs/html/struct_vma_detailed_statistics.html | 45 +- ...t_vma_device_memory_callbacks-members.html | 21 +- .../struct_vma_device_memory_callbacks.html | 38 +- docs/html/struct_vma_pool.html | 27 +- .../struct_vma_pool_create_info-members.html | 21 +- docs/html/struct_vma_pool_create_info.html | 55 +- docs/html/struct_vma_statistics-members.html | 21 +- docs/html/struct_vma_statistics.html | 49 +- .../struct_vma_total_statistics-members.html | 21 +- docs/html/struct_vma_total_statistics.html | 34 +- docs/html/struct_vma_virtual_allocation.html | 29 +- ...irtual_allocation_create_info-members.html | 21 +- ...ct_vma_virtual_allocation_create_info.html | 35 +- ...t_vma_virtual_allocation_info-members.html | 21 +- .../struct_vma_virtual_allocation_info.html | 34 +- docs/html/struct_vma_virtual_block.html | 27 +- ...vma_virtual_block_create_info-members.html | 21 +- .../struct_vma_virtual_block_create_info.html | 34 +- .../struct_vma_vulkan_functions-members.html | 21 +- docs/html/struct_vma_vulkan_functions.html | 58 +- docs/html/tabs.css | 2 +- docs/html/topics.html | 21 +- docs/html/usage_patterns.html | 57 +- docs/html/virtual_allocator.html | 45 +- docs/html/vk__mem__alloc_8h.html | 232 +-- docs/html/vk_amd_device_coherent_memory.html | 49 +- docs/html/vk_ext_memory_priority.html | 43 +- docs/html/vk_khr_dedicated_allocation.html | 31 +- docs/html/vk_khr_external_memory_win32.html | 78 +- include/vk_mem_alloc.h | 370 ++-- 129 files changed, 3162 insertions(+), 3858 deletions(-) create mode 100644 docs/html/search/pages_14.js create mode 100644 docs/html/search/pages_15.js diff --git a/README.md b/README.md index 3bbfece8..aa0c4c3f 100644 --- a/README.md +++ b/README.md @@ -44,7 +44,7 @@ Additional features: - Custom memory pools: Create a pool with desired parameters (e.g. fixed or limited maximum size) and allocate memory out of it. - Linear allocator: Create a pool with linear algorithm and use it for much faster allocations and deallocations in free-at-once, stack, double stack, or ring buffer fashion. - Support for Vulkan 1.0...1.4. -- Support for extensions (and equivalent functionality included in new Vulkan versions): +- Support for extensions (and equivalent functionality included in new core Vulkan versions): - VK_KHR_dedicated_allocation: Just enable it and it will be used automatically by the library. - VK_KHR_bind_memory2. - VK_KHR_maintenance4. @@ -60,7 +60,7 @@ Additional features: - JSON dump: Obtain a string in JSON format with detailed map of internal state, including list of allocations, their string names, and gaps between them. - Convert this JSON dump into a picture to visualize your memory. See [tools/GpuMemDumpVis](tools/GpuMemDumpVis/README.md). - Debugging incorrect memory usage: Enable initialization of all allocated memory with a bit pattern to detect usage of uninitialized or freed memory. Enable validation of a magic number after every allocation to detect out-of-bounds memory corruption. -- Support for interoperability with OpenGL. +- Support for interoperability with OpenGL, Direct3D, and other graphics APIs through external memory export. - Virtual allocator: Interface for using core allocation algorithm to allocate any custom data, e.g. pieces of one large buffer. # Prerequisites diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html index dc19902a..aab7d3fd 100644 --- a/docs/html/allocation_annotation.html +++ b/docs/html/allocation_annotation.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Allocation names and user data - - @@ -33,33 +31,22 @@ - + -
-
Allocation names and user data
+
Allocation names and user data
-

+

Allocation user data

-

You can annotate allocations with your own information, e.g. for debugging purposes. To do that, fill VmaAllocationCreateInfo::pUserData field when creating an allocation. It is an opaque void* pointer. You can use it e.g. as a pointer, some handle, index, key, ordinal number or any other value that would associate the allocation with your custom metadata. It is useful to identify appropriate data structures in your engine given VmaAllocation, e.g. when doing Defragmentation.

+

You can annotate allocations with your own information, e.g. for debugging purposes. To do that, fill VmaAllocationCreateInfo::pUserData field when creating an allocation. It is an opaque void* pointer. You can use it e.g. as a pointer, some handle, index, key, ordinal number or any other value that would associate the allocation with your custom metadata. It is useful to identify appropriate data structures in your engine given VmaAllocation, e.g. when doing Defragmentation.

VkBufferCreateInfo bufCreateInfo = ...
MyBufferMetadata* pMetadata = CreateBufferMetadata();
@@ -119,8 +106,8 @@
Definition vk_mem_alloc.h:1410
void * pUserData
Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
Definition vk_mem_alloc.h:1457

It can also be changed using function vmaSetAllocationUserData().

-

Values of (non-zero) allocations' pUserData are printed in JSON report created by vmaBuildStatsString() in hexadecimal form.

-

+

Values of (non-zero) allocations' pUserData are printed in JSON report created by vmaBuildStatsString() in hexadecimal form.

+

Allocation names

An allocation can also carry a null-terminated string, giving a name to the allocation. To set it, call vmaSetAllocationName(). The library creates internal copy of the string, so the pointer you pass doesn't need to be valid for whole lifetime of the allocation. You can free it after the call.

std::string imageName = "Texture: ";
@@ -133,7 +120,7 @@

diff --git a/docs/html/annotated.html b/docs/html/annotated.html index f406311b..4080b50a 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Class List - - @@ -33,35 +31,24 @@

- +
-
 CVmaDefragmentationPassMoveInfoParameters for incremental defragmentation steps  CVmaDefragmentationStatsStatistics returned for defragmentation process in function vmaEndDefragmentation()  CVmaDetailedStatisticsMore detailed statistics than VmaStatistics - CVmaDeviceMemoryCallbacksSet of callbacks that the library will call for vkAllocateMemory and vkFreeMemory + CVmaDeviceMemoryCallbacksSet of callbacks that the library will call for vkAllocateMemory and vkFreeMemory  CVmaPoolRepresents custom memory pool  CVmaPoolCreateInfoDescribes parameter of created VmaPool  CVmaStatisticsCalculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total @@ -119,7 +106,7 @@
diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html index e44dfaca..cdcb3b9b 100644 --- a/docs/html/choosing_memory_type.html +++ b/docs/html/choosing_memory_type.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Choosing memory type - - @@ -33,33 +31,22 @@
- + -
-
Choosing memory type
+
Choosing memory type

Physical devices in Vulkan support various combinations of memory heaps and types. Help with choosing correct and optimal memory type for your specific resource is one of the key features of this library. You can use it by filling appropriate members of VmaAllocationCreateInfo structure, as described below. You can also combine multiple methods.

@@ -98,13 +85,13 @@
  • If you already have a buffer or an image created, you want to allocate memory for it and then you will bind it yourself, you can use function vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(). For binding you should use functions: vmaBindBufferMemory(), vmaBindImageMemory() or their extended versions: vmaBindBufferMemory2(), vmaBindImageMemory2().
  • If you want to create a buffer or an image, allocate memory for it, and bind them together, all in one call, you can use function vmaCreateBuffer(), vmaCreateImage(). This is the easiest and recommended way to use this library!
  • -

    When using 3. or 4., the library internally queries Vulkan for memory types supported for that buffer or image (function vkGetBufferMemoryRequirements()) and uses only one of these types.

    -

    If no memory type can be found that meets all the requirements, these functions return VK_ERROR_FEATURE_NOT_PRESENT.

    +

    When using 3. or 4., the library internally queries Vulkan for memory types supported for that buffer or image (function vkGetBufferMemoryRequirements()) and uses only one of these types.

    +

    If no memory type can be found that meets all the requirements, these functions return VK_ERROR_FEATURE_NOT_PRESENT.

    You can leave VmaAllocationCreateInfo structure completely filled with zeros. It means no requirements are specified for memory type. It is valid, although not very useful.

    -

    +

    Usage

    The easiest way to specify memory requirements is to fill member VmaAllocationCreateInfo::usage using one of the values of enum VmaMemoryUsage. It defines high level, common usage types. Since version 3 of the library, it is recommended to use VMA_MEMORY_USAGE_AUTO to let it select best memory type for your resource automatically.

    -

    For example, if you want to create a uniform buffer that will be filled using transfer only once or infrequently and then used for rendering every frame as a uniform buffer, you can do it using following code. The buffer will most likely end up in a memory type with VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT to be fast to access by the GPU device.

    +

    For example, if you want to create a uniform buffer that will be filled using transfer only once or infrequently and then used for rendering every frame as a uniform buffer, you can do it using following code. The buffer will most likely end up in a memory type with VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT to be fast to access by the GPU device.

    VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    bufferInfo.size = 65536;
    bufferInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
    @@ -121,8 +108,8 @@

    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1299
    Represents single memory allocation.

    If you have a preference for putting the resource in GPU (device) memory or CPU (host) memory on systems with discrete graphics card that have the memories separate, you can use VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE or VMA_MEMORY_USAGE_AUTO_PREFER_HOST.

    -

    When using VMA_MEMORY_USAGE_AUTO* while you want to map the allocated memory, you also need to specify one of the host access flags: VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. This will help the library decide about preferred memory type to ensure it has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT so you can map it.

    -

    For example, a staging buffer that will be filled via mapped pointer and then used as a source of transfer to the buffer described previously can be created like this. It will likely end up in a memory type that is HOST_VISIBLE and HOST_COHERENT but not HOST_CACHED (meaning uncached, write-combined) and not DEVICE_LOCAL (meaning system RAM).

    +

    When using VMA_MEMORY_USAGE_AUTO* while you want to map the allocated memory, you also need to specify one of the host access flags: VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. This will help the library decide about preferred memory type to ensure it has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT so you can map it.

    +

    For example, a staging buffer that will be filled via mapped pointer and then used as a source of transfer to the buffer described previously can be created like this. It will likely end up in a memory type that is HOST_VISIBLE and HOST_COHERENT but not HOST_CACHED (meaning uncached, write-combined) and not DEVICE_LOCAL (meaning system RAM).

    VkBufferCreateInfo stagingBufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    stagingBufferInfo.size = 65536;
    stagingBufferInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
    @@ -137,11 +124,11 @@

    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
    Definition vk_mem_alloc.h:659
    VmaAllocationCreateFlags flags
    Use VmaAllocationCreateFlagBits enum.
    Definition vk_mem_alloc.h:1293

    For more examples of creating different kinds of resources, see chapter Recommended usage patterns. See also: Memory mapping.

    -

    Usage values VMA_MEMORY_USAGE_AUTO* are legal to use only when the library knows about the resource being created by having VkBufferCreateInfo / VkImageCreateInfo passed, so they work with functions like: vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo() etc. If you allocate raw memory using function vmaAllocateMemory(), you have to use other means of selecting memory type, as described below.

    -
    Note
    Old usage values (VMA_MEMORY_USAGE_GPU_ONLY, VMA_MEMORY_USAGE_CPU_ONLY, VMA_MEMORY_USAGE_CPU_TO_GPU, VMA_MEMORY_USAGE_GPU_TO_CPU, VMA_MEMORY_USAGE_CPU_COPY) are still available and work same way as in previous versions of the library for backward compatibility, but they are deprecated.
    -

    +

    Usage values VMA_MEMORY_USAGE_AUTO* are legal to use only when the library knows about the resource being created by having VkBufferCreateInfo / VkImageCreateInfo passed, so they work with functions like: vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo() etc. If you allocate raw memory using function vmaAllocateMemory(), you have to use other means of selecting memory type, as described below.

    +
    Note
    Old usage values (VMA_MEMORY_USAGE_GPU_ONLY, VMA_MEMORY_USAGE_CPU_ONLY, VMA_MEMORY_USAGE_CPU_TO_GPU, VMA_MEMORY_USAGE_GPU_TO_CPU, VMA_MEMORY_USAGE_CPU_COPY) are still available and work same way as in previous versions of the library for backward compatibility, but they are deprecated.
    +

    Required and preferred flags

    -

    You can specify more detailed requirements by filling members VmaAllocationCreateInfo::requiredFlags and VmaAllocationCreateInfo::preferredFlags with a combination of bits from enum VkMemoryPropertyFlags. For example, if you want to create a buffer that will be persistently mapped on host (so it must be HOST_VISIBLE) and preferably will also be HOST_COHERENT and HOST_CACHED, use following code:

    +

    You can specify more detailed requirements by filling members VmaAllocationCreateInfo::requiredFlags and VmaAllocationCreateInfo::preferredFlags with a combination of bits from enum VkMemoryPropertyFlags. For example, if you want to create a buffer that will be persistently mapped on host (so it must be HOST_VISIBLE) and preferably will also be HOST_COHERENT and HOST_CACHED, use following code:

    VmaAllocationCreateInfo allocInfo = {};
    allocInfo.requiredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT;
    allocInfo.preferredFlags = VK_MEMORY_PROPERTY_HOST_COHERENT_BIT | VK_MEMORY_PROPERTY_HOST_CACHED_BIT;
    @@ -156,9 +143,9 @@

    VkMemoryPropertyFlags requiredFlags
    Flags that must be set in a Memory Type chosen for an allocation.
    Definition vk_mem_alloc.h:1304

    A memory type is chosen that has all the required flags and as many preferred flags set as possible.

    Value passed in VmaAllocationCreateInfo::usage is internally converted to a set of required and preferred flags, plus some extra "magic" (heuristics).

    -

    +

    Explicit memory types

    -

    If you inspected memory types available on the physical device and you have a preference for memory types that you want to use, you can fill member VmaAllocationCreateInfo::memoryTypeBits. It is a bit mask, where each bit set means that a memory type with that index is allowed to be used for the allocation. Special value 0, just like UINT32_MAX, means there are no restrictions to memory type index.

    +

    If you inspected memory types available on the physical device and you have a preference for memory types that you want to use, you can fill member VmaAllocationCreateInfo::memoryTypeBits. It is a bit mask, where each bit set means that a memory type with that index is allowed to be used for the allocation. Special value 0, just like UINT32_MAX, means there are no restrictions to memory type index.

    Please note that this member is NOT just a memory type index. Still you can use it to choose just one, specific memory type. For example, if you already determined that your buffer should be created in memory type 2, use following code:

    uint32_t memoryTypeIndex = 2;
    @@ -169,19 +156,19 @@

    VmaAllocation allocation;
    vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
    uint32_t memoryTypeBits
    Bitmask containing one bit set for every memory type acceptable for this allocation.
    Definition vk_mem_alloc.h:1317
    -

    You can also use this parameter to exclude some memory types. If you inspect memory heaps and types available on the current physical device and you determine that for some reason you don't want to use a specific memory type for the allocation, you can enable automatic memory type selection but exclude certain memory type or types by setting all bits of memoryTypeBits to 1 except the ones you choose.

    +

    You can also use this parameter to exclude some memory types. If you inspect memory heaps and types available on the current physical device and you determine that for some reason you don't want to use a specific memory type for the allocation, you can enable automatic memory type selection but exclude certain memory type or types by setting all bits of memoryTypeBits to 1 except the ones you choose.

    // ...
    uint32_t excludedMemoryTypeIndex = 2;
    VmaAllocationCreateInfo allocInfo = {};
    allocInfo.memoryTypeBits = ~(1U << excludedMemoryTypeIndex);
    // ...
    -

    +

    Custom memory pools

    If you allocate from custom memory pool, all the ways of specifying memory requirements described above are not applicable and the aforementioned members of VmaAllocationCreateInfo structure are ignored. Memory type is selected explicitly when creating the pool and then used to make all the allocations from that pool. For further details, see Custom memory pools.

    -

    +

    Dedicated allocations

    -

    Memory for allocations is reserved out of larger block of VkDeviceMemory allocated from Vulkan internally. That is the main feature of this whole library. You can still request a separate memory block to be created for an allocation, just like you would do in a trivial solution without using any allocator. In that case, a buffer or image is always bound to that memory at offset 0. This is called a "dedicated allocation". You can explicitly request it by using flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. The library can also internally decide to use dedicated allocation in some cases, e.g.:

    +

    Memory for allocations is reserved out of larger block of VkDeviceMemory allocated from Vulkan internally. That is the main feature of this whole library. You can still request a separate memory block to be created for an allocation, just like you would do in a trivial solution without using any allocator. In that case, a buffer or image is always bound to that memory at offset 0. This is called a "dedicated allocation". You can explicitly request it by using flag VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. The library can also internally decide to use dedicated allocation in some cases, e.g.:

    • When the size of the allocation is large.
    • When VK_KHR_dedicated_allocation extension is enabled and it reports that dedicated allocation is required or recommended for the resource.
    • @@ -191,7 +178,7 @@

    diff --git a/docs/html/classes.html b/docs/html/classes.html index e62ea244..82c10757 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Class Index - - @@ -33,35 +31,24 @@ - +
    -
    diff --git a/docs/html/clipboard.js b/docs/html/clipboard.js index 42c1fb0e..9da9f3ca 100644 --- a/docs/html/clipboard.js +++ b/docs/html/clipboard.js @@ -28,8 +28,8 @@ SOFTWARE. */ let clipboard_title = "Copy to clipboard" -let clipboard_icon = `` -let clipboard_successIcon = `` +let clipboard_icon = `` +let clipboard_successIcon = `` let clipboard_successDuration = 1000 $(function() { diff --git a/docs/html/configuration.html b/docs/html/configuration.html index 75e05024..6b7baee5 100644 --- a/docs/html/configuration.html +++ b/docs/html/configuration.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Configuration - - @@ -33,33 +31,22 @@
    - + -
    -
    Configuration
    +
    Configuration
    -

    Please check "CONFIGURATION SECTION" in the code to find macros that you can define before each include of this file or change directly in this file to provide your own implementation of basic facilities like assert, min() and max() functions, mutex, atomic etc.

    -

    For example, define VMA_ASSERT(expr) before including the library to provide custom implementation of the assertion, compatible with your project. By default it is defined to standard C assert(expr) in _DEBUG configuration and empty otherwise.

    -

    Similarly, you can define VMA_LEAK_LOG_FORMAT macro to enable printing of leaked (unfreed) allocations, including their names and other parameters. Example:

    +

    Please check "CONFIGURATION SECTION" in the code to find macros that you can define before each include of this file or change directly in this file to provide your own implementation of basic facilities like assert, min() and max() functions, mutex, atomic etc.

    +

    For example, define VMA_ASSERT(expr) before including the library to provide custom implementation of the assertion, compatible with your project. By default it is defined to standard C assert(expr) in _DEBUG configuration and empty otherwise.

    +

    Similarly, you can define VMA_LEAK_LOG_FORMAT macro to enable printing of leaked (unfreed) allocations, including their names and other parameters. Example:

    #define VMA_LEAK_LOG_FORMAT(format, ...) do { \
    printf((format), __VA_ARGS__); \
    printf("\n"); \
    } while(false)
    -

    +

    Pointers to Vulkan functions

    There are multiple ways to import pointers to Vulkan functions in the library. In the simplest case you don't need to do anything. If the compilation or linking of your program or the initialization of the VmaAllocator doesn't work for you, you can try to reconfigure it.

    First, the allocator tries to fetch pointers to Vulkan functions linked statically, like this:

    m_VulkanFunctions.vkAllocateMemory = (PFN_vkAllocateMemory)vkAllocateMemory;
    -

    If you want to disable this feature, set configuration macro: #define VMA_STATIC_VULKAN_FUNCTIONS 0.

    -

    Second, you can provide the pointers yourself by setting member VmaAllocatorCreateInfo::pVulkanFunctions. You can fetch them e.g. using functions vkGetInstanceProcAddr and vkGetDeviceProcAddr or by using a helper library like volk.

    -

    Third, VMA tries to fetch remaining pointers that are still null by calling vkGetInstanceProcAddr and vkGetDeviceProcAddr on its own. You need to only fill in VmaVulkanFunctions::vkGetInstanceProcAddr and VmaVulkanFunctions::vkGetDeviceProcAddr. Other pointers will be fetched automatically. If you want to disable this feature, set configuration macro: #define VMA_DYNAMIC_VULKAN_FUNCTIONS 0.

    -

    Finally, all the function pointers required by the library (considering selected Vulkan version and enabled extensions) are checked with VMA_ASSERT if they are not null.

    -

    +

    If you want to disable this feature, set configuration macro: #define VMA_STATIC_VULKAN_FUNCTIONS 0.

    +

    Second, you can provide the pointers yourself by setting member VmaAllocatorCreateInfo::pVulkanFunctions. You can fetch them e.g. using functions vkGetInstanceProcAddr and vkGetDeviceProcAddr or by using a helper library like volk.

    +

    Third, VMA tries to fetch remaining pointers that are still null by calling vkGetInstanceProcAddr and vkGetDeviceProcAddr on its own. You need to only fill in VmaVulkanFunctions::vkGetInstanceProcAddr and VmaVulkanFunctions::vkGetDeviceProcAddr. Other pointers will be fetched automatically. If you want to disable this feature, set configuration macro: #define VMA_DYNAMIC_VULKAN_FUNCTIONS 0.

    +

    Finally, all the function pointers required by the library (considering selected Vulkan version and enabled extensions) are checked with VMA_ASSERT if they are not null.

    +

    Custom host memory allocator

    -

    If you use custom allocator for CPU memory rather than default operator new and delete from C++, you can make this library using your allocator as well by filling optional member VmaAllocatorCreateInfo::pAllocationCallbacks. These functions will be passed to Vulkan, as well as used by the library itself to make any CPU-side allocations.

    -

    +

    If you use custom allocator for CPU memory rather than default operator new and delete from C++, you can make this library using your allocator as well by filling optional member VmaAllocatorCreateInfo::pAllocationCallbacks. These functions will be passed to Vulkan, as well as used by the library itself to make any CPU-side allocations.

    +

    Device memory allocation callbacks

    -

    The library makes calls to vkAllocateMemory() and vkFreeMemory() internally. You can setup callbacks to be informed about these calls, e.g. for the purpose of gathering some statistics. To do it, fill optional member VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.

    -

    +

    The library makes calls to vkAllocateMemory() and vkFreeMemory() internally. You can setup callbacks to be informed about these calls, e.g. for the purpose of gathering some statistics. To do it, fill optional member VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.

    +

    Device heap memory limit

    When device memory of certain heap runs out of free space, new allocations may fail (returning error code) or they may succeed, silently pushing some existing_ memory blocks from GPU VRAM to system RAM (which degrades performance). This behavior is implementation-dependent - it depends on GPU vendor and graphics driver.

    On AMD cards it can be controlled while creating Vulkan device object by using VK_AMD_memory_overallocation_behavior extension, if available.

    @@ -122,7 +109,7 @@

    diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index 734d4cf0..365abaf6 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Custom memory pools - - @@ -33,33 +31,22 @@
    - + -
    -
    Custom memory pools
    +
    Custom memory pools
    -

    A memory pool contains a number of VkDeviceMemory blocks. The library automatically creates and manages default pool for each memory type available on the device. Default memory pool automatically grows in size. Size of allocated blocks is also variable and managed automatically. You are using default pools whenever you leave VmaAllocationCreateInfo::pool = null.

    +

    A memory pool contains a number of VkDeviceMemory blocks. The library automatically creates and manages default pool for each memory type available on the device. Default memory pool automatically grows in size. Size of allocated blocks is also variable and managed automatically. You are using default pools whenever you leave VmaAllocationCreateInfo::pool = null.

    You can create custom pool and allocate memory out of it. It can be useful if you want to:

    • Keep certain kind of allocations separate from others.
    • Enforce particular, fixed size of Vulkan memory blocks.
    • Limit maximum amount of Vulkan memory allocated for that pool.
    • Reserve minimum or fixed amount of Vulkan memory always preallocated for that pool.
    • -
    • Use extra parameters for a set of your allocations that are available in VmaPoolCreateInfo but not in VmaAllocationCreateInfo - e.g., custom minimum alignment, custom pNext chain.
    • +
    • Use extra parameters for a set of your allocations that are available in VmaPoolCreateInfo but not in VmaAllocationCreateInfo - e.g., custom minimum alignment, custom pNext chain.
    • Perform defragmentation on a specific subset of your allocations.

    To use custom memory pools:

    1. Fill VmaPoolCreateInfo structure.
    2. Call vmaCreatePool() to obtain VmaPool handle.
    3. -
    4. When making an allocation, set VmaAllocationCreateInfo::pool to this handle. You don't need to specify any other parameters of this structure, like usage.
    5. +
    6. 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:

    // Find memoryTypeIndex for the pool.
    @@ -162,7 +149,7 @@
    void vmaDestroyBuffer(VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
    Destroys Vulkan buffer and frees allocated memory.
    void vmaDestroyPool(VmaAllocator allocator, VmaPool pool)
    Destroys VmaPool object and frees Vulkan device memory.

    New versions of this library support creating dedicated allocations in custom pools. It is supported only when VmaPoolCreateInfo::blockSize = 0. To use this feature, set VmaAllocationCreateInfo::pool to the pointer to your custom pool and VmaAllocationCreateInfo::flags to VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.

    -

    +

    Choosing memory type index

    When creating a pool, you must explicitly specify memory type index. To find the one suitable for your buffers or images, you can use helper functions vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo(). You need to provide structures with example parameters of buffers or images that you are going to create in that pool.

    VkBufferCreateInfo exampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    @@ -180,15 +167,15 @@

    // ...

    When creating buffers/images allocated in that pool, provide following parameters:

      -
    • VkBufferCreateInfo: Prefer to pass same parameters as above. Otherwise you risk creating resources in a memory type that is not suitable for them, which may result in undefined behavior. Using different VK_BUFFER_USAGE_ flags may work, but you shouldn't create images in a pool intended for buffers or the other way around.
    • -
    • VmaAllocationCreateInfo: You don't need to pass same parameters. Fill only pool member. Other members are ignored anyway.
    • +
    • VkBufferCreateInfo: Prefer to pass same parameters as above. Otherwise you risk creating resources in a memory type that is not suitable for them, which may result in undefined behavior. Using different VK_BUFFER_USAGE_ flags may work, but you shouldn't create images in a pool intended for buffers or the other way around.
    • +
    • VmaAllocationCreateInfo: You don't need to pass same parameters. Fill only pool member. Other members are ignored anyway.
    -

    +

    When not to use custom pools

    Custom pools are commonly overused by VMA users. While it may feel natural to keep some logical groups of resources separate in memory, in most cases it does more harm than good. Using custom pool shouldn't be your first choice. Instead, please make all allocations from default pools first and only use custom pools if you can prove and measure that it is beneficial in some way, e.g. it results in lower memory usage, better performance, etc.

    Using custom pools has disadvantages:

      -
    • Each pool has its own collection of VkDeviceMemory blocks. Some of them may be partially or even completely empty. Spreading allocations across multiple pools increases the amount of wasted (allocated but unbound) memory.
    • +
    • Each pool has its own collection of VkDeviceMemory blocks. Some of them may be partially or even completely empty. Spreading allocations across multiple pools increases the amount of wasted (allocated but unbound) memory.
    • You must manually choose specific memory type to be used by a custom pool (set as VmaPoolCreateInfo::memoryTypeIndex). When using default pools, best memory type for each of your allocations can be selected automatically using a carefully design algorithm that works across all kinds of GPUs.
    • If an allocation from a custom pool at specific memory type fails, entire allocation operation returns failure. When using default pools, VMA tries another compatible memory type.
    • If you set VmaPoolCreateInfo::blockSize != 0, each memory block has the same size, while default pools start from small blocks and only allocate next blocks larger and larger up to the preferred block size.
    • @@ -196,30 +183,30 @@

      Many of the common concerns can be addressed in a different way than using custom pools:

      • If you want to keep your allocations of certain size (small versus large) or certain lifetime (transient versus long lived) separate, you likely don't need to. VMA uses a high quality allocation algorithm that manages memory well in various cases. Please measure and check if using custom pools provides a benefit.
      • -
      • If you want to keep your images and buffers separate, you don't need to. VMA respects bufferImageGranularity limit automatically.
      • -
      • If you want to keep your mapped and not mapped allocations separate, you don't need to. VMA respects nonCoherentAtomSize limit automatically. It also maps only those VkDeviceMemory blocks that need to map any allocation. It even tries to keep mappable and non-mappable allocations in separate blocks to minimize the amount of mapped memory.
      • +
      • If you want to keep your images and buffers separate, you don't need to. VMA respects bufferImageGranularity limit automatically.
      • +
      • If you want to keep your mapped and not mapped allocations separate, you don't need to. VMA respects nonCoherentAtomSize limit automatically. It also maps only those VkDeviceMemory blocks that need to map any allocation. It even tries to keep mappable and non-mappable allocations in separate blocks to minimize the amount of mapped memory.
      • If you want to choose a custom size for the default memory block, you can set it globally instead using VmaAllocatorCreateInfo::preferredLargeHeapBlockSize.
      • -
      • If you want to select specific memory type for your allocation, you can set VmaAllocationCreateInfo::memoryTypeBits to (1U << myMemoryTypeIndex) instead.
      • +
      • If you want to select specific memory type for your allocation, you can set VmaAllocationCreateInfo::memoryTypeBits to (1U << myMemoryTypeIndex) instead.
      • If you need to create a buffer with certain minimum alignment, you can still do it using default pools with dedicated function vmaCreateBufferWithAlignment().
      -

      +

      Linear allocation algorithm

      Each Vulkan memory block managed by this library has accompanying metadata that keeps track of used and unused regions. By default, the metadata structure and algorithm tries to find best place for new allocations among free regions to optimize memory usage. This way you can allocate and free objects in any order.

      Default allocation algorithm

      Sometimes there is a need to use simpler, linear allocation algorithm. You can create custom pool that uses such algorithm by adding flag VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT to VmaPoolCreateInfo::flags while creating VmaPool object. Then an alternative metadata management is used. It always creates new allocations after last one and doesn't reuse free regions after allocations freed in the middle. It results in better allocation performance and less memory consumed by metadata.

      Linear allocation algorithm

      With this one flag, you can create a custom pool that can be used in many ways: free-at-once, stack, double stack, and ring buffer. See below for details. You don't need to specify explicitly which of these options you are going to use - it is detected automatically.

      -

      +

      Free-at-once

      In a pool that uses linear algorithm, you still need to free all the allocations individually, e.g. by using vmaFreeMemory() or vmaDestroyBuffer(). You can free them in any order. New allocations are always made after last one - free space in the middle is not reused. However, when you release all the allocation and the pool becomes empty, allocation starts from the beginning again. This way you can use linear algorithm to speed up creation of allocations that you are going to release all at once.

      Free-at-once

      This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount value that allows multiple memory blocks.

      -

      +

      Stack

      When you free an allocation that was created last, its space can be reused. Thanks to this, if you always release allocations in the order opposite to their creation (LIFO - Last In First Out), you can achieve behavior of a stack.

      Stack

      This mode is also available for pools created with VmaPoolCreateInfo::maxBlockCount value that allows multiple memory blocks.

      -

      +

      Double stack

      The space reserved by a custom pool with linear algorithm may be used by two stacks:

        @@ -229,8 +216,8 @@

        To make allocation from the upper stack, add flag VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT to VmaAllocationCreateInfo::flags.

        Double stack

        Double stack is available only in pools with one memory block - VmaPoolCreateInfo::maxBlockCount must be 1. Otherwise behavior is undefined.

        -

        When the two stacks' ends meet so there is not enough space between them for a new allocation, such allocation fails with usual VK_ERROR_OUT_OF_DEVICE_MEMORY error.

        -

        +

        When the two stacks' ends meet so there is not enough space between them for a new allocation, such allocation fails with usual VK_ERROR_OUT_OF_DEVICE_MEMORY error.

        +

        Ring buffer

        When you free some allocations from the beginning and there is not enough free space for a new one at the end of a pool, allocator's "cursor" wraps around to the beginning and starts allocation there. Thanks to this, if you always release allocations in the same order as you created them (FIFO - First In First Out), you can achieve behavior of a ring buffer / queue.

        Ring buffer

        @@ -240,7 +227,7 @@

    diff --git a/docs/html/debugging_memory_usage.html b/docs/html/debugging_memory_usage.html index b4c070c8..aac63dff 100644 --- a/docs/html/debugging_memory_usage.html +++ b/docs/html/debugging_memory_usage.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Debugging incorrect memory usage - - @@ -33,33 +31,22 @@
    - + -
    -
    Debugging incorrect memory usage
    +
    Debugging incorrect memory usage

    If you suspect a bug with memory usage, like usage of uninitialized memory or memory being overwritten out of bounds of an allocation, you can use debug features of this library to verify this.

    -

    +

    Memory initialization

    -

    If you experience a bug with incorrect and nondeterministic data in your program and you suspect uninitialized memory to be used, you can enable automatic memory initialization to verify this. To do it, define macro VMA_DEBUG_INITIALIZE_ALLOCATIONS to 1.

    +

    If you experience a bug with incorrect and nondeterministic data in your program and you suspect uninitialized memory to be used, you can enable automatic memory initialization to verify this. To do it, define macro VMA_DEBUG_INITIALIZE_ALLOCATIONS to 1.

    #define VMA_DEBUG_INITIALIZE_ALLOCATIONS 1
    #include "vk_mem_alloc.h"
    -

    It makes memory of new allocations initialized to bit pattern 0xDCDCDCDC. Before an allocation is destroyed, its memory is filled with bit pattern 0xEFEFEFEF. Memory is automatically mapped and unmapped if necessary.

    +

    It makes memory of new allocations initialized to bit pattern 0xDCDCDCDC. Before an allocation is destroyed, its memory is filled with bit pattern 0xEFEFEFEF. Memory is automatically mapped and unmapped if necessary.

    If you find these values while debugging your program, good chances are that you incorrectly read Vulkan memory that is allocated but not initialized, or already freed, respectively.

    -

    Memory initialization works only with memory types that are HOST_VISIBLE and with allocations that can be mapped. It works also with dedicated allocations.

    -

    +

    Memory initialization works only with memory types that are HOST_VISIBLE and with allocations that can be mapped. It works also with dedicated allocations.

    +

    Margins

    -

    By default, allocations are laid out in memory blocks next to each other if possible (considering required alignment, bufferImageGranularity, and nonCoherentAtomSize).

    +

    By default, allocations are laid out in memory blocks next to each other if possible (considering required alignment, bufferImageGranularity, and nonCoherentAtomSize).

    Allocations without margin

    -

    Define macro VMA_DEBUG_MARGIN to some non-zero value (e.g. 16) to enforce specified number of bytes as a margin after every allocation.

    +

    Define macro VMA_DEBUG_MARGIN to some non-zero value (e.g. 16) to enforce specified number of bytes as a margin after every allocation.

    #define VMA_DEBUG_MARGIN 16
    #include "vk_mem_alloc.h"

    Allocations with margin

    @@ -115,25 +102,25 @@

    Margins appear in JSON dump as part of free space.

    Note that enabling margins increases memory usage and fragmentation.

    Margins do not apply to Virtual allocator.

    -

    +

    Corruption detection

    -

    You can additionally define macro VMA_DEBUG_DETECT_CORRUPTION to 1 to enable validation of contents of the margins.

    +

    You can additionally define macro VMA_DEBUG_DETECT_CORRUPTION to 1 to enable validation of contents of the margins.

    #define VMA_DEBUG_MARGIN 16
    #define VMA_DEBUG_DETECT_CORRUPTION 1
    #include "vk_mem_alloc.h"
    -

    When this feature is enabled, number of bytes specified as VMA_DEBUG_MARGIN (it must be multiply of 4) after every allocation is filled with a magic number. This idea is also know as "canary". Memory is automatically mapped and unmapped if necessary.

    -

    This number is validated automatically when the allocation is destroyed. If it is not equal to the expected value, VMA_ASSERT() is executed. It clearly means that either CPU or GPU overwritten the memory outside of boundaries of the allocation, which indicates a serious bug.

    +

    When this feature is enabled, number of bytes specified as VMA_DEBUG_MARGIN (it must be multiply of 4) after every allocation is filled with a magic number. This idea is also know as "canary". Memory is automatically mapped and unmapped if necessary.

    +

    This number is validated automatically when the allocation is destroyed. If it is not equal to the expected value, VMA_ASSERT() is executed. It clearly means that either CPU or GPU overwritten the memory outside of boundaries of the allocation, which indicates a serious bug.

    You can also explicitly request checking margins of all allocations in all memory blocks that belong to specified memory types by using function vmaCheckCorruption(), or in memory blocks that belong to specified custom pool, by using function vmaCheckPoolCorruption().

    -

    Margin validation (corruption detection) works only for memory types that are HOST_VISIBLE and HOST_COHERENT.

    -

    +

    Margin validation (corruption detection) works only for memory types that are HOST_VISIBLE and HOST_COHERENT.

    +

    Leak detection features

    -

    At allocation and allocator destruction time VMA checks for unfreed and unmapped blocks using VMA_ASSERT_LEAK(). This macro defaults to an assertion, triggering a typically fatal error in Debug builds, and doing nothing in Release builds. You can provide your own definition of VMA_ASSERT_LEAK() to change this behavior.

    -

    At memory block destruction time VMA lists out all unfreed allocations using the VMA_LEAK_LOG_FORMAT() macro, which defaults to VMA_DEBUG_LOG_FORMAT, which in turn defaults to a no-op. If you're having trouble with leaks - for example, the aforementioned assertion triggers, but you don't quite know why -, overriding this macro to print out the the leaking blocks, combined with assigning individual names to allocations using vmaSetAllocationName(), can greatly aid in fixing them.

    +

    At allocation and allocator destruction time VMA checks for unfreed and unmapped blocks using VMA_ASSERT_LEAK(). This macro defaults to an assertion, triggering a typically fatal error in Debug builds, and doing nothing in Release builds. You can provide your own definition of VMA_ASSERT_LEAK() to change this behavior.

    +

    At memory block destruction time VMA lists out all unfreed allocations using the VMA_LEAK_LOG_FORMAT() macro, which defaults to VMA_DEBUG_LOG_FORMAT, which in turn defaults to a no-op. If you're having trouble with leaks - for example, the aforementioned assertion triggers, but you don't quite know why -, overriding this macro to print out the the leaking blocks, combined with assigning individual names to allocations using vmaSetAllocationName(), can greatly aid in fixing them.

    diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html index 66d1d638..47e034fa 100644 --- a/docs/html/defragmentation.html +++ b/docs/html/defragmentation.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Defragmentation - - @@ -33,33 +31,22 @@ - + -
    -
    Defragmentation
    +
    Defragmentation

    Interleaved allocations and deallocations of many objects of varying size can cause fragmentation over time, which can lead to a situation where the library is unable to find a continuous range of free memory for a new allocation despite there is enough free space, just scattered across many small free ranges between existing allocations.

    -

    To mitigate this problem, you can use defragmentation feature. It doesn't happen automatically though and needs your cooperation, because VMA is a low level library that only allocates memory. It cannot recreate buffers and images in a new place as it doesn't remember the contents of VkBufferCreateInfo / VkImageCreateInfo structures. It cannot copy their contents as it doesn't record any commands to a command buffer.

    +

    To mitigate this problem, you can use defragmentation feature. It doesn't happen automatically though and needs your cooperation, because VMA is a low level library that only allocates memory. It cannot recreate buffers and images in a new place as it doesn't remember the contents of VkBufferCreateInfo / VkImageCreateInfo structures. It cannot copy their contents as it doesn't record any commands to a command buffer.

    Example:

    VmaDefragmentationInfo defragInfo = {};
    defragInfo.pool = myPool;
    @@ -168,11 +155,11 @@
    Parameters for incremental defragmentation steps.
    Definition vk_mem_alloc.h:1548
    uint32_t moveCount
    Number of elements in the pMoves array.
    Definition vk_mem_alloc.h:1550
    VmaDefragmentationMove * pMoves
    Array of moves to be performed by the user in the current defragmentation pass.
    Definition vk_mem_alloc.h:1574
    -

    Although functions like vmaCreateBuffer(), vmaCreateImage(), vmaDestroyBuffer(), vmaDestroyImage() create/destroy an allocation and a buffer/image at once, these are just a shortcut for creating the resource, allocating memory, and binding them together. Defragmentation works on memory allocations only. You must handle the rest manually. Defragmentation is an iterative process that should repreat "passes" as long as related functions return VK_INCOMPLETE not VK_SUCCESS. In each pass:

    +

    Although functions like vmaCreateBuffer(), vmaCreateImage(), vmaDestroyBuffer(), vmaDestroyImage() create/destroy an allocation and a buffer/image at once, these are just a shortcut for creating the resource, allocating memory, and binding them together. Defragmentation works on memory allocations only. You must handle the rest manually. Defragmentation is an iterative process that should repreat "passes" as long as related functions return VK_INCOMPLETE not VK_SUCCESS. In each pass:

    1. vmaBeginDefragmentationPass() function call:
      • Calculates and returns the list of allocations to be moved in this pass. Note this can be a time-consuming process.
      • -
      • Reserves destination memory for them by creating temporary destination allocations that you can query for their VkDeviceMemory + offset using vmaGetAllocationInfo().
      • +
      • Reserves destination memory for them by creating temporary destination allocations that you can query for their VkDeviceMemory + offset using vmaGetAllocationInfo().
    2. Inside the pass, you should:
        @@ -185,30 +172,30 @@
      • vmaEndDefragmentationPass() function call:
        • Frees the source memory reserved for the allocations that are moved.
        • Modifies source VmaAllocation objects that are moved to point to the destination reserved memory.
        • -
        • Frees VkDeviceMemory blocks that became empty.
        • +
        • Frees VkDeviceMemory blocks that became empty.
    -

    Unlike in previous iterations of the defragmentation API, there is no list of "movable" allocations passed as a parameter. Defragmentation algorithm tries to move all suitable allocations. You can, however, refuse to move some of them inside a defragmentation pass, by setting pass.pMoves[i].operation to VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE. This is not recommended and may result in suboptimal packing of the allocations after defragmentation. If you cannot ensure any allocation can be moved, it is better to keep movable allocations separate in a custom pool.

    +

    Unlike in previous iterations of the defragmentation API, there is no list of "movable" allocations passed as a parameter. Defragmentation algorithm tries to move all suitable allocations. You can, however, refuse to move some of them inside a defragmentation pass, by setting pass.pMoves[i].operation to VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE. This is not recommended and may result in suboptimal packing of the allocations after defragmentation. If you cannot ensure any allocation can be moved, it is better to keep movable allocations separate in a custom pool.

    Inside a pass, for each allocation that should be moved:

      -
    • You should copy its data from the source to the destination place by calling e.g. vkCmdCopyBuffer(), vkCmdCopyImage().
        +
      • You should copy its data from the source to the destination place by calling e.g. vkCmdCopyBuffer(), vkCmdCopyImage().
        • You need to make sure these commands finished executing before destroying the source buffers/images and before calling vmaEndDefragmentationPass().
      • If a resource doesn't contain any meaningful data, e.g. it is a transient color attachment image to be cleared, filled, and used temporarily in each rendering frame, you can just recreate this image without copying its data.
      • -
      • If the resource is in HOST_VISIBLE and HOST_CACHED memory, you can copy its data on the CPU using memcpy().
      • -
      • If you cannot move the allocation, you can set pass.pMoves[i].operation to VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE. This will cancel the move.
          +
        • If the resource is in HOST_VISIBLE and HOST_CACHED memory, you can copy its data on the CPU using memcpy().
        • +
        • If you cannot move the allocation, you can set pass.pMoves[i].operation to VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE. This will cancel the move.
        • -
        • If you decide the allocation is unimportant and can be destroyed instead of moved (e.g. it wasn't used for long time), you can set pass.pMoves[i].operation to VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY.

          You can defragment a specific custom pool by setting VmaDefragmentationInfo::pool (like in the example above) or all the default pools by setting this member to null.

          -

          Defragmentation is always performed in each pool separately. Allocations are never moved between different Vulkan memory types. The size of the destination memory reserved for a moved allocation is the same as the original one. Alignment of an allocation as it was determined using vkGetBufferMemoryRequirements() etc. is also respected after defragmentation. Buffers/images should be recreated with the same VkBufferCreateInfo / VkImageCreateInfo parameters as the original ones.

          +

          Defragmentation is always performed in each pool separately. Allocations are never moved between different Vulkan memory types. The size of the destination memory reserved for a moved allocation is the same as the original one. Alignment of an allocation as it was determined using vkGetBufferMemoryRequirements() etc. is also respected after defragmentation. Buffers/images should be recreated with the same VkBufferCreateInfo / VkImageCreateInfo parameters as the original ones.

          You can perform the defragmentation incrementally to limit the number of allocations and bytes to be moved in each pass, e.g. to call it in sync with render frames and not to experience too big hitches. See members: VmaDefragmentationInfo::maxBytesPerPass, VmaDefragmentationInfo::maxAllocationsPerPass.

          It is also safe to perform the defragmentation asynchronously to render frames and other Vulkan and VMA usage, possibly from multiple threads, with the exception that allocations returned in VmaDefragmentationPassMoveInfo::pMoves shouldn't be destroyed until the defragmentation pass is ended.

          Mapping is preserved on allocations that are moved during defragmentation. Whether through VMA_ALLOCATION_CREATE_MAPPED_BIT or vmaMapMemory(), the allocations are mapped at their new place. Of course, pointer to the mapped data changes, so it needs to be queried using VmaAllocationInfo::pMappedData.

          @@ -217,7 +204,7 @@
    diff --git a/docs/html/deprecated.html b/docs/html/deprecated.html index 45f64c10..fdc6db35 100644 --- a/docs/html/deprecated.html +++ b/docs/html/deprecated.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Deprecated List - - @@ -33,33 +31,22 @@
    - + -
    -
    Deprecated List
    +
    Deprecated List
    Member VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT
    Preserved for backward compatibility. Consider using vmaSetAllocationName() instead.
    Member VMA_MEMORY_USAGE_CPU_COPY
    -
    Obsolete, preserved for backward compatibility. Prefers not VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    +
    Obsolete, preserved for backward compatibility. Prefers not VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    Member VMA_MEMORY_USAGE_CPU_ONLY
    -
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_COHERENT_BIT.
    +
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_COHERENT_BIT.
    Member VMA_MEMORY_USAGE_CPU_TO_GPU
    -
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    +
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    Member VMA_MEMORY_USAGE_GPU_ONLY
    -
    Obsolete, preserved for backward compatibility. Prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    +
    Obsolete, preserved for backward compatibility. Prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    Member VMA_MEMORY_USAGE_GPU_TO_CPU
    -
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_HOST_CACHED_BIT.
    +
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_HOST_CACHED_BIT.
    diff --git a/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html b/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html index cfcf449b..cb11150f 100644 --- a/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html +++ b/docs/html/dir_d44c64559bbebec7f509842c48db8b23.html @@ -3,15 +3,13 @@ - + -Vulkan Memory Allocator: D:/PROJECTS/Vulkan Memory Allocator/REPO/include Directory Reference +Vulkan Memory Allocator: C:/Code/VulkanMemoryAllocator/REPO/include Directory Reference - - @@ -33,33 +31,22 @@
    - + -
    @@ -92,15 +79,14 @@
    - - - +

    +

    Files

     vk_mem_alloc.h
     
     
    vk_mem_alloc.h
    diff --git a/docs/html/doxygen.css b/docs/html/doxygen.css index 561af70d..5d2eecd6 100644 --- a/docs/html/doxygen.css +++ b/docs/html/doxygen.css @@ -1,11 +1,12 @@ -/* The standard CSS for doxygen 1.13.0*/ +/* The standard CSS for doxygen 1.14.0*/ html { /* page base colors */ --page-background-color: white; --page-foreground-color: black; --page-link-color: #3D578C; ---page-visited-link-color: #4665A2; +--page-visited-link-color: #3D578C; +--page-external-link-color: #334975; /* index */ --index-odd-item-bg-color: #F8F9FC; @@ -16,46 +17,50 @@ html { /* header */ --header-background-color: #F9FAFC; --header-separator-color: #C4CFE5; ---header-gradient-image: url('nav_h.png'); ---group-header-separator-color: #879ECB; +--group-header-separator-color: #D9E0EE; --group-header-color: #354C7B; --inherit-header-color: gray; --footer-foreground-color: #2A3D61; ---footer-logo-width: 104px; +--footer-logo-width: 75px; --citation-label-color: #334975; --glow-color: cyan; --title-background-color: white; ---title-separator-color: #5373B4; +--title-separator-color: #C4CFE5; --directory-separator-color: #9CAFD4; --separator-color: #4A6AAA; --blockquote-background-color: #F7F8FB; --blockquote-border-color: #9CAFD4; ---scrollbar-thumb-color: #9CAFD4; +--scrollbar-thumb-color: #C4CFE5; --scrollbar-background-color: #F9FAFC; --icon-background-color: #728DC1; --icon-foreground-color: white; +/* --icon-doc-image: url('doc.svg'); --icon-folder-open-image: url('folderopen.svg'); ---icon-folder-closed-image: url('folderclosed.svg'); +--icon-folder-closed-image: url('folderclosed.svg');*/ +--icon-folder-open-fill-color: #C4CFE5; +--icon-folder-fill-color: #D8DFEE; +--icon-folder-border-color: #4665A2; +--icon-doc-fill-color: #D8DFEE; +--icon-doc-border-color: #4665A2; /* brief member declaration list */ --memdecl-background-color: #F9FAFC; --memdecl-separator-color: #DEE4F0; --memdecl-foreground-color: #555; --memdecl-template-color: #4665A2; +--memdecl-border-color: #D5DDEC; /* detailed member list */ --memdef-border-color: #A8B8D9; --memdef-title-background-color: #E2E8F2; ---memdef-title-gradient-image: url('nav_f.png'); ---memdef-proto-background-color: #DFE5F1; +--memdef-proto-background-color: #EEF1F7; --memdef-proto-text-color: #253555; ---memdef-proto-text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); --memdef-doc-background-color: white; --memdef-param-name-color: #602020; --memdef-template-color: #4665A2; @@ -74,29 +79,34 @@ html { /** navigation bar/tree/menu */ --nav-background-color: #F9FAFC; --nav-foreground-color: #364D7C; ---nav-gradient-image: url('tab_b.png'); ---nav-gradient-hover-image: url('tab_h.png'); ---nav-gradient-active-image: url('tab_a.png'); ---nav-gradient-active-image-parent: url("../tab_a.png"); ---nav-separator-image: url('tab_s.png'); ---nav-breadcrumb-image: url('bc_s.png'); ---nav-breadcrumb-border-color: #C2CDE4; ---nav-splitbar-image: url('splitbar.png'); +--nav-border-color: #C4CFE5; +--nav-breadcrumb-separator-color: #C4CFE5; +--nav-breadcrumb-active-bg: #EEF1F7; +--nav-breadcrumb-color: #354C7B; +--nav-breadcrumb-border-color: #E1E7F2; +--nav-splitbar-bg-color: #DCE2EF; +--nav-splitbar-handle-color: #9CAFD4; --nav-font-size-level1: 13px; --nav-font-size-level2: 10px; --nav-font-size-level3: 9px; --nav-text-normal-color: #283A5D; --nav-text-hover-color: white; --nav-text-active-color: white; ---nav-text-normal-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); ---nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); ---nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); --nav-menu-button-color: #364D7C; --nav-menu-background-color: white; --nav-menu-foreground-color: #555555; +--nav-menu-active-bg: #DCE2EF; +--nav-menu-active-color: #9CAFD4; --nav-menu-toggle-color: rgba(255, 255, 255, 0.5); ---nav-arrow-color: #9CAFD4; ---nav-arrow-selected-color: #9CAFD4; +--nav-arrow-color: #B6C4DF; +--nav-arrow-selected-color: #90A5CE; + +/* sync icon */ +--sync-icon-border-color: #C4CFE5; +--sync-icon-background-color: #F9FAFC; +--sync-icon-selected-background-color: #EEF1F7; +--sync-icon-color: #C4CFE5; +--sync-icon-selected-color: #6884BD; /* table of contents */ --toc-background-color: #F4F6FA; @@ -107,18 +117,20 @@ html { /** search field */ --search-background-color: white; --search-foreground-color: #909090; ---search-magnification-image: url('mag.svg'); ---search-magnification-select-image: url('mag_sel.svg'); --search-active-color: black; ---search-filter-background-color: #F9FAFC; +--search-filter-background-color: rgba(255,255,255,.7); +--search-filter-backdrop-filter: blur(4px); --search-filter-foreground-color: black; ---search-filter-border-color: #90A5CE; +--search-filter-border-color: rgba(150,150,150,.4); --search-filter-highlight-text-color: white; --search-filter-highlight-bg-color: #3D578C; --search-results-foreground-color: #425E97; ---search-results-background-color: #EEF1F7; ---search-results-border-color: black; ---search-box-shadow: inset 0.5px 0.5px 3px 0px #555; +--search-results-background-color: rgba(255,255,255,.8); +--search-results-backdrop-filter: blur(4px); +--search-results-border-color: rgba(150,150,150,.4); +--search-box-border-color: #B6C4DF; +--search-close-icon-bg-color: #A0A0A0; +--search-close-icon-fg-color: white; /** code fragments */ --code-keyword-color: #008000; @@ -147,23 +159,21 @@ html { --fragment-lineno-link-hover-bg-color: #C8C8C8; --fragment-copy-ok-color: #2EC82E; --tooltip-foreground-color: black; ---tooltip-background-color: white; ---tooltip-border-color: gray; +--tooltip-background-color: rgba(255,255,255,0.8); +--tooltip-arrow-background-color: white; +--tooltip-border-color: rgba(150,150,150,0.7); +--tooltip-backdrop-filter: blur(3px); --tooltip-doc-color: grey; --tooltip-declaration-color: #006318; --tooltip-link-color: #4665A2; ---tooltip-shadow: 1px 1px 7px gray; +--tooltip-shadow: 0 4px 8px 0 rgba(0,0,0,.25); --fold-line-color: #808080; ---fold-minus-image: url('minus.svg'); ---fold-plus-image: url('plus.svg'); ---fold-minus-image-relpath: url('../../minus.svg'); ---fold-plus-image-relpath: url('../../plus.svg'); /** font-family */ ---font-family-normal: Roboto,sans-serif; +--font-family-normal: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; --font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; --font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; ---font-family-title: Tahoma,Arial,sans-serif; +--font-family-title: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; --font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; --font-family-search: Arial,Verdana,sans-serif; --font-family-icon: Arial,Helvetica; @@ -201,7 +211,8 @@ html { --page-background-color: black; --page-foreground-color: #C9D1D9; --page-link-color: #90A5CE; ---page-visited-link-color: #A3B4D7; +--page-visited-link-color: #90A5CE; +--page-external-link-color: #A3B4D7; /* index */ --index-odd-item-bg-color: #0B101A; @@ -212,8 +223,7 @@ html { /* header */ --header-background-color: #070B11; --header-separator-color: #141C2E; ---header-gradient-image: url('nav_hd.png'); ---group-header-separator-color: #283A5D; +--group-header-separator-color: #1D2A43; --group-header-color: #90A5CE; --inherit-header-color: #A0A0A0; @@ -223,35 +233,36 @@ html { --glow-color: cyan; --title-background-color: #090D16; ---title-separator-color: #354C79; +--title-separator-color: #212F4B; --directory-separator-color: #283A5D; --separator-color: #283A5D; --blockquote-background-color: #101826; --blockquote-border-color: #283A5D; ---scrollbar-thumb-color: #283A5D; +--scrollbar-thumb-color: #2C3F65; --scrollbar-background-color: #070B11; --icon-background-color: #334975; --icon-foreground-color: #C4CFE5; ---icon-doc-image: url('docd.svg'); ---icon-folder-open-image: url('folderopend.svg'); ---icon-folder-closed-image: url('folderclosedd.svg'); +--icon-folder-open-fill-color: #4665A2; +--icon-folder-fill-color: #5373B4; +--icon-folder-border-color: #C4CFE5; +--icon-doc-fill-color: #6884BD; +--icon-doc-border-color: #C4CFE5; /* brief member declaration list */ --memdecl-background-color: #0B101A; --memdecl-separator-color: #2C3F65; --memdecl-foreground-color: #BBB; --memdecl-template-color: #7C95C6; +--memdecl-border-color: #233250; /* detailed member list */ --memdef-border-color: #233250; --memdef-title-background-color: #1B2840; ---memdef-title-gradient-image: url('nav_fd.png'); --memdef-proto-background-color: #19243A; --memdef-proto-text-color: #9DB0D4; ---memdef-proto-text-shadow: 0px 1px 1px rgba(0, 0, 0, 0.9); --memdef-doc-background-color: black; --memdef-param-name-color: #D28757; --memdef-template-color: #7C95C6; @@ -270,29 +281,34 @@ html { /** navigation bar/tree/menu */ --nav-background-color: #101826; --nav-foreground-color: #364D7C; ---nav-gradient-image: url('tab_bd.png'); ---nav-gradient-hover-image: url('tab_hd.png'); ---nav-gradient-active-image: url('tab_ad.png'); ---nav-gradient-active-image-parent: url("../tab_ad.png"); ---nav-separator-image: url('tab_sd.png'); ---nav-breadcrumb-image: url('bc_sd.png'); +--nav-border-color: #212F4B; +--nav-breadcrumb-separator-color: #212F4B; +--nav-breadcrumb-active-bg: #1D2A43; +--nav-breadcrumb-color: #90A5CE; --nav-breadcrumb-border-color: #2A3D61; ---nav-splitbar-image: url('splitbard.png'); +--nav-splitbar-bg-color: #283A5D; +--nav-splitbar-handle-color: #4665A2; --nav-font-size-level1: 13px; --nav-font-size-level2: 10px; --nav-font-size-level3: 9px; --nav-text-normal-color: #B6C4DF; --nav-text-hover-color: #DCE2EF; --nav-text-active-color: #DCE2EF; ---nav-text-normal-shadow: 0px 1px 1px black; ---nav-text-hover-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); ---nav-text-active-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); --nav-menu-button-color: #B6C4DF; --nav-menu-background-color: #05070C; --nav-menu-foreground-color: #BBBBBB; +--nav-menu-active-bg: #1D2A43; +--nav-menu-active-color: #C9D3E7; --nav-menu-toggle-color: rgba(255, 255, 255, 0.2); ---nav-arrow-color: #334975; ---nav-arrow-selected-color: #90A5CE; +--nav-arrow-color: #4665A2; +--nav-arrow-selected-color: #6884BD; + +/* sync icon */ +--sync-icon-border-color: #212F4B; +--sync-icon-background-color: #101826; +--sync-icon-selected-background-color: #1D2A43; +--sync-icon-color: #4665A2; +--sync-icon-selected-color: #5373B4; /* table of contents */ --toc-background-color: #151E30; @@ -303,18 +319,20 @@ html { /** search field */ --search-background-color: black; --search-foreground-color: #C5C5C5; ---search-magnification-image: url('mag_d.svg'); ---search-magnification-select-image: url('mag_seld.svg'); ---search-active-color: #C5C5C5; +--search-active-color: #F5F5F5; --search-filter-background-color: #101826; --search-filter-foreground-color: #90A5CE; +--search-filter-backdrop-filter: none; --search-filter-border-color: #7C95C6; --search-filter-highlight-text-color: #BCC9E2; --search-filter-highlight-bg-color: #283A5D; ---search-results-background-color: #101826; +--search-results-background-color: black; --search-results-foreground-color: #90A5CE; ---search-results-border-color: #7C95C6; ---search-box-shadow: inset 0.5px 0.5px 3px 0px #2F436C; +--search-results-backdrop-filter: none; +--search-results-border-color: #334975; +--search-box-border-color: #334975; +--search-close-icon-bg-color: #909090; +--search-close-icon-fg-color: black; /** code fragments */ --code-keyword-color: #CC99CD; @@ -344,22 +362,20 @@ html { --fragment-copy-ok-color: #0EA80E; --tooltip-foreground-color: #C9D1D9; --tooltip-background-color: #202020; +--tooltip-arrow-background-color: #202020; +--tooltip-backdrop-filter: none; --tooltip-border-color: #C9D1D9; --tooltip-doc-color: #D9E1E9; --tooltip-declaration-color: #20C348; --tooltip-link-color: #79C0FF; --tooltip-shadow: none; --fold-line-color: #808080; ---fold-minus-image: url('minusd.svg'); ---fold-plus-image: url('plusd.svg'); ---fold-minus-image-relpath: url('../../minusd.svg'); ---fold-plus-image-relpath: url('../../plusd.svg'); /** font-family */ ---font-family-normal: Roboto,sans-serif; +--font-family-normal: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; --font-family-monospace: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; --font-family-nav: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; ---font-family-title: Tahoma,Arial,sans-serif; +--font-family-title: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,BlinkMacSystemFont,"Segoe UI",Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol"; --font-family-toc: Verdana,'DejaVu Sans',Geneva,sans-serif; --font-family-search: Arial,Verdana,sans-serif; --font-family-icon: Arial,Helvetica; @@ -389,8 +405,8 @@ html { --invariant-color-text: #cceed5; }} body { - background-color: var(--page-background-color); - color: var(--page-foreground-color); + background-color: var(--page-background-color); + color: var(--page-foreground-color); } body, table, div, p, dl { @@ -400,13 +416,22 @@ body, table, div, p, dl { line-height: 22px; } +body.resizing { + user-select: none; + -webkit-user-select: none; +} + +#doc-content { + scrollbar-width: thin; +} + /* @group Heading Levels */ .title { font-family: var(--font-family-normal); line-height: 28px; - font-size: 150%; - font-weight: bold; + font-size: 160%; + font-weight: 400; margin: 10px 2px; } @@ -415,7 +440,10 @@ h1.groupheader { } h2.groupheader { - border-bottom: 1px solid var(--group-header-separator-color); + box-shadow: 12px 0 var(--page-background-color), + -12px 0 var(--page-background-color), + 12px 1px var(--group-header-separator-color), + -12px 1px var(--group-header-separator-color); color: var(--group-header-color); font-size: 150%; font-weight: normal; @@ -425,6 +453,13 @@ h2.groupheader { width: 100%; } +td h2.groupheader { + box-shadow: 13px 0 var(--page-background-color), + -13px 0 var(--page-background-color), + 13px 1px var(--group-header-separator-color), + -13px 1px var(--group-header-separator-color); +} + h3.groupheader { font-size: 100%; } @@ -451,8 +486,8 @@ p.startli, p.startdd { } th p.starttd, th p.intertd, th p.endtd { - font-size: 100%; - font-weight: 700; + font-size: 100%; + font-weight: 700; } p.starttd { @@ -497,9 +532,11 @@ h3.version { } div.navtab { - padding-right: 15px; + margin-right: 6px; + padding-right: 6px; text-align: right; line-height: 110%; + background-color: var(--nav-background-color); } div.navtab table { @@ -512,19 +549,10 @@ td.navtab { } td.navtabHL { - background-image: var(--nav-gradient-active-image); - background-repeat:repeat-x; padding-right: 6px; padding-left: 6px; -} - -td.navtabHL a, td.navtabHL a:visited { - color: var(--nav-text-hover-color); - text-shadow: var(--nav-text-hover-shadow); -} - -a.navtab { - font-weight: bold; + border-radius: 0 6px 6px 0; + background-color: var(--nav-menu-active-bg); } div.qindex{ @@ -599,16 +627,11 @@ a { color: var(--page-visited-link-color); } -a:hover { +span.label a:hover { text-decoration: none; background: linear-gradient(to bottom, transparent 0,transparent calc(100% - 1px), currentColor 100%); } -a:hover > span.arrow { - text-decoration: none; - background : var(--nav-background-color); -} - a.el { font-weight: bold; } @@ -616,12 +639,12 @@ a.el { a.elRef { } -a.code, a.code:visited, a.line, a.line:visited { - color: var(--code-link-color); +a.el, a.el:visited, a.code, a.code:visited, a.line, a.line:visited { + color: var(--page-link-color); } a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { - color: var(--code-external-link-color); + color: var(--page-external-link-color); } a.code.hl_class { /* style for links to class names in code snippets */ } @@ -658,119 +681,124 @@ dl.el { } ul.check { - list-style:none; - text-indent: -16px; - padding-left: 38px; + list-style:none; + text-indent: -16px; + padding-left: 38px; } li.unchecked:before { - content: "\2610\A0"; + content: "\2610\A0"; } li.checked:before { - content: "\2611\A0"; + content: "\2611\A0"; } ol { - text-indent: 0px; + text-indent: 0px; } ul { - text-indent: 0px; - overflow: visible; + text-indent: 0px; + overflow: visible; } ul.multicol { - -moz-column-gap: 1em; - -webkit-column-gap: 1em; - column-gap: 1em; - -moz-column-count: 3; - -webkit-column-count: 3; - column-count: 3; - list-style-type: none; + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; } #side-nav ul { - overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ } #main-nav ul { - overflow: visible; /* reset ul rule for the navigation bar drop down lists */ + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ } .fragment { - text-align: left; - direction: ltr; - overflow-x: auto; - overflow-y: hidden; - position: relative; - min-height: 12px; - margin: 10px 0px; - padding: 10px 10px; - border: 1px solid var(--fragment-border-color); - border-radius: 4px; - background-color: var(--fragment-background-color); - color: var(--fragment-foreground-color); + text-align: left; + direction: ltr; + overflow-x: auto; + overflow-y: hidden; + position: relative; + min-height: 12px; + margin: 10px 0px; + padding: 10px 10px; + border: 1px solid var(--fragment-border-color); + border-radius: 4px; + background-color: var(--fragment-background-color); + color: var(--fragment-foreground-color); } pre.fragment { - word-wrap: break-word; - font-size: 10pt; - line-height: 125%; - font-family: var(--font-family-monospace); + word-wrap: break-word; + font-size: 10pt; + line-height: 125%; + font-family: var(--font-family-monospace); +} + +span.tt { + white-space: pre; + font-family: var(--font-family-monospace); } .clipboard { - width: 24px; - height: 24px; - right: 5px; - top: 5px; - opacity: 0; - position: absolute; - display: inline; - overflow: auto; - fill: var(--fragment-foreground-color); - justify-content: center; - align-items: center; - cursor: pointer; + width: 24px; + height: 24px; + right: 5px; + top: 5px; + opacity: 0; + position: absolute; + display: inline; + overflow: hidden; + justify-content: center; + align-items: center; + cursor: pointer; } .clipboard.success { - border: 1px solid var(--fragment-foreground-color); - border-radius: 4px; + border: 1px solid var(--fragment-foreground-color); + border-radius: 4px; } .fragment:hover .clipboard, .clipboard.success { - opacity: .28; + opacity: .4; } .clipboard:hover, .clipboard.success { - opacity: 1 !important; + opacity: 1 !important; } .clipboard:active:not([class~=success]) svg { - transform: scale(.91); + transform: scale(.91); } .clipboard.success svg { - fill: var(--fragment-copy-ok-color); + fill: var(--fragment-copy-ok-color); } .clipboard.success { - border-color: var(--fragment-copy-ok-color); + border-color: var(--fragment-copy-ok-color); } div.line { font-family: var(--font-family-monospace); - font-size: 13px; + font-size: 13px; min-height: 13px; line-height: 1.2; - text-wrap: unrestricted; + text-wrap: wrap; + word-break: break-all; white-space: -moz-pre-wrap; /* Moz */ white-space: -pre-wrap; /* Opera 4-6 */ white-space: -o-pre-wrap; /* Opera 7 */ white-space: pre-wrap; /* CSS3 */ word-wrap: break-word; /* IE 5.5+ */ - text-indent: -53px; - padding-left: 53px; + text-indent: -62px; + padding-left: 62px; padding-bottom: 0px; margin: 0px; -webkit-transition-property: background-color, box-shadow; @@ -786,8 +814,8 @@ div.line { } div.line:after { - content:"\000A"; - white-space: pre; + content:"\000A"; + white-space: pre; } div.line.glow { @@ -796,26 +824,67 @@ div.line.glow { } span.fold { - margin-left: 5px; - margin-right: 1px; - margin-top: 0px; - margin-bottom: 0px; - padding: 0px; display: inline-block; width: 12px; height: 12px; - background-repeat:no-repeat; - background-position:center; + margin-left: 4px; + margin-right: 1px; +} + +span.foldnone { + display: inline-block; + position: relative; + cursor: pointer; + user-select: none; +} + +span.fold.plus, span.fold.minus { + width: 10px; + height: 10px; + background-color: var(--fragment-background-color); + position: relative; + border: 1px solid var(--fold-line-color); + margin-right: 1px; +} + +span.fold.plus::before, span.fold.minus::before { + content: ''; + position: absolute; + background-color: var(--fold-line-color); +} + +span.fold.plus::before { + width: 2px; + height: 6px; + top: 2px; + left: 4px; +} + +span.fold.plus::after { + content: ''; + position: absolute; + width: 6px; + height: 2px; + top: 4px; + left: 2px; + background-color: var(--fold-line-color); +} + +span.fold.minus::before { + width: 6px; + height: 2px; + top: 4px; + left: 2px; } span.lineno { padding-right: 4px; - margin-right: 9px; + margin-right: 9px; text-align: right; border-right: 2px solid var(--fragment-lineno-border-color); color: var(--fragment-lineno-foreground-color); background-color: var(--fragment-lineno-background-color); - white-space: pre; + white-space: pre; } span.lineno a, span.lineno a:visited { color: var(--fragment-lineno-link-fg-color); @@ -837,18 +906,27 @@ span.lineno a:hover { } div.classindex ul { - list-style: none; - padding-left: 0; + list-style: none; + padding-left: 0; } div.classindex span.ai { - display: inline-block; + display: inline-block; } div.groupHeader { - margin-left: 16px; - margin-top: 12px; - font-weight: bold; + box-shadow: 13px 0 var(--page-background-color), + -13px 0 var(--page-background-color), + 13px 1px var(--group-header-separator-color), + -13px 1px var(--group-header-separator-color); + color: var(--group-header-color); + font-size: 110%; + font-weight: 500; + margin-left: 0px; + margin-top: 0em; + margin-bottom: 6px; + padding-top: 8px; + padding-bottom: 4px; } div.groupText { @@ -858,13 +936,13 @@ div.groupText { body { color: var(--page-foreground-color); - margin: 0; + margin: 0; } div.contents { margin-top: 10px; margin-left: 12px; - margin-right: 8px; + margin-right: 12px; } p.formulaDsp { @@ -884,9 +962,9 @@ img.formulaInl, img.inline { div.center { text-align: center; - margin-top: 0px; - margin-bottom: 0px; - padding: 0px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; } div.center img { @@ -961,10 +1039,10 @@ span.vhdllogic { } blockquote { - background-color: var(--blockquote-background-color); - border-left: 2px solid var(--blockquote-border-color); - margin: 0 24px 0 4px; - padding: 0 12px 0 16px; + background-color: var(--blockquote-background-color); + border-left: 2px solid var(--blockquote-border-color); + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; } /* @end */ @@ -986,9 +1064,14 @@ th.dirtab { } hr { - height: 0px; border: none; - border-top: 1px solid var(--separator-color); + margin-top: 16px; + margin-bottom: 16px; + height: 1px; + box-shadow: 13px 0 var(--page-background-color), + -13px 0 var(--page-background-color), + 13px 1px var(--group-header-separator-color), + -13px 1px var(--group-header-separator-color); } hr.footer { @@ -1003,14 +1086,6 @@ table.memberdecls { } .memberdecls td, .fieldtable tr { - -webkit-transition-property: background-color, box-shadow; - -webkit-transition-duration: 0.5s; - -moz-transition-property: background-color, box-shadow; - -moz-transition-duration: 0.5s; - -ms-transition-property: background-color, box-shadow; - -ms-transition-duration: 0.5s; - -o-transition-property: background-color, box-shadow; - -o-transition-duration: 0.5s; transition-property: background-color, box-shadow; transition-duration: 0.5s; } @@ -1020,13 +1095,23 @@ table.memberdecls { box-shadow: 0 0 15px var(--glow-color); } +.memberdecls tr[class^='memitem'] { + font-family: var(--font-family-monospace); +} + .mdescLeft, .mdescRight, -.memItemLeft, .memItemRight, -.memTemplItemLeft, .memTemplItemRight, .memTemplParams { +.memItemLeft, .memItemRight { + padding-top: 2px; + padding-bottom: 2px; +} + +.memTemplParams { + padding-left: 10px; + padding-top: 5px; +} + +.memItemLeft, .memItemRight, .memTemplParams { background-color: var(--memdecl-background-color); - border: none; - margin: 4px; - padding: 1px 0 0 8px; } .mdescLeft, .mdescRight { @@ -1034,27 +1119,104 @@ table.memberdecls { color: var(--memdecl-foreground-color); } -.memSeparator { - border-bottom: 1px solid var(--memdecl-separator-color); - line-height: 1px; - margin: 0px; - padding: 0px; +tr[class^='memdesc'] { + box-shadow: inset 0px 1px 3px 0px rgba(0,0,0,.075); } -.memItemLeft, .memTemplItemLeft { - white-space: nowrap; +.mdescLeft { + border-left: 1px solid var(--memdecl-border-color); + border-bottom: 1px solid var(--memdecl-border-color); } -.memItemRight, .memTemplItemRight { - width: 100%; +.mdescRight { + border-right: 1px solid var(--memdecl-border-color); + border-bottom: 1px solid var(--memdecl-border-color); } .memTemplParams { color: var(--memdecl-template-color); - white-space: nowrap; + white-space: nowrap; font-size: 80%; + border-left: 1px solid var(--memdecl-border-color); + border-right: 1px solid var(--memdecl-border-color); +} + +td.ititle { + border: 1px solid var(--memdecl-border-color); + border-top-left-radius: 4px; + border-top-right-radius: 4px; + padding-left: 10px; +} + +tr:not(:first-child) > td.ititle { + border-top: 0; + border-radius: 0; } +.memItemLeft { + white-space: nowrap; + border-left: 1px solid var(--memdecl-border-color); + border-bottom: 1px solid var(--memdecl-border-color); + padding-left: 10px; + transition: none; +} + +.memItemRight { + width: 100%; + border-right: 1px solid var(--memdecl-border-color); + border-bottom: 1px solid var(--memdecl-border-color); + padding-right: 10px; + transition: none; +} + +tr.heading + tr[class^='memitem'] td.memItemLeft, +tr.groupHeader + tr[class^='memitem'] td.memItemLeft, +tr.inherit_header + tr[class^='memitem'] td.memItemLeft { + border-top: 1px solid var(--memdecl-border-color); + border-top-left-radius: 4px; +} + +tr.heading + tr[class^='memitem'] td.memItemRight, +tr.groupHeader + tr[class^='memitem'] td.memItemRight, +tr.inherit_header + tr[class^='memitem'] td.memItemRight { + border-top: 1px solid var(--memdecl-border-color); + border-top-right-radius: 4px; +} + +tr.heading + tr[class^='memitem'] td.memTemplParams, +tr.heading + tr td.ititle, +tr.groupHeader + tr[class^='memitem'] td.memTemplParams, +tr.groupHeader + tr td.ititle, +tr.inherit_header + tr[class^='memitem'] td.memTemplParams { + border-top: 1px solid var(--memdecl-border-color); + border-top-left-radius: 4px; + border-top-right-radius: 4px; +} + +table.memberdecls tr:last-child td.memItemLeft, +table.memberdecls tr:last-child td.mdescLeft, +table.memberdecls tr[class^='memitem']:has(+ tr.groupHeader) td.memItemLeft, +table.memberdecls tr[class^='memitem']:has(+ tr.inherit_header) td.memItemLeft, +table.memberdecls tr[class^='memdesc']:has(+ tr.groupHeader) td.mdescLeft, +table.memberdecls tr[class^='memdesc']:has(+ tr.inherit_header) td.mdescLeft { + border-bottom-left-radius: 4px; +} + +table.memberdecls tr:last-child td.memItemRight, +table.memberdecls tr:last-child td.mdescRight, +table.memberdecls tr[class^='memitem']:has(+ tr.groupHeader) td.memItemRight, +table.memberdecls tr[class^='memitem']:has(+ tr.inherit_header) td.memItemRight, +table.memberdecls tr[class^='memdesc']:has(+ tr.groupHeader) td.mdescRight, +table.memberdecls tr[class^='memdesc']:has(+ tr.inherit_header) td.mdescRight { + border-bottom-right-radius: 4px; +} + +tr.template .memItemLeft, tr.template .memItemRight { + border-top: none; + padding-top: 0; +} + + /* @end */ /* @group Member Details */ @@ -1069,24 +1231,43 @@ table.memberdecls { border-top-right-radius: 4px; border-top-left-radius: 4px; margin-bottom: -1px; - background-image: var(--memdef-title-gradient-image); - background-repeat: repeat-x; - background-color: var(--memdef-title-background-color); + background-color: var(--memdef-proto-background-color); line-height: 1.25; - font-weight: 300; + font-family: var(--font-family-monospace); + font-weight: 500; + font-size: 16px; float:left; + box-shadow: 0 10px 0 -1px var(--memdef-proto-background-color), + 0 2px 8px 0 rgba(0,0,0,.075); + position: relative; +} + +.memtitle:after { + content: ''; + display: block; + background: var(--memdef-proto-background-color); + height: 10px; + bottom: -10px; + left: 0px; + right: -14px; + position: absolute; + border-top-right-radius: 6px; } .permalink { - font-size: 65%; - display: inline-block; - vertical-align: middle; + font-family: var(--font-family-monospace); + font-weight: 500; + line-height: 1.25; + font-size: 16px; + display: inline-block; + vertical-align: middle; } .memtemplate { font-size: 80%; color: var(--memdef-template-color); + font-family: var(--font-family-monospace); font-weight: normal; margin-left: 9px; } @@ -1099,22 +1280,21 @@ table.memberdecls { padding: 0; margin-bottom: 10px; margin-right: 5px; - -webkit-transition: box-shadow 0.5s linear; - -moz-transition: box-shadow 0.5s linear; - -ms-transition: box-shadow 0.5s linear; - -o-transition: box-shadow 0.5s linear; - transition: box-shadow 0.5s linear; - display: table !important; - width: 100%; + display: table !important; + width: 100%; + box-shadow: 0 2px 8px 0 rgba(0,0,0,.075); + border-radius: 4px; } .memitem.glow { - box-shadow: 0 0 15px var(--glow-color); + box-shadow: 0 0 15px var(--glow-color); } .memname { - font-weight: 400; - margin-left: 6px; + font-family: var(--font-family-monospace); + font-size: 13px; + font-weight: 400; + margin-left: 6px; } .memname td { @@ -1122,53 +1302,39 @@ table.memberdecls { } .memproto, dl.reflist dt { - border-top: 1px solid var(--memdef-border-color); - border-left: 1px solid var(--memdef-border-color); - border-right: 1px solid var(--memdef-border-color); - padding: 6px 0px 6px 0px; - color: var(--memdef-proto-text-color); - font-weight: bold; - text-shadow: var(--memdef-proto-text-shadow); - background-color: var(--memdef-proto-background-color); - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - border-top-right-radius: 4px; + border-top: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 0px 6px 0px; + color: var(--memdef-proto-text-color); + font-weight: bold; + background-color: var(--memdef-proto-background-color); + border-top-right-radius: 4px; + border-bottom: 1px solid var(--memdef-border-color); } .overload { - font-family: var(--font-family-monospace); + font-family: var(--font-family-monospace); font-size: 65%; } .memdoc, dl.reflist dd { - border-bottom: 1px solid var(--memdef-border-color); - border-left: 1px solid var(--memdef-border-color); - border-right: 1px solid var(--memdef-border-color); - padding: 6px 10px 2px 10px; - border-top-width: 0; - background-image:url('nav_g.png'); - background-repeat:repeat-x; - background-color: var(--memdef-doc-background-color); - /* opera specific markup */ - border-bottom-left-radius: 4px; - border-bottom-right-radius: 4px; - box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); - /* firefox specific markup */ - -moz-border-radius-bottomleft: 4px; - -moz-border-radius-bottomright: 4px; - -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; - /* webkit specific markup */ - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-bottom: 1px solid var(--memdef-border-color); + border-left: 1px solid var(--memdef-border-color); + border-right: 1px solid var(--memdef-border-color); + padding: 6px 10px 2px 10px; + border-top-width: 0; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; } dl.reflist dt { - padding: 5px; + padding: 5px; } dl.reflist dd { - margin: 0px 0px 10px 0px; - padding: 5px; + margin: 0px 0px 10px 0px; + padding: 5px; } .paramkey { @@ -1183,9 +1349,9 @@ dl.reflist dd { .paramname { white-space: nowrap; - padding: 0px; - padding-bottom: 1px; - margin-left: 2px; + padding: 0px; + padding-bottom: 1px; + margin-left: 2px; } .paramname em { @@ -1199,23 +1365,23 @@ dl.reflist dd { } .params, .retval, .exception, .tparams { - margin-left: 0px; - padding-left: 0px; + margin-left: 0px; + padding-left: 0px; } .params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { - font-weight: bold; - vertical-align: top; + font-weight: bold; + vertical-align: top; } .params .paramtype, .tparams .paramtype { - font-style: italic; - vertical-align: top; + font-style: italic; + vertical-align: top; } .params .paramdir, .tparams .paramdir { - font-family: var(--font-family-monospace); - vertical-align: top; + font-family: var(--font-family-monospace); + vertical-align: top; } table.mlabels { @@ -1234,15 +1400,15 @@ td.mlabels-right { } span.mlabels { - margin-left: 8px; + margin-left: 8px; } span.mlabel { - background-color: var(--label-background-color); - border-top:1px solid var(--label-left-top-border-color); - border-left:1px solid var(--label-left-top-border-color); - border-right:1px solid var(--label-right-bottom-border-color); - border-bottom:1px solid var(--label-right-bottom-border-color); + background-color: var(--label-background-color); + border-top:1px solid var(--label-left-top-border-color); + border-left:1px solid var(--label-left-top-border-color); + border-right:1px solid var(--label-right-bottom-border-color); + border-bottom:1px solid var(--label-right-bottom-border-color); text-shadow: none; color: var(--label-foreground-color); margin-right: 4px; @@ -1260,39 +1426,37 @@ span.mlabel { /* these are for tree view inside a (index) page */ div.directory { - margin: 10px 0px; - border-top: 1px solid var(--directory-separator-color); - border-bottom: 1px solid var(--directory-separator-color); - width: 100%; + margin: 10px 0px; + width: 100%; } .directory table { - border-collapse:collapse; + border-collapse:collapse; } .directory td { - margin: 0px; - padding: 0px; + margin: 0px; + padding: 0px; vertical-align: top; } .directory td.entry { - white-space: nowrap; - padding-right: 6px; + white-space: nowrap; + padding-right: 6px; padding-top: 3px; } .directory td.entry a { - outline:none; + outline:none; } .directory td.entry a img { - border: none; + border: none; } .directory td.desc { - width: 100%; - padding-left: 6px; + width: 100%; + padding-left: 6px; padding-right: 6px; padding-top: 3px; border-left: 1px solid rgba(0,0,0,0.05); @@ -1313,90 +1477,178 @@ div.directory { } .directory .levels { - white-space: nowrap; - width: 100%; - text-align: right; - font-size: 9pt; + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; } .directory .levels span { - cursor: pointer; - padding-left: 2px; - padding-right: 2px; + cursor: pointer; + padding-left: 2px; + padding-right: 2px; color: var(--page-link-color); } .arrow { - color: var(--nav-arrow-color); - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - cursor: pointer; - font-size: 80%; - display: inline-block; - width: 16px; - height: 22px; + color: var(--nav-background-color); + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 14px; + transition: opacity 0.3s ease; +} + +span.arrowhead { + position: relative; + padding: 0; + margin: 0 0 0 2px; + display: inline-block; + width: 5px; + height: 5px; + border-right: 2px solid var(--nav-arrow-color); + border-bottom: 2px solid var(--nav-arrow-color); + transform: rotate(-45deg); + transition: transform 0.3s ease; +} + +span.arrowhead.opened { + transform: rotate(45deg); +} + +.selected span.arrowhead { + border-right: 2px solid var(--nav-arrow-selected-color); + border-bottom: 2px solid var(--nav-arrow-selected-color); } .icon { - font-family: var(--font-family-icon); - line-height: normal; - font-weight: bold; - font-size: 12px; - height: 14px; - width: 16px; - display: inline-block; - background-color: var(--icon-background-color); - color: var(--icon-foreground-color); - text-align: center; - border-radius: 4px; - margin-left: 2px; - margin-right: 2px; + font-family: var(--font-family-icon); + line-height: normal; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: var(--icon-background-color); + color: var(--icon-foreground-color); + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; } .icona { - width: 24px; - height: 22px; - display: inline-block; + width: 24px; + height: 22px; + display: inline-block; } -.iconfopen { - width: 24px; - height: 18px; - margin-bottom: 4px; - background-image:var(--icon-folder-open-image); - background-repeat: repeat-y; - vertical-align:top; - display: inline-block; +.iconfolder { + width: 24px; + height: 18px; + margin-top: 6px; + vertical-align:top; + display: inline-block; + position: relative; } -.iconfclosed { - width: 24px; - height: 18px; - margin-bottom: 4px; - background-image:var(--icon-folder-closed-image); - background-repeat: repeat-y; - vertical-align:top; - display: inline-block; +.icondoc { + width: 24px; + height: 18px; + margin-top: 3px; + vertical-align:top; + display: inline-block; + position: relative; } -.icondoc { - width: 24px; - height: 18px; - margin-bottom: 4px; - background-image:var(--icon-doc-image); - background-position: 0px -4px; - background-repeat: repeat-y; - vertical-align:top; - display: inline-block; +.folder-icon { + width: 16px; + height: 11px; + background-color: var(--icon-folder-fill-color); + border: 1px solid var(--icon-folder-border-color); + border-radius: 0 2px 2px 2px; + position: relative; + box-sizing: content-box; +} + +.folder-icon::after { + content: ''; + position: absolute; + top: 2px; + left: -1px; + width: 16px; + height: 7px; + background-color: var(--icon-folder-open-fill-color); + border: 1px solid var(--icon-folder-border-color); + border-radius: 7px 7px 2px 2px; + transform-origin: top left; + opacity: 0; + transition: all 0.3s linear; +} + +.folder-icon::before { + content: ''; + position: absolute; + top: -3px; + left: -1px; + width: 6px; + height: 2px; + background-color: var(--icon-folder-fill-color); + border-top: 1px solid var(--icon-folder-border-color); + border-left: 1px solid var(--icon-folder-border-color); + border-right: 1px solid var(--icon-folder-border-color); + border-radius: 2px 2px 0 0; +} + +.folder-icon.open::after { + top: 3px; + opacity: 1; +} + +.doc-icon { + left: 6px; + width: 12px; + height: 16px; + background-color: var(--icon-doc-border-color); + clip-path: polygon(0 0, 66% 0, 100% 25%, 100% 100%, 0 100%); + position: relative; + display: inline-block; +} +.doc-icon::before { + content: ""; + left: 1px; + top: 1px; + width: 10px; + height: 14px; + background-color: var(--icon-doc-fill-color); + clip-path: polygon(0 0, 66% 0, 100% 25%, 100% 100%, 0 100%); + position: absolute; + box-sizing: border-box; +} +.doc-icon::after { + content: ""; + left: 7px; + top: 0px; + width: 3px; + height: 3px; + background-color: transparent; + position: absolute; + border: 1px solid var(--icon-doc-border-color); } + + + /* @end */ div.dynheader { - margin-top: 8px; + margin-top: 8px; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; @@ -1405,6 +1657,13 @@ div.dynheader { user-select: none; } +span.dynarrow { + position: relative; + display: inline-block; + width: 12px; + bottom: 1px; +} + address { font-style: normal; color: var(--footer-foreground-color); @@ -1416,8 +1675,8 @@ table.doxtable caption { table.doxtable { border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; + margin-top: 4px; + margin-bottom: 4px; } table.doxtable td, table.doxtable th { @@ -1434,133 +1693,145 @@ table.doxtable th { } table.fieldtable { - margin-bottom: 10px; - border: 1px solid var(--memdef-border-color); - border-spacing: 0px; - border-radius: 4px; - box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); + margin-bottom: 10px; + border: 1px solid var(--memdef-border-color); + border-spacing: 0px; + border-radius: 4px; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); } .fieldtable td, .fieldtable th { - padding: 3px 7px 2px; + padding: 3px 7px 2px; } .fieldtable td.fieldtype, .fieldtable td.fieldname, .fieldtable td.fieldinit { - white-space: nowrap; - border-right: 1px solid var(--memdef-border-color); - border-bottom: 1px solid var(--memdef-border-color); - vertical-align: top; + white-space: nowrap; + border-right: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); + vertical-align: top; } .fieldtable td.fieldname { - padding-top: 3px; + padding-top: 3px; } .fieldtable td.fieldinit { - padding-top: 3px; - text-align: right; + padding-top: 3px; + text-align: right; } .fieldtable td.fielddoc { - border-bottom: 1px solid var(--memdef-border-color); + border-bottom: 1px solid var(--memdef-border-color); } .fieldtable td.fielddoc p:first-child { - margin-top: 0px; + margin-top: 0px; } .fieldtable td.fielddoc p:last-child { - margin-bottom: 2px; + margin-bottom: 2px; } .fieldtable tr:last-child td { - border-bottom: none; + border-bottom: none; } .fieldtable th { - background-image: var(--memdef-title-gradient-image); - background-repeat:repeat-x; - background-color: var(--memdef-title-background-color); - font-size: 90%; - color: var(--memdef-proto-text-color); - padding-bottom: 4px; - padding-top: 5px; - text-align:left; - font-weight: 400; - border-top-left-radius: 4px; - border-top-right-radius: 4px; - border-bottom: 1px solid var(--memdef-border-color); -} - - -.tabsearch { - top: 0px; - left: 10px; - height: 36px; - background-image: var(--nav-gradient-image); - z-index: 101; + background-color: var(--memdef-title-background-color); + font-size: 90%; + color: var(--memdef-proto-text-color); + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid var(--memdef-border-color); +} + +/* ----------- navigation breadcrumb styling ----------- */ + +#nav-path ul { + height: 30px; + line-height: 30px; + color: var(--nav-text-normal-color); overflow: hidden; - font-size: 13px; + margin: 0px; + padding-left: 4px; + background-image: none; + background: var(--page-background-color); + border-bottom: 1px solid var(--nav-breadcrumb-separator-color); + font-size: var(--nav-font-size-level1); + font-family: var(--font-family-nav); + position: relative; + z-index: 100; } -.navpath ul -{ - font-size: 11px; - background-image: var(--nav-gradient-image); - background-repeat:repeat-x; - background-position: 0 -5px; - height:30px; - line-height:30px; - color:var(--nav-text-normal-color); - border:solid 1px var(--nav-breadcrumb-border-color); - overflow:hidden; - margin:0px; - padding:0px; -} - -.navpath li -{ +#main-nav { + border-bottom: 1px solid var(--nav-border-color); +} + +.navpath li { list-style-type:none; float:left; + color: var(--nav-foreground-color); +} + +.navpath li.footer { + list-style-type:none; + float:right; padding-left:10px; padding-right:15px; - background-image:var(--nav-breadcrumb-image); + background-image:none; background-repeat:no-repeat; background-position:right; - color: var(--nav-foreground-color); + font-size: 8pt; + color: var(--footer-foreground-color); } -.navpath li.navelem a -{ - height:32px; - display:block; - outline: none; - color: var(--nav-text-normal-color); - font-family: var(--font-family-nav); - text-shadow: var(--nav-text-normal-shadow); - text-decoration: none; +#nav-path li.navelem { + background-image: none; + display: flex; + align-items: center; + padding-left: 15px; } -.navpath li.navelem a:hover -{ - color: var(--nav-text-hover-color); - text-shadow: var(--nav-text-hover-shadow); +.navpath li.navelem a { + text-shadow: none; + display: inline-block; + color: var(--nav-breadcrumb-color); + position: relative; + top: 0px; + height: 30px; + margin-right: -20px; } -.navpath li.footer -{ - list-style-type:none; - float:right; - padding-left:10px; - padding-right:15px; - background-image:none; - background-repeat:no-repeat; - background-position:right; - color: var(--footer-foreground-color); - font-size: 8pt; +#nav-path li.navelem:after { + content: ''; + display: inline-block; + position: relative; + top: 0; + right: -15px; + width: 30px; + height: 30px; + transform: scaleX(0.5) scale(0.707) rotate(45deg); + z-index: 10; + background: var(--page-background-color); + box-shadow: 2px -2px 0 2px var(--nav-breadcrumb-separator-color); + border-radius: 0 5px 0 50px; +} + +#nav-path li.navelem:first-child { + margin-left: -6px; } +#nav-path li.navelem:hover, +#nav-path li.navelem:hover:after { + background-color: var(--nav-breadcrumb-active-bg); +} + +/* ---------------------- */ div.summary { @@ -1578,14 +1849,14 @@ div.summary a table.classindex { - margin: 10px; - white-space: nowrap; - margin-left: 3%; - margin-right: 3%; - width: 94%; - border: 0; - border-spacing: 0; - padding: 0; + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; } div.ingroups @@ -1602,10 +1873,8 @@ div.ingroups a div.header { - background-image: var(--header-gradient-image); - background-repeat:repeat-x; - background-color: var(--header-background-color); margin: 0px; + background-color: var(--header-background-color); border-bottom: 1px solid var(--header-separator-color); } @@ -1614,168 +1883,105 @@ div.headertitle padding: 5px 5px 5px 10px; } -.PageDocRTL-title div.headertitle { - text-align: right; - direction: rtl; -} - dl { - padding: 0 0 0 0; -} - -/* - -dl.section { - margin-left: 0px; - padding-left: 0px; -} - -dl.note { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #D0C000; -} - -dl.warning, dl.attention, dl.important { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #FF0000; -} - -dl.pre, dl.post, dl.invariant { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #00D000; -} - -dl.deprecated { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #505050; -} - -dl.todo { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #00C0E0; -} - -dl.test { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #3030E0; -} - -dl.bug { - margin-left: -7px; - padding-left: 3px; - border-left: 4px solid; - border-color: #C08050; + padding: 0 0 0 0; } -*/ - dl.bug dt a, dl.deprecated dt a, dl.todo dt a, dl.test a { - font-weight: bold !important; + font-weight: bold !important; } dl.warning, dl.attention, dl.important, dl.note, dl.deprecated, dl.bug, dl.invariant, dl.pre, dl.post, dl.todo, dl.test, dl.remark { - padding: 10px; - margin: 10px 0px; - overflow: hidden; - margin-left: 0; - border-radius: 4px; + padding: 10px; + margin: 10px 0px; + overflow: hidden; + margin-left: 0; + border-radius: 4px; } dl.section dd { - margin-bottom: 2px; + margin-bottom: 2px; } dl.warning, dl.attention, dl.important { - background: var(--warning-color-bg); - border-left: 8px solid var(--warning-color-hl); - color: var(--warning-color-text); + background: var(--warning-color-bg); + border-left: 8px solid var(--warning-color-hl); + color: var(--warning-color-text); } dl.warning dt, dl.attention dt, dl.important dt { - color: var(--warning-color-hl); + color: var(--warning-color-hl); } dl.note, dl.remark { - background: var(--note-color-bg); - border-left: 8px solid var(--note-color-hl); - color: var(--note-color-text); + background: var(--note-color-bg); + border-left: 8px solid var(--note-color-hl); + color: var(--note-color-text); } dl.note dt, dl.remark dt { - color: var(--note-color-hl); + color: var(--note-color-hl); } dl.todo { - background: var(--todo-color-bg); - border-left: 8px solid var(--todo-color-hl); - color: var(--todo-color-text); + background: var(--todo-color-bg); + border-left: 8px solid var(--todo-color-hl); + color: var(--todo-color-text); } dl.todo dt { - color: var(--todo-color-hl); + color: var(--todo-color-hl); } dl.test { - background: var(--test-color-bg); - border-left: 8px solid var(--test-color-hl); - color: var(--test-color-text); + background: var(--test-color-bg); + border-left: 8px solid var(--test-color-hl); + color: var(--test-color-text); } dl.test dt { - color: var(--test-color-hl); + color: var(--test-color-hl); } dl.bug dt a { - color: var(--bug-color-hl) !important; + color: var(--bug-color-hl) !important; } dl.bug { - background: var(--bug-color-bg); - border-left: 8px solid var(--bug-color-hl); - color: var(--bug-color-text); + background: var(--bug-color-bg); + border-left: 8px solid var(--bug-color-hl); + color: var(--bug-color-text); } dl.bug dt a { - color: var(--bug-color-hl) !important; + color: var(--bug-color-hl) !important; } dl.deprecated { - background: var(--deprecated-color-bg); - border-left: 8px solid var(--deprecated-color-hl); - color: var(--deprecated-color-text); + background: var(--deprecated-color-bg); + border-left: 8px solid var(--deprecated-color-hl); + color: var(--deprecated-color-text); } dl.deprecated dt a { - color: var(--deprecated-color-hl) !important; + color: var(--deprecated-color-hl) !important; } dl.note dd, dl.warning dd, dl.pre dd, dl.post dd, dl.remark dd, dl.attention dd, dl.important dd, dl.invariant dd, dl.bug dd, dl.deprecated dd, dl.todo dd, dl.test dd { - margin-inline-start: 0px; + margin-inline-start: 0px; } dl.invariant, dl.pre, dl.post { - background: var(--invariant-color-bg); - border-left: 8px solid var(--invariant-color-hl); - color: var(--invariant-color-text); + background: var(--invariant-color-bg); + border-left: 8px solid var(--invariant-color-hl); + color: var(--invariant-color-text); } dl.invariant dt, dl.pre dt, dl.post dt { - color: var(--invariant-color-hl); + color: var(--invariant-color-hl); } @@ -1798,16 +2004,16 @@ dl.invariant dt, dl.pre dt, dl.post dt { #projectalign { - vertical-align: middle; - padding-left: 0.5em; + vertical-align: middle; + padding-left: 0.5em; } #projectname { font-size: 200%; font-family: var(--font-family-title); - margin: 0px; - padding: 2px 0px; + margin: 0; + padding: 0; } #side-nav #projectname @@ -1818,7 +2024,7 @@ dl.invariant dt, dl.pre dt, dl.post dt { #projectbrief { font-size: 90%; - font-family: var(--font-family-title); + font-family: var(--font-family-title); margin: 0px; padding: 0px; } @@ -1826,43 +2032,42 @@ dl.invariant dt, dl.pre dt, dl.post dt { #projectnumber { font-size: 50%; - font-family: 50% var(--font-family-title); + font-family: var(--font-family-title); margin: 0px; padding: 0px; } #titlearea { - padding: 0px; + padding: 0 0 0 5px; margin: 0px; - width: 100%; border-bottom: 1px solid var(--title-separator-color); background-color: var(--title-background-color); } .image { - text-align: center; + text-align: center; } .dotgraph { - text-align: center; + text-align: center; } .mscgraph { - text-align: center; + text-align: center; } .plantumlgraph { - text-align: center; + text-align: center; } .diagraph { - text-align: center; + text-align: center; } .caption @@ -1871,67 +2076,67 @@ dl.invariant dt, dl.pre dt, dl.post dt { } dl.citelist { - margin-bottom:50px; + margin-bottom:50px; } dl.citelist dt { - color:var(--citation-label-color); - float:left; - font-weight:bold; - margin-right:10px; - padding:5px; - text-align:right; - width:52px; + color:var(--citation-label-color); + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; } dl.citelist dd { - margin:2px 0 2px 72px; - padding:5px 0; + margin:2px 0 2px 72px; + padding:5px 0; } div.toc { - padding: 14px 25px; - background-color: var(--toc-background-color); - border: 1px solid var(--toc-border-color); - border-radius: 7px 7px 7px 7px; - float: right; - height: auto; - margin: 0 8px 10px 10px; - width: 200px; + padding: 14px 25px; + background-color: var(--toc-background-color); + border: 1px solid var(--toc-border-color); + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; } div.toc li { - background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; - font: 10px/1.2 var(--font-family-toc); - margin-top: 5px; - padding-left: 10px; - padding-top: 2px; + background: var(--toc-down-arrow-image) no-repeat scroll 0 5px transparent; + font: 10px/1.2 var(--font-family-toc); + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; } div.toc h3 { - font: bold 12px/1.2 var(--font-family-toc); + font: bold 12px/1.2 var(--font-family-toc); color: var(--toc-header-color); - border-bottom: 0 none; - margin: 0; + border-bottom: 0 none; + margin: 0; } div.toc ul { - list-style: none outside none; - border: medium none; - padding: 0px; + list-style: none outside none; + border: medium none; + padding: 0px; } div.toc li[class^='level'] { - margin-left: 15px; + margin-left: 15px; } div.toc li.level1 { - margin-left: 0px; + margin-left: 0px; } div.toc li.empty { - background-image: none; - margin-top: 0px; + background-image: none; + margin-top: 0px; } span.emoji { @@ -1941,13 +2146,12 @@ span.emoji { } span.obfuscator { - display: none; + display: none; } .inherit_header { - font-weight: bold; - color: var(--inherit-header-color); - cursor: pointer; + font-weight: 400; + cursor: pointer; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; @@ -1957,49 +2161,49 @@ span.obfuscator { } .inherit_header td { - padding: 6px 0px 2px 5px; + padding: 6px 0 2px 0; } .inherit { - display: none; + display: none; } tr.heading h2 { - margin-top: 12px; - margin-bottom: 4px; + margin-top: 12px; + margin-bottom: 12px; } /* tooltip related style info */ .ttc { - position: absolute; - display: none; + position: absolute; + display: none; } #powerTip { cursor: default; - /*white-space: nowrap;*/ - color: var(--tooltip-foreground-color); + color: var(--tooltip-foreground-color); background-color: var(--tooltip-background-color); + backdrop-filter: var(--tooltip-backdrop-filter); + -webkit-backdrop-filter: var(--tooltip-backdrop-filter); border: 1px solid var(--tooltip-border-color); - border-radius: 4px 4px 4px 4px; + border-radius: 4px; box-shadow: var(--tooltip-shadow); display: none; font-size: smaller; max-width: 80%; - opacity: 0.9; padding: 1ex 1em 1em; position: absolute; z-index: 2147483647; } #powerTip div.ttdoc { - color: var(--tooltip-doc-color); + color: var(--tooltip-doc-color); font-style: italic; } #powerTip div.ttname a { - font-weight: bold; + font-weight: bold; } #powerTip a { @@ -2007,18 +2211,18 @@ tr.heading h2 { } #powerTip div.ttname { - font-weight: bold; + font-weight: bold; } #powerTip div.ttdeci { - color: var(--tooltip-declaration-color); + color: var(--tooltip-declaration-color); } #powerTip div { - margin: 0px; - padding: 0px; - font-size: 12px; - font-family: var(--font-family-tooltip); + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: var(--font-family-tooltip); line-height: 16px; } @@ -2064,7 +2268,7 @@ tr.heading h2 { } #powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { - border-top-color: var(--tooltip-background-color); + border-top-color: var(--tooltip-arrow-background-color); border-width: 10px; margin: 0px -10px; } @@ -2092,7 +2296,7 @@ tr.heading h2 { } #powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { - border-bottom-color: var(--tooltip-background-color); + border-bottom-color: var(--tooltip-arrow-background-color); border-width: 10px; margin: 0px -10px; } @@ -2149,29 +2353,29 @@ tr.heading h2 { @media print { - #top { display: none; } - #side-nav { display: none; } - #nav-path { display: none; } - body { overflow:visible; } - h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } - .summary { display: none; } - .memitem { page-break-inside: avoid; } - #doc-content - { - margin-left:0 !important; - height:auto !important; - width:auto !important; - overflow:inherit; - display:inline; - } + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } } /* @group Markdown */ table.markdownTable { border-collapse:collapse; - margin-top: 4px; - margin-bottom: 4px; + margin-top: 4px; + margin-bottom: 4px; } table.markdownTable td, table.markdownTable th { @@ -2204,11 +2408,11 @@ th.markdownTableHeadCenter, td.markdownTableBodyCenter { tt, code, kbd { - display: inline-block; + display: inline-block; } tt, code, kbd { - vertical-align: top; + vertical-align: top; } /* @end */ @@ -2217,26 +2421,27 @@ u { } details>summary { - list-style-type: none; + list-style-type: none; } details > summary::-webkit-details-marker { - display: none; + display: none; } details>summary::before { - content: "\25ba"; - padding-right:4px; - font-size: 80%; + content: "\25ba"; + padding-right:4px; + font-size: 80%; } details[open]>summary::before { - content: "\25bc"; - padding-right:4px; - font-size: 80%; + content: "\25bc"; + padding-right:4px; + font-size: 80%; } -body { +:root { + scrollbar-width: thin; scrollbar-color: var(--scrollbar-thumb-color) var(--scrollbar-background-color); } diff --git a/docs/html/doxygen_crawl.html b/docs/html/doxygen_crawl.html index 8a275e66..59983e24 100644 --- a/docs/html/doxygen_crawl.html +++ b/docs/html/doxygen_crawl.html @@ -4,7 +4,7 @@ Validator / crawler helper - + @@ -70,6 +70,7 @@ + @@ -249,9 +250,13 @@ - - - + + + + + + + @@ -447,10 +452,5 @@ - - - - - diff --git a/docs/html/dynsections.js b/docs/html/dynsections.js index b05f4c8d..0e15bd4d 100644 --- a/docs/html/dynsections.js +++ b/docs/html/dynsections.js @@ -28,7 +28,6 @@ function toggleVisibility(linkObj) { } let dynsection = { - // helper function updateStripes : function() { $('table.directory tr'). @@ -44,15 +43,13 @@ let dynsection = { const trigger = $('#'+base+'-trigger'); const src=$(trigger).attr('src'); if (content.is(':visible')===true) { - content.hide(); + content.slideUp('fast'); summary.show(); - $(linkObj).addClass('closed').removeClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + $(linkObj).find('.arrowhead').addClass('closed').removeClass('opened'); } else { - content.show(); + content.slideDown('fast'); summary.hide(); - $(linkObj).removeClass('closed').addClass('opened'); - $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + $(linkObj).find('.arrowhead').removeClass('closed').addClass('opened'); } return false; }, @@ -63,12 +60,12 @@ let dynsection = { const i = $('#img'+this.id.substring(3)); const a = $('#arr'+this.id.substring(3)); if (l'); + $('span[class=lineno]:first').append(''); // add vertical lines to other rows $('span[class=lineno]').not(':eq(0)').append(''); // add toggle controls to lines with fold divs @@ -173,9 +167,8 @@ let codefold = { const start = $(this).attr('data-start'); const end = $(this).attr('data-end'); // replace normal fold span with controls for the first line of a foldable fragment - $(this).find('span[class=fold]:first').replaceWith(''); + $(this).find('span[class=fold]:first').replaceWith(''); // append div for folded (closed) representation $(this).after(''); // extract the first line from the "open" section to represent closed content @@ -187,7 +180,7 @@ let codefold = { $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); } // replace minus with plus symbol - $(line).find('span[class=fold]').css('background-image',codefold.plusImg[relPath]); + $(line).find('span[class=fold]').addClass('plus').removeClass('minus'); // append ellipsis $(line).append(' '+start+''+end); // insert constructed line into closed div diff --git a/docs/html/enabling_buffer_device_address.html b/docs/html/enabling_buffer_device_address.html index 30919e34..46613248 100644 --- a/docs/html/enabling_buffer_device_address.html +++ b/docs/html/enabling_buffer_device_address.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Enabling buffer device address - - @@ -33,33 +31,22 @@ - + -
    -
    Enabling buffer device address
    +
    Enabling buffer device address

    Device extension VK_KHR_buffer_device_address allow to fetch raw GPU pointer to a buffer and pass it for usage in a shader code. It has been promoted to core Vulkan 1.2.

    If you want to use this feature in connection with VMA, follow these steps:

    -

    +

    Initialization

    -

    1) (For Vulkan version < 1.2) Call vkEnumerateDeviceExtensionProperties for the physical device. Check if the extension is supported - if returned array of VkExtensionProperties contains "VK_KHR_buffer_device_address".

    -

    2) Call vkGetPhysicalDeviceFeatures2 for the physical device instead of old vkGetPhysicalDeviceFeatures. Attach additional structure VkPhysicalDeviceBufferDeviceAddressFeatures* to VkPhysicalDeviceFeatures2::pNext to be returned. Check if the device feature is really supported - check if VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress is true.

    -

    3) (For Vulkan version < 1.2) While creating device with vkCreateDevice, enable this extension - add "VK_KHR_buffer_device_address" to the list passed as VkDeviceCreateInfo::ppEnabledExtensionNames.

    -

    4) While creating the device, also don't set VkDeviceCreateInfo::pEnabledFeatures. Fill in VkPhysicalDeviceFeatures2 structure instead and pass it as VkDeviceCreateInfo::pNext. Enable this device feature - attach additional structure VkPhysicalDeviceBufferDeviceAddressFeatures* to VkPhysicalDeviceFeatures2::pNext and set its member bufferDeviceAddress to VK_TRUE.

    +

    1) (For Vulkan version < 1.2) Call vkEnumerateDeviceExtensionProperties for the physical device. Check if the extension is supported - if returned array of VkExtensionProperties contains "VK_KHR_buffer_device_address".

    +

    2) Call vkGetPhysicalDeviceFeatures2 for the physical device instead of old vkGetPhysicalDeviceFeatures. Attach additional structure VkPhysicalDeviceBufferDeviceAddressFeatures* to VkPhysicalDeviceFeatures2::pNext to be returned. Check if the device feature is really supported - check if VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress is true.

    +

    3) (For Vulkan version < 1.2) While creating device with vkCreateDevice, enable this extension - add "VK_KHR_buffer_device_address" to the list passed as VkDeviceCreateInfo::ppEnabledExtensionNames.

    +

    4) While creating the device, also don't set VkDeviceCreateInfo::pEnabledFeatures. Fill in VkPhysicalDeviceFeatures2 structure instead and pass it as VkDeviceCreateInfo::pNext. Enable this device feature - attach additional structure VkPhysicalDeviceBufferDeviceAddressFeatures* to VkPhysicalDeviceFeatures2::pNext and set its member bufferDeviceAddress to VK_TRUE.

    5) While creating VmaAllocator with vmaCreateAllocator() inform VMA that you have enabled this feature - add VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT to VmaAllocatorCreateInfo::flags.

    -

    +

    Usage

    -

    After following steps described above, you can create buffers with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT* using VMA. The library automatically adds VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT* to allocated memory blocks wherever it might be needed.

    -

    Please note that the library supports only VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT*. The second part of this functionality related to "capture and replay" is not supported, as it is intended for usage in debugging tools like RenderDoc, not in everyday Vulkan usage.

    -

    +

    After following steps described above, you can create buffers with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT* using VMA. The library automatically adds VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT* to allocated memory blocks wherever it might be needed.

    +

    Please note that the library supports only VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT*. The second part of this functionality related to "capture and replay" is not supported, as it is intended for usage in debugging tools like RenderDoc, not in everyday Vulkan usage.

    +

    More information

    To learn more about this extension, see VK_KHR_buffer_device_address in Vulkan specification

    Example use of this extension can be found in the code of the sample and test suite accompanying this library.

    @@ -112,7 +99,7 @@

    diff --git a/docs/html/faq.html b/docs/html/faq.html index b06d7ba4..9c916757 100644 --- a/docs/html/faq.html +++ b/docs/html/faq.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Frequently asked questions - - @@ -33,33 +31,22 @@
    - + -
    -
    Frequently asked questions
    +
    Frequently asked questions

    What is VMA?

    @@ -96,7 +83,7 @@

    What is the license of VMA?

    VMA is licensed under MIT, which means it is open source and free software.

    What is the purpose of VMA?

    -

    VMA helps with handling one aspect of Vulkan usage, which is device memory management - allocation of VkDeviceMemory objects, and creation of VkBuffer and VkImage objects.

    +

    VMA helps with handling one aspect of Vulkan usage, which is device memory management - allocation of VkDeviceMemory objects, and creation of VkBuffer and VkImage objects.

    Do I need to use VMA?

    You don't need to, but it may be beneficial in many cases. Vulkan is a complex and low-level API, so libraries like this that abstract certain aspects of the API and bring them to a higher level are useful. When developing any non-trivial Vulkan application, you likely need to use a memory allocator. Using VMA can save time compared to implementing your own.

    When should I not use VMA?

    @@ -104,10 +91,10 @@

    What are the benefits of using VMA?

    1. VMA helps in choosing the optimal memory type for your resource (buffer or image). In Vulkan, we have a two-level hierarchy of memory heaps and types with different flags, and each device can expose a different set of those. Implementing logic that would select the best memory type on each platform is a non-trivial task. VMA does that, expecting only a high-level description of the intended usage of your resource. For more information, see Choosing memory type.
    2. -
    3. VMA allocates large blocks of VkDeviceMemory and sub-allocates parts of them for your resources. Allocating a new block of device memory may be a time-consuming operation. Some platforms also have a limit on the maximum number of those blocks (VkPhysicalDeviceLimits::maxMemoryAllocationCount) as low as 4096, so allocating a separate one for each resource is not an option. Sub-allocating parts of a memory block requires implementing an allocation algorithm, which is a non-trivial task. VMA does that, using an advanced and efficient algorithm that works well in various use cases.
    4. -
    5. VMA offers a simple API that allows creating buffers and textures within one function call. In Vulkan, the creation of a resource is a multi-step process. You need to create a VkBuffer or VkImage, ask it for memory requirements, allocate a VkDeviceMemory object, and finally bind the resource to the memory block. VMA does that automatically under a simple API within one function call: vmaCreateBuffer(), vmaCreateImage().
    6. +
    7. VMA allocates large blocks of VkDeviceMemory and sub-allocates parts of them for your resources. Allocating a new block of device memory may be a time-consuming operation. Some platforms also have a limit on the maximum number of those blocks (VkPhysicalDeviceLimits::maxMemoryAllocationCount) as low as 4096, so allocating a separate one for each resource is not an option. Sub-allocating parts of a memory block requires implementing an allocation algorithm, which is a non-trivial task. VMA does that, using an advanced and efficient algorithm that works well in various use cases.
    8. +
    9. VMA offers a simple API that allows creating buffers and textures within one function call. In Vulkan, the creation of a resource is a multi-step process. You need to create a VkBuffer or VkImage, ask it for memory requirements, allocate a VkDeviceMemory object, and finally bind the resource to the memory block. VMA does that automatically under a simple API within one function call: vmaCreateBuffer(), vmaCreateImage().
    -

    The library is doing much more under the hood. For example, it respects limits like bufferImageGranularity, nonCoherentAtomSize, and VkMemoryDedicatedRequirements automatically, so you don't need to think about it.

    +

    The library is doing much more under the hood. For example, it respects limits like bufferImageGranularity, nonCoherentAtomSize, and VkMemoryDedicatedRequirements automatically, so you don't need to think about it.

    Which version should I pick?

    You can just pick the latest version from the "master" branch. It is kept in a good shape most of the time, compiling and working correctly, with no compatibility-breaking changes and no unfinished code.

    If you want an even more stable version, you can pick the latest official release. Current code from the master branch is occasionally tagged as a release, with CHANGELOG carefully curated to enumerate all important changes since the previous version.

    @@ -116,17 +103,17 @@

    VMA is an STB-style single-header C++ library.

    You can pull the entire GitHub repository, e.g. using Git submodules. The repository contains ancillary files like the Cmake script, Doxygen config file, sample application, test suite, and others. You can compile it as a library and link with your project.

    However, a simpler way is taking the single file "include/vk_mem_alloc.h" and including it in your project. This extensive file contains all you need: a copyright notice, declarations of the public library interface (API), its internal implementation, and even the documentation in form of Doxygen-style comments.

    -

    The "STB style" means not everything is implemented as inline functions in the header file. You need to extract the internal implementation using a special macro. This means that in every .cpp file where you need to use the library you should #include "vk_mem_alloc.h" to include its public interface, but additionally in exactly one .cpp file you should #define VMA_IMPLEMENTATION before this #include to enable its internal implementation. For more information, see Project setup.

    +

    The "STB style" means not everything is implemented as inline functions in the header file. You need to extract the internal implementation using a special macro. This means that in every .cpp file where you need to use the library you should #include "vk_mem_alloc.h" to include its public interface, but additionally in exactly one .cpp file you should #define VMA_IMPLEMENTATION before this #include to enable its internal implementation. For more information, see Project setup.

    Does the library work with C or C++?

    The internal implementation of VMA is written in C++. It is distributed in the source format, so you need a compiler supporting at least C++14 to build it.

    However, the public interface of the library is written in C - using only enums, structs, and global functions, in the same style as Vulkan, so you can use the library in the C code.

    I am not a fan of modern C++. Can I still use it?

    Very likely yes. We acknowledge that many C++ developers, especially in the games industry, do not appreciate all the latest features that the language has to offer.

      -
    • VMA doesn't throw or catch any C++ exceptions. It reports errors by returning a VkResult value instead, just like Vulkan. If you don't use exceptions in your project, your code is not exception-safe, or even if you disable exception handling in the compiler options, you can still use VMA.
    • -
    • VMA doesn't use C++ run-time type information like typeid or dynamic_cast, so if you disable RTTI in the compiler options, you can still use the library.
    • -
    • VMA uses only a limited subset of standard C and C++ library. It doesn't use STL containers like std::vector, map, or string, either in the public interface nor in the internal implementation. It implements its own containers instead.
    • -
    • If you don't use the default heap memory allocator through malloc/free or new/delete but implement your own allocator instead, you can pass it to VMA and the library will use your functions for every dynamic heap allocation made internally, as well as passing it further to Vulkan functions. For details, see Custom host memory allocator.
    • +
    • VMA doesn't throw or catch any C++ exceptions. It reports errors by returning a VkResult value instead, just like Vulkan. If you don't use exceptions in your project, your code is not exception-safe, or even if you disable exception handling in the compiler options, you can still use VMA.
    • +
    • VMA doesn't use C++ run-time type information like typeid or dynamic_cast, so if you disable RTTI in the compiler options, you can still use the library.
    • +
    • VMA uses only a limited subset of standard C and C++ library. It doesn't use STL containers like std::vector, map, or string, either in the public interface nor in the internal implementation. It implements its own containers instead.
    • +
    • If you don't use the default heap memory allocator through malloc/free or new/delete but implement your own allocator instead, you can pass it to VMA and the library will use your functions for every dynamic heap allocation made internally, as well as passing it further to Vulkan functions. For details, see Custom host memory allocator.

    Is it available for other programming languages?

    VMA is a C++ library with C interface in similar style as Vulkan. An object-oriented C++ wrapper or bindings to other programming languages are out of scope of this project, but they are welcome as external projects. Some of them are listed in README.md, "See also" section, including binding to C++, Python, Rust, and Haskell. Before using any of them, please check if they are still maintained and updated to use a recent version of VMA.

    @@ -136,8 +123,7 @@

    No! While VMA is published by AMD, it works on any GPU that supports Vulkan, whether a discrete PC graphics card, a processor integrated graphics, or a mobile SoC. It doesn't give AMD GPUs any advantage over any other GPUs.

    What Vulkan versions and extensions are supported?

    VMA is updated to support the latest versions of Vulkan. It currently supports Vulkan up to 1.4. The library also supports older versions down to the first release of Vulkan 1.0. Defining a higher minimum version support would help simplify the code, but we acknowledge that developers on some platforms like Android still use older versions, so the support is provided for all of them.

    -

    Among many extensions available for Vulkan, only a few interact with memory management. VMA can automatically take advantage of them. Some of them are: VK_EXT_memory_budget, VK_EXT_memory_priority, VK_KHR_external_memory_win32, and VK_KHR_maintenance* extensions that are later promoted to the new versions of the core Vulkan API.

    -

    To use them, it is your responsibility to validate if they are available on the current system and if so, enable them while creating the Vulkan device object. You also need to pass appropriate VmaAllocatorCreateFlagBits to inform VMA that they are enabled. Then, the library will automatically take advantage of them. For more information and the full list of supported extensions, see Enabling extensions.

    +

    Among many extensions available for Vulkan, only a few interact with memory management. VMA can automatically take advantage of them. Some of them are: VK_EXT_memory_budget, VK_EXT_memory_priority, VK_KHR_external_memory_win32, and VK_KHR_maintenance* extensions that are later promoted to the new versions of the core Vulkan API. To use them, it is your responsibility to validate if they are available on the current system and if so, enable them while creating the Vulkan device object. You also need to pass appropriate VmaAllocatorCreateFlagBits to inform VMA that they are enabled. Then, the library will automatically take advantage of them. For more information and the full list of supported extensions, see Enabling extensions.

    Does it support other graphics APIs, like Microsoft DirectX(R) 12?

    No, but we offer an equivalent library for DirectX 12: D3D12 Memory Allocator. It uses the same core allocation algorithm. It also shares many features with VMA, like the support for custom pools and virtual allocator. However, it is not identical in terms of the features supported. Its API also looks different, because while the interface of VMA is similar in style to Vulkan, the interface of D3D12MA is similar to DirectX 12.

    Is the library lightweight?

    @@ -152,14 +138,14 @@
  • Finally, you can just read the comments preceding declarations of any public functions of the library.
  • Is it a mature project?

    -

    Yes! The library is in development since June 2017, has over 1000 commits, over 400 issue tickets and pull requests (most of them resolved), and over 70 contributors. It is distributed together with Vulkan SDK. It is used by many software projects, including some large and popular ones like Qt or Blender, as well as some AAA games. According to the LunarG 2024 Ecosystem Survey, it is used by over 50% of Vulkan developers.

    +

    Yes! The library is in development since June 2017, has over 1000 commits, over 500 issue tickets and pull requests (most of them resolved), and over 80 contributors. It is distributed together with Vulkan SDK. It is used by many software projects, including some large and popular ones like Qt or Blender, as well as some AAA games. According to the LunarG 2024 Ecosystem Survey, it is used by over 50% of Vulkan developers.

    How can I contribute to the project?

    If you have an idea for improvement or a feature request, you can go to the library repository and create an Issue ticket, describing your idea. You can also implement it yourself by forking the repository, making changes to the code, and creating a Pull request.

    If you want to ask a question, you can also create a ticket the same way. Before doing this, please make sure you read the relevant part of the Vulkan specification and VMA documentation, where you may find the answers to your question.

    If you want to report a suspected bug, you can also create a ticket the same way. Before doing this, please put some effort into the investigation of whether the bug is really in the library and not in your code or in the Vulkan implementation (the GPU driver) on your platform:

    • Enable Vulkan validation layer and make sure it is free from any errors.
    • -
    • Make sure VMA_ASSERT is defined to an implementation that can report a failure and not ignore it.
    • +
    • Make sure VMA_ASSERT is defined to an implementation that can report a failure and not ignore it.
    • Try making your allocation using pure Vulkan functions rather than VMA and see if the bug persists.

    I found some compilation warnings. How can we fix them?

    @@ -169,7 +155,7 @@
    diff --git a/docs/html/files.html b/docs/html/files.html index 99ee392d..59195e77 100644 --- a/docs/html/files.html +++ b/docs/html/files.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: File List - - @@ -33,35 +31,24 @@
    - +
    -
    Here is a list of all files with brief descriptions:
    [detail level 12]
    - - + +
      include
     vk_mem_alloc.h
     
    include
     
    vk_mem_alloc.h
    diff --git a/docs/html/functions.html b/docs/html/functions.html index 99d4b1c4..641dbf75 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Class Members - - @@ -33,35 +31,24 @@ - +
    -
    Here is a list of all class members with links to the classes they belong to:
    -

    - a -

    diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index c86ca115..4e0720ad 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Class Members - Variables - - @@ -33,35 +31,24 @@ - +
    -
    Here is a list of all variables with links to the classes they belong to:
    -

    - a -

    diff --git a/docs/html/general_considerations.html b/docs/html/general_considerations.html index cd4e0001..985529a6 100644 --- a/docs/html/general_considerations.html +++ b/docs/html/general_considerations.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: General considerations - - @@ -33,33 +31,22 @@ - + -
    -
    General considerations
    +
    General considerations
    -

    +

    Thread safety

      -
    • The library has no global state, so separate VmaAllocator objects can be used independently. There should be no need to create multiple such objects though - one per VkDevice is enough.
    • +
    • The library has no global state, so separate VmaAllocator objects can be used independently. There should be no need to create multiple such objects though - one per VkDevice is enough.
    • By default, all calls to functions that take VmaAllocator as first parameter are safe to call from multiple threads simultaneously because they are synchronized internally when needed. This includes allocation and deallocation from default memory pool, as well as custom VmaPool.
    • When the allocator is created with VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT flag, calls to functions that take such VmaAllocator object must be synchronized externally.
    • Access to a VmaAllocation object must be externally synchronized. For example, you must not call vmaGetAllocationInfo() and vmaMapMemory() from different threads at the same time if you pass the same VmaAllocation object to these functions.
    • VmaVirtualBlock is not safe to be used from multiple threads simultaneously.
    -

    +

    Versioning and compatibility

    The library uses Semantic Versioning, which means version numbers follow convention: Major.Minor.Patch (e.g. 2.3.0), where:

      @@ -110,16 +97,16 @@

      <

    All changes between official releases are documented in file "CHANGELOG.md".

    Warning
    Backward compatibility is considered on the level of C++ source code, not binary linkage. Adding new members to existing structures is treated as backward compatible if initializing the new members to binary zero results in the old behavior. You should always fully initialize all library structures to zeros and not rely on their exact binary size.
    -

    +

    Validation layer warnings

    When using this library, you can meet following types of warnings issued by Vulkan validation layer. They don't necessarily indicate a bug, so you may need to just ignore them.

    • vkBindBufferMemory(): Binding memory to buffer 0xeb8e4 but vkGetBufferMemoryRequirements() has not been called on that buffer.
        -
      • It happens when VK_KHR_dedicated_allocation extension is enabled. vkGetBufferMemoryRequirements2KHR function is used instead, while validation layer seems to be unaware of it.
      • +
      • It happens when VK_KHR_dedicated_allocation extension is enabled. vkGetBufferMemoryRequirements2KHR function is used instead, while validation layer seems to be unaware of it.
    • Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used.
        -
      • It happens when you map a buffer or image, because the library maps entire VkDeviceMemory block, where different types of images and buffers may end up together, especially on GPUs with unified memory like Intel.
      • +
      • It happens when you map a buffer or image, because the library maps entire VkDeviceMemory block, where different types of images and buffers may end up together, especially on GPUs with unified memory like Intel.
    • Non-linear image 0xebc91 is aliased with linear buffer 0xeb8e4 which may indicate a bug.
        @@ -127,23 +114,23 @@

    -

    +

    Allocation algorithm

    The library uses following algorithm for allocation, in order:

    1. Try to find free range of memory in existing blocks.
    2. -
    3. If failed, try to create a new block of VkDeviceMemory, with preferred block size.
    4. +
    5. If failed, try to create a new block of VkDeviceMemory, with preferred block size.
    6. If failed, try to create such block with size / 2, size / 4, size / 8.
    7. -
    8. If failed, try to allocate separate VkDeviceMemory for this allocation, just like when you use VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
    9. +
    10. If failed, try to allocate separate VkDeviceMemory for this allocation, just like when you use VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.
    11. If failed, choose other memory type that meets the requirements specified in VmaAllocationCreateInfo and go to point 1.
    12. -
    13. If failed, return VK_ERROR_OUT_OF_DEVICE_MEMORY.
    14. +
    15. If failed, return VK_ERROR_OUT_OF_DEVICE_MEMORY.
    -

    +

    Features not supported

    Features deliberately excluded from the scope of this library:

      -
    1. Data transfer. Uploading (streaming) and downloading data of buffers and images between CPU and GPU memory and related synchronization is responsibility of the user. Defining some "texture" object that would automatically stream its data from a staging copy in CPU memory to GPU memory would rather be a feature of another, higher-level library implemented on top of VMA. VMA doesn't record any commands to a VkCommandBuffer. It just allocates memory.
    2. -
    3. Recreation of buffers and images. Although the library has functions for buffer and image creation: vmaCreateBuffer(), vmaCreateImage(), you need to recreate these objects yourself after defragmentation. That is because the big structures VkBufferCreateInfo, VkImageCreateInfo are not stored in VmaAllocation object.
    4. +
    5. Data transfer. Uploading (streaming) and downloading data of buffers and images between CPU and GPU memory and related synchronization is responsibility of the user. Defining some "texture" object that would automatically stream its data from a staging copy in CPU memory to GPU memory would rather be a feature of another, higher-level library implemented on top of VMA. VMA doesn't record any commands to a VkCommandBuffer. It just allocates memory.
    6. +
    7. Recreation of buffers and images. Although the library has functions for buffer and image creation: vmaCreateBuffer(), vmaCreateImage(), you need to recreate these objects yourself after defragmentation. That is because the big structures VkBufferCreateInfo, VkImageCreateInfo are not stored in VmaAllocation object.
    8. Handling CPU memory allocation failures. When dynamically creating small C++ objects in CPU memory (not Vulkan memory), allocation failures are not checked and handled gracefully, because that would complicate code significantly and is usually not needed in desktop PC applications anyway. Success of an allocation is just checked with an assert.
    9. Code free of any compiler warnings. Maintaining the library to compile and work correctly on so many different platforms is hard enough. Being free of any warnings, on any version of any compiler, is simply not feasible. There are many preprocessor macros that make some variables unused, function parameters unreferenced, or conditional expressions constant in some configurations. The code of this library should not be bigger or more complicated just to silence these warnings. It is recommended to disable such warnings instead.
    10. This is a C++ library with C interface. Bindings or ports to any other programming languages are welcome as external projects but are not going to be included into this repository.
    11. @@ -152,7 +139,7 @@

    diff --git a/docs/html/globals.html b/docs/html/globals.html index e5845053..06f6d128 100644 --- a/docs/html/globals.html +++ b/docs/html/globals.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: File Members - - @@ -33,35 +31,24 @@
    - +
    -
    Here is a list of all file members with links to the files they belong to:
    -

    - p -

    diff --git a/docs/html/globals_enum.html b/docs/html/globals_enum.html index 0ba7255f..48be59c7 100644 --- a/docs/html/globals_enum.html +++ b/docs/html/globals_enum.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: File Members - - @@ -33,35 +31,24 @@
    - +
    -
    diff --git a/docs/html/globals_eval.html b/docs/html/globals_eval.html index 5104b045..9e557193 100644 --- a/docs/html/globals_eval.html +++ b/docs/html/globals_eval.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: File Members - - @@ -33,35 +31,24 @@
    - +
    -
    Here is a list of all enum values with links to the files they belong to:
    -

    - v -

    diff --git a/docs/html/globals_func.html b/docs/html/globals_func.html index e2f161c9..5a8af712 100644 --- a/docs/html/globals_func.html +++ b/docs/html/globals_func.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: File Members - - @@ -33,35 +31,24 @@ - +
    -
    Here is a list of all functions with links to the files they belong to:
    -

    - v -

    diff --git a/docs/html/globals_type.html b/docs/html/globals_type.html index 23222814..084a199a 100644 --- a/docs/html/globals_type.html +++ b/docs/html/globals_type.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: File Members - - @@ -33,35 +31,24 @@ - +
    -
    Here is a list of all typedefs with links to the files they belong to:
    -

    - p -

    diff --git a/docs/html/group__group__alloc.html b/docs/html/group__group__alloc.html index df2287c8..9712e0a9 100644 --- a/docs/html/group__group__alloc.html +++ b/docs/html/group__group__alloc.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Memory allocation - - @@ -33,35 +31,24 @@ - +
    -
    Typedefs | Enumerations | Functions
    -
    Memory allocation
    +
    Memory allocation

    API elements related to the allocation, deallocation, and management of Vulkan memory, buffers, images. Most basic ones being: vmaCreateBuffer(), vmaCreateImage(). More...

    - - + - - + - - - - + + - - + - - + - - + - - + - - + - - + - - + -

    +

    Classes

    struct  VmaAllocationCreateInfo
    struct  VmaAllocationCreateInfo
     Parameters of new VmaAllocation. More...
     
    struct  VmaPoolCreateInfo
    struct  VmaPoolCreateInfo
     Describes parameter of created VmaPool. More...
     
    struct  VmaAllocationInfo
     
    struct  VmaAllocationInfo2
    struct  VmaAllocationInfo
    struct  VmaAllocationInfo2
     Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2(). More...
     
    struct  VmaDefragmentationInfo
    struct  VmaDefragmentationInfo
     Parameters for defragmentation. More...
     
    struct  VmaDefragmentationMove
    struct  VmaDefragmentationMove
     Single move of an allocation to be done for defragmentation. More...
     
    struct  VmaDefragmentationPassMoveInfo
    struct  VmaDefragmentationPassMoveInfo
     Parameters for incremental defragmentation steps. More...
     
    struct  VmaDefragmentationStats
    struct  VmaDefragmentationStats
     Statistics returned for defragmentation process in function vmaEndDefragmentation(). More...
     
    struct  VmaPool
    struct  VmaPool
     Represents custom memory pool. More...
     
    struct  VmaAllocation
    struct  VmaAllocation
     Represents single memory allocation. More...
     
    struct  VmaDefragmentationContext
    struct  VmaDefragmentationContext
     An opaque object that represents started defragmentation process. More...
     
    - - - - - - - - - - - - - - - - - -

    +

    Typedefs

    typedef enum VmaMemoryUsage VmaMemoryUsage
     Intended usage of the allocated memory.
     
    typedef enum VmaAllocationCreateFlagBits VmaAllocationCreateFlagBits
     Flags to be passed as VmaAllocationCreateInfo::flags.
     
    typedef VkFlags VmaAllocationCreateFlags
     See VmaAllocationCreateFlagBits.
     
    typedef enum VmaPoolCreateFlagBits VmaPoolCreateFlagBits
     Flags to be passed as VmaPoolCreateInfo::flags.
     
    typedef VkFlags VmaPoolCreateFlags
     Flags to be passed as VmaPoolCreateInfo::flags. See VmaPoolCreateFlagBits.
     
    typedef enum VmaDefragmentationFlagBits VmaDefragmentationFlagBits
     Flags to be passed as VmaDefragmentationInfo::flags.
     
    typedef VkFlags VmaDefragmentationFlags
     See VmaDefragmentationFlagBits.
     
    typedef enum VmaDefragmentationMoveOperation VmaDefragmentationMoveOperation
     Operation performed on single defragmentation move. See structure VmaDefragmentationMove.
     
    typedef struct VmaAllocationCreateInfo VmaAllocationCreateInfo
     Parameters of new VmaAllocation.
     
    typedef struct VmaPoolCreateInfo VmaPoolCreateInfo
     Describes parameter of created VmaPool.
     
    typedef struct VmaAllocationInfo VmaAllocationInfo
     
    typedef struct VmaAllocationInfo2 VmaAllocationInfo2
     Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2().
     
    typedef VkBool32(VKAPI_PTR * PFN_vmaCheckDefragmentationBreakFunction) (void *pUserData)
     
    typedef struct VmaDefragmentationInfo VmaDefragmentationInfo
     Parameters for defragmentation.
     
    typedef struct VmaDefragmentationMove VmaDefragmentationMove
     Single move of an allocation to be done for defragmentation.
     
    typedef struct VmaDefragmentationPassMoveInfo VmaDefragmentationPassMoveInfo
     Parameters for incremental defragmentation steps.
     
    typedef struct VmaDefragmentationStats VmaDefragmentationStats
     Statistics returned for defragmentation process in function vmaEndDefragmentation().
     
    - - - - - -

    +

    Enumerations

    enum  VmaMemoryUsage {
      VMA_MEMORY_USAGE_UNKNOWN = 0 @@ -202,7 +161,6 @@
    }
     Intended usage of the allocated memory. More...
     
    enum  VmaAllocationCreateFlagBits {
      VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001 , VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 0x00000002 @@ -229,14 +187,12 @@
    }
     Flags to be passed as VmaAllocationCreateInfo::flags. More...
     
    enum  VmaPoolCreateFlagBits { VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 0x00000002 , VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 0x00000004 , VMA_POOL_CREATE_ALGORITHM_MASK , VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF }
     Flags to be passed as VmaPoolCreateInfo::flags. More...
     
    enum  VmaDefragmentationFlagBits {
      VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT = 0x1 , VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT = 0x2 @@ -248,158 +204,112 @@
    }
     Flags to be passed as VmaDefragmentationInfo::flags. More...
     
    enum  VmaDefragmentationMoveOperation { VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY = 0 , VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE = 1 , VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY = 2 }
     Operation performed on single defragmentation move. See structure VmaDefragmentationMove. More...
     
    - - - + - - + - - + - - - - - - - - - + - - + - - - - - - - - + + - - - - - - - - - - - - - - - - - - - + - - - + - - + - - - - -

    +

    Functions

    VkResult vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
     Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.
     
     Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.
    VkResult vmaFindMemoryTypeIndexForBufferInfo (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
     Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
     
     Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
    VkResult vmaFindMemoryTypeIndexForImageInfo (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
     Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
     
     Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
    VkResult vmaCreatePool (VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
     Allocates Vulkan device memory and creates VmaPool object.
     
    void vmaDestroyPool (VmaAllocator allocator, VmaPool pool)
     Destroys VmaPool object and frees Vulkan device memory.
     
    VkResult vmaCheckPoolCorruption (VmaAllocator allocator, VmaPool pool)
     Checks magic number in margins around all allocations in given memory pool in search for corruptions.
     
    void vmaGetPoolName (VmaAllocator allocator, VmaPool pool, const char **ppName)
     Retrieves name of a custom pool.
     
    void vmaSetPoolName (VmaAllocator allocator, VmaPool pool, const char *pName)
     Sets name of a custom pool.
     
    VkResult vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     General purpose memory allocation.
     
    VkResult vmaAllocateMemoryPages (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, size_t allocationCount, VmaAllocation *pAllocations, VmaAllocationInfo *pAllocationInfo)
     General purpose memory allocation for multiple allocation objects at once.
     
    VkResult vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Allocates memory suitable for given VkBuffer.
     
     Allocates memory suitable for given VkBuffer.
    VkResult vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Allocates memory suitable for given VkImage.
     
     Allocates memory suitable for given VkImage.
    void vmaFreeMemory (VmaAllocator allocator, VmaAllocation allocation)
     Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().
     
    void vmaFreeMemoryPages (VmaAllocator allocator, size_t allocationCount, const VmaAllocation *pAllocations)
     Frees memory and destroys multiple allocations.
     
    void vmaGetAllocationInfo (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
     Returns current information about specified allocation.
     
    void vmaGetAllocationInfo2 (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo2 *pAllocationInfo)
     Returns extended information about specified allocation.
     
    void vmaSetAllocationUserData (VmaAllocator allocator, VmaAllocation allocation, void *pUserData)
     Sets pUserData in given allocation to new value.
     
    void vmaSetAllocationName (VmaAllocator allocator, VmaAllocation allocation, const char *pName)
     Sets pName in given allocation to new value.
     
    void vmaGetAllocationMemoryProperties (VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags)
     Given an allocation, returns Property Flags of its memory type.
     
    VkResult vmaGetMemoryWin32Handle (VmaAllocator allocator, VmaAllocation allocation, HANDLE hTargetProcess, HANDLE *pHandle)
     Given an allocation, returns Win32 handle that may be imported by other processes or APIs.
     
    VkResult vmaGetMemoryWin32Handle2 (VmaAllocator allocator, VmaAllocation allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE *pHandle)
     Given an allocation, returns Win32 handle that may be imported by other processes or APIs.
    VkResult vmaMapMemory (VmaAllocator allocator, VmaAllocation allocation, void **ppData)
     Maps memory represented by given allocation and returns pointer to it.
     
    void vmaUnmapMemory (VmaAllocator allocator, VmaAllocation allocation)
     Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().
     
    VkResult vmaFlushAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
     Flushes memory of given allocation.
     
    VkResult vmaInvalidateAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
     Invalidates memory of given allocation.
     
    VkResult vmaFlushAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes)
     Flushes memory of given set of allocations.
     
    VkResult vmaInvalidateAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes)
     Invalidates memory of given set of allocations.
     
    VkResult vmaCopyMemoryToAllocation (VmaAllocator allocator, const void *pSrcHostPointer, VmaAllocation dstAllocation, VkDeviceSize dstAllocationLocalOffset, VkDeviceSize size)
     Maps the allocation temporarily if needed, copies data from specified host pointer to it, and flushes the memory from the host caches if needed.
     
    VkResult vmaCopyAllocationToMemory (VmaAllocator allocator, VmaAllocation srcAllocation, VkDeviceSize srcAllocationLocalOffset, void *pDstHostPointer, VkDeviceSize size)
     Invalidates memory in the host caches if needed, maps the allocation temporarily if needed, and copies data from it to a specified host pointer.
     
    VkResult vmaCheckCorruption (VmaAllocator allocator, uint32_t memoryTypeBits)
     Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.
     
    VkResult vmaBeginDefragmentation (VmaAllocator allocator, const VmaDefragmentationInfo *pInfo, VmaDefragmentationContext *pContext)
     Begins defragmentation process.
     
    void vmaEndDefragmentation (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationStats *pStats)
     Ends defragmentation process.
     
    VkResult vmaBeginDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo)
     Starts single defragmentation pass.
     
    VkResult vmaEndDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo)
     Ends single defragmentation pass.
     
    VkResult vmaBindBufferMemory (VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer)
     Binds buffer to allocation.
     
    VkResult vmaBindBufferMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkBuffer buffer, const void *(VkBindBufferMemoryInfoKHR) pNext)
     Binds buffer to allocation with additional parameters.
     
    VkResult vmaBindImageMemory (VmaAllocator allocator, VmaAllocation allocation, VkImage image)
     Binds image to allocation.
     
    VkResult vmaBindImageMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkImage image, const void *(VkBindImageMemoryInfoKHR) pNext)
     Binds image to allocation with additional parameters.
     
    VkResult vmaCreateBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Creates a new VkBuffer, allocates and binds memory for it.
     
     Creates a new VkBuffer, allocates and binds memory for it.
    VkResult vmaCreateBufferWithAlignment (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkDeviceSize minAlignment, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Creates a buffer with additional minimum alignment.
     
    VkResult vmaCreateAliasingBuffer (VmaAllocator allocator, VmaAllocation allocation, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer)
     Creates a new VkBuffer, binds already created memory for it.
     
     Creates a new VkBuffer, binds already created memory for it.
    VkResult vmaCreateAliasingBuffer2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer)
     Creates a new VkBuffer, binds already created memory for it.
     
     Creates a new VkBuffer, binds already created memory for it.
    void vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
     Destroys Vulkan buffer and frees allocated memory.
     
    VkResult vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Function similar to vmaCreateBuffer().
     
    VkResult vmaCreateAliasingImage (VmaAllocator allocator, VmaAllocation allocation, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage)
     Function similar to vmaCreateAliasingBuffer() but for images.
     
    VkResult vmaCreateAliasingImage2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage)
     Function similar to vmaCreateAliasingBuffer2() but for images.
     
    void vmaDestroyImage (VmaAllocator allocator, VkImage image, VmaAllocation allocation)
     Destroys Vulkan image and frees allocated memory.
     
    -

    Detailed Description

    +

    Detailed Description

    API elements related to the allocation, deallocation, and management of Vulkan memory, buffers, images. Most basic ones being: vmaCreateBuffer(), vmaCreateImage().

    -

    Typedef Documentation

    +

    Typedef Documentation

    ◆ PFN_vmaCheckDefragmentationBreakFunction

    @@ -675,7 +585,7 @@

    Enumeration Type Documentation

    +

    Enumeration Type Documentation

    ◆ VmaAllocationCreateFlagBits

    @@ -692,47 +602,47 @@

    EnumeratorVMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT 

    Set this flag if the allocation should have its own memory block.

    Use it for special, big resources, like fullscreen images used as attachments.

    -

    If you use this flag while creating a buffer or an image, VkMemoryDedicatedAllocateInfo structure is applied if possible.

    +

    If you use this flag while creating a buffer or an image, VkMemoryDedicatedAllocateInfo structure is applied if possible.

    -VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT 

    Set this flag to only try to allocate from existing VkDeviceMemory blocks and never create new such block.

    -

    If new allocation cannot be placed in any of the existing blocks, allocation fails with VK_ERROR_OUT_OF_DEVICE_MEMORY error.

    +VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT 

    Set this flag to only try to allocate from existing VkDeviceMemory blocks and never create new such block.

    +

    If new allocation cannot be placed in any of the existing blocks, allocation fails with VK_ERROR_OUT_OF_DEVICE_MEMORY error.

    You should not use VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT and VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT at the same time. It makes no sense.

    VMA_ALLOCATION_CREATE_MAPPED_BIT 

    Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.

    Pointer to mapped memory will be returned through VmaAllocationInfo::pMappedData.

    -

    It is valid to use this flag for allocation made from memory type that is not HOST_VISIBLE. This flag is then ignored and memory is not mapped. This is useful if you need an allocation that is efficient to use on GPU (DEVICE_LOCAL) and still want to map it directly if possible on platforms that support it (e.g. Intel GPU).

    +

    It is valid to use this flag for allocation made from memory type that is not HOST_VISIBLE. This flag is then ignored and memory is not mapped. This is useful if you need an allocation that is efficient to use on GPU (DEVICE_LOCAL) and still want to map it directly if possible on platforms that support it (e.g. Intel GPU).

    VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT 
    Deprecated
    Preserved for backward compatibility. Consider using vmaSetAllocationName() instead.
    -

    Set this flag to treat VmaAllocationCreateInfo::pUserData as pointer to a null-terminated string. Instead of copying pointer value, a local copy of the string is made and stored in allocation's pName. The string is automatically freed together with the allocation. It is also used in vmaBuildStatsString().

    +

    Set this flag to treat VmaAllocationCreateInfo::pUserData as pointer to a null-terminated string. Instead of copying pointer value, a local copy of the string is made and stored in allocation's pName. The string is automatically freed together with the allocation. It is also used in vmaBuildStatsString().

    VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT 

    Allocation will be created from upper stack in a double stack pool.

    This flag is only allowed for custom pools created with VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT flag.

    VMA_ALLOCATION_CREATE_DONT_BIND_BIT 

    Create both buffer/image and allocation, but don't bind them together. It is useful when you want to bind yourself to do some more advanced binding, e.g. using some extensions. The flag is meaningful only with functions that bind by default: vmaCreateBuffer(), vmaCreateImage(). Otherwise it is ignored.

    -

    If you want to make sure the new buffer/image is not tied to the new memory allocation through VkMemoryDedicatedAllocateInfoKHR structure in case the allocation ends up in its own memory block, use also flag VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT.

    +

    If you want to make sure the new buffer/image is not tied to the new memory allocation through VkMemoryDedicatedAllocateInfoKHR structure in case the allocation ends up in its own memory block, use also flag VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT.

    -VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT 

    Create allocation only if additional device memory required for it, if any, won't exceed memory budget. Otherwise return VK_ERROR_OUT_OF_DEVICE_MEMORY.

    +VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT 

    Create allocation only if additional device memory required for it, if any, won't exceed memory budget. Otherwise return VK_ERROR_OUT_OF_DEVICE_MEMORY.

    VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT 

    Set this flag if the allocated memory will have aliasing resources.

    -

    Usage of this flag prevents supplying VkMemoryDedicatedAllocateInfoKHR when VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is specified. Otherwise created dedicated memory will not be suitable for aliasing resources, resulting in Vulkan Validation Layer errors.

    +

    Usage of this flag prevents supplying VkMemoryDedicatedAllocateInfoKHR when VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is specified. Otherwise created dedicated memory will not be suitable for aliasing resources, resulting in Vulkan Validation Layer errors.

    VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT 

    Requests possibility to map the allocation (using vmaMapMemory() or VMA_ALLOCATION_CREATE_MAPPED_BIT).

      -
    • If you use VMA_MEMORY_USAGE_AUTO or other VMA_MEMORY_USAGE_AUTO* value, you must use this flag to be able to map the allocation. Otherwise, mapping is incorrect.
    • -
    • If you use other value of VmaMemoryUsage, this flag is ignored and mapping is always possible in memory types that are HOST_VISIBLE. This includes allocations created in Custom memory pools.
    • +
    • If you use VMA_MEMORY_USAGE_AUTO or other VMA_MEMORY_USAGE_AUTO* value, you must use this flag to be able to map the allocation. Otherwise, mapping is incorrect.
    • +
    • If you use other value of VmaMemoryUsage, this flag is ignored and mapping is always possible in memory types that are HOST_VISIBLE. This includes allocations created in Custom memory pools.
    -

    Declares that mapped memory will only be written sequentially, e.g. using memcpy() or a loop writing number-by-number, never read or accessed randomly, so a memory type can be selected that is uncached and write-combined.

    -
    Warning
    Violating this declaration may work correctly, but will likely be very slow. Watch out for implicit reads introduced by doing e.g. pMappedData[i] += x; Better prepare your data in a local variable and memcpy() it to the mapped pointer all at once.
    +

    Declares that mapped memory will only be written sequentially, e.g. using memcpy() or a loop writing number-by-number, never read or accessed randomly, so a memory type can be selected that is uncached and write-combined.

    +
    Warning
    Violating this declaration may work correctly, but will likely be very slow. Watch out for implicit reads introduced by doing e.g. pMappedData[i] += x; Better prepare your data in a local variable and memcpy() it to the mapped pointer all at once.
    VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT 

    Requests possibility to map the allocation (using vmaMapMemory() or VMA_ALLOCATION_CREATE_MAPPED_BIT).

      -
    • If you use VMA_MEMORY_USAGE_AUTO or other VMA_MEMORY_USAGE_AUTO* value, you must use this flag to be able to map the allocation. Otherwise, mapping is incorrect.
    • -
    • If you use other value of VmaMemoryUsage, this flag is ignored and mapping is always possible in memory types that are HOST_VISIBLE. This includes allocations created in Custom memory pools.
    • +
    • If you use VMA_MEMORY_USAGE_AUTO or other VMA_MEMORY_USAGE_AUTO* value, you must use this flag to be able to map the allocation. Otherwise, mapping is incorrect.
    • +
    • If you use other value of VmaMemoryUsage, this flag is ignored and mapping is always possible in memory types that are HOST_VISIBLE. This includes allocations created in Custom memory pools.
    -

    Declares that mapped memory can be read, written, and accessed in random order, so a HOST_CACHED memory type is preferred.

    +

    Declares that mapped memory can be read, written, and accessed in random order, so a HOST_CACHED memory type is preferred.

    -VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT 

    Together with VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT, it says that despite request for host access, a not-HOST_VISIBLE memory type can be selected if it may improve performance.

    -

    By using this flag, you declare that you will check if the allocation ended up in a HOST_VISIBLE memory type (e.g. using vmaGetAllocationMemoryProperties()) and if not, you will create some "staging" buffer and issue an explicit transfer to write/read your data. To prepare for this possibility, don't forget to add appropriate flags like VK_BUFFER_USAGE_TRANSFER_DST_BIT, VK_BUFFER_USAGE_TRANSFER_SRC_BIT to the parameters of created buffer or image.

    +VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT 

    Together with VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT, it says that despite request for host access, a not-HOST_VISIBLE memory type can be selected if it may improve performance.

    +

    By using this flag, you declare that you will check if the allocation ended up in a HOST_VISIBLE memory type (e.g. using vmaGetAllocationMemoryProperties()) and if not, you will create some "staging" buffer and issue an explicit transfer to write/read your data. To prepare for this possibility, don't forget to add appropriate flags like VK_BUFFER_USAGE_TRANSFER_DST_BIT, VK_BUFFER_USAGE_TRANSFER_SRC_BIT to the parameters of created buffer or image.

    VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT 

    Allocation strategy that chooses smallest possible free range for the allocation to minimize memory usage and fragmentation, possibly at the expense of allocation time.

    @@ -744,7 +654,7 @@

    VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT 

    Alias to VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT.

    -VMA_ALLOCATION_CREATE_STRATEGY_MASK 

    A bit mask to extract only STRATEGY bits from entire set of flags.

    +VMA_ALLOCATION_CREATE_STRATEGY_MASK 

    A bit mask to extract only STRATEGY bits from entire set of flags.

    VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM  @@ -770,7 +680,7 @@

    VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT  VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT 

    Use the most roboust algorithm at the cost of time to compute and number of copies to make. Only available when bufferImageGranularity is greater than 1, since it aims to reduce alignment issues between different types of resources. Otherwise falls back to same behavior as VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT.

    -VMA_DEFRAGMENTATION_FLAG_ALGORITHM_MASK 

    A bit mask to extract only ALGORITHM bits from entire set of flags.

    +VMA_DEFRAGMENTATION_FLAG_ALGORITHM_MASK 

    A bit mask to extract only ALGORITHM bits from entire set of flags.

    VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM  @@ -791,11 +701,11 @@

    VmaDefragmentationMove.

    - - -
    Enumerator
    VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY 

    Buffer/image has been recreated at dstTmpAllocation, data has been copied, old buffer/image has been destroyed. srcAllocation should be changed to point to the new place. This is the default value set by vmaBeginDefragmentationPass().

    +
    Enumerator
    VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY 

    Buffer/image has been recreated at dstTmpAllocation, data has been copied, old buffer/image has been destroyed. srcAllocation should be changed to point to the new place. This is the default value set by vmaBeginDefragmentationPass().

    VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE 

    Set this value if you cannot move the allocation. New place reserved at dstTmpAllocation will be freed. srcAllocation will remain unchanged.

    +
    VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE 

    Set this value if you cannot move the allocation. New place reserved at dstTmpAllocation will be freed. srcAllocation will remain unchanged.

    VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY 

    Set this value if you decide to abandon the allocation and you destroyed the buffer/image. New place reserved at dstTmpAllocation will be freed, along with srcAllocation, which will be destroyed.

    +
    VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY 

    Set this value if you decide to abandon the allocation and you destroyed the buffer/image. New place reserved at dstTmpAllocation will be freed, along with srcAllocation, which will be destroyed.

    @@ -817,31 +727,31 @@

    EnumeratorVMA_MEMORY_USAGE_UNKNOWN 

    No intended memory usage specified. Use other members of VmaAllocationCreateInfo to specify your requirements.

    -VMA_MEMORY_USAGE_GPU_ONLY 
    Deprecated
    Obsolete, preserved for backward compatibility. Prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    +VMA_MEMORY_USAGE_GPU_ONLY 
    Deprecated
    Obsolete, preserved for backward compatibility. Prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    -VMA_MEMORY_USAGE_CPU_ONLY 
    Deprecated
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_COHERENT_BIT.
    +VMA_MEMORY_USAGE_CPU_ONLY 
    Deprecated
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_COHERENT_BIT.
    -VMA_MEMORY_USAGE_CPU_TO_GPU 
    Deprecated
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    +VMA_MEMORY_USAGE_CPU_TO_GPU 
    Deprecated
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    -VMA_MEMORY_USAGE_GPU_TO_CPU 
    Deprecated
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_HOST_CACHED_BIT.
    +VMA_MEMORY_USAGE_GPU_TO_CPU 
    Deprecated
    Obsolete, preserved for backward compatibility. Guarantees VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, prefers VK_MEMORY_PROPERTY_HOST_CACHED_BIT.
    -VMA_MEMORY_USAGE_CPU_COPY 
    Deprecated
    Obsolete, preserved for backward compatibility. Prefers not VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    +VMA_MEMORY_USAGE_CPU_COPY 
    Deprecated
    Obsolete, preserved for backward compatibility. Prefers not VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.
    -VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED 

    Lazily allocated GPU memory having VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT. Exists mostly on mobile platforms. Using it on desktop PC or other GPUs with no such memory type present will fail the allocation.

    -

    Usage: Memory for transient attachment images (color attachments, depth attachments etc.), created with VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT.

    +VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED 

    Lazily allocated GPU memory having VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT. Exists mostly on mobile platforms. Using it on desktop PC or other GPUs with no such memory type present will fail the allocation.

    +

    Usage: Memory for transient attachment images (color attachments, depth attachments etc.), created with VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT.

    Allocations with this usage are always created as dedicated - it implies VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.

    VMA_MEMORY_USAGE_AUTO 

    Selects best memory type automatically. This flag is recommended for most common use cases.

    When using this flag, if you want to map the allocation (using vmaMapMemory() or VMA_ALLOCATION_CREATE_MAPPED_BIT), you must pass one of the flags: VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT in VmaAllocationCreateInfo::flags.

    -

    It can be used only with functions that let the library know VkBufferCreateInfo or VkImageCreateInfo, e.g. vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo() and not with generic memory allocation functions.

    +

    It can be used only with functions that let the library know VkBufferCreateInfo or VkImageCreateInfo, e.g. vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo() and not with generic memory allocation functions.

    VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE 

    Selects best memory type automatically with preference for GPU (device) memory.

    When using this flag, if you want to map the allocation (using vmaMapMemory() or VMA_ALLOCATION_CREATE_MAPPED_BIT), you must pass one of the flags: VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT in VmaAllocationCreateInfo::flags.

    -

    It can be used only with functions that let the library know VkBufferCreateInfo or VkImageCreateInfo, e.g. vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo() and not with generic memory allocation functions.

    +

    It can be used only with functions that let the library know VkBufferCreateInfo or VkImageCreateInfo, e.g. vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo() and not with generic memory allocation functions.

    VMA_MEMORY_USAGE_AUTO_PREFER_HOST 

    Selects best memory type automatically with preference for CPU (host) memory.

    When using this flag, if you want to map the allocation (using vmaMapMemory() or VMA_ALLOCATION_CREATE_MAPPED_BIT), you must pass one of the flags: VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT in VmaAllocationCreateInfo::flags.

    -

    It can be used only with functions that let the library know VkBufferCreateInfo or VkImageCreateInfo, e.g. vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo() and not with generic memory allocation functions.

    +

    It can be used only with functions that let the library know VkBufferCreateInfo or VkImageCreateInfo, e.g. vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo() and not with generic memory allocation functions.

    VMA_MEMORY_USAGE_MAX_ENUM  @@ -871,14 +781,14 @@

    Linear allocation algorithm.

    -VMA_POOL_CREATE_ALGORITHM_MASK 

    Bit mask to extract only ALGORITHM bits from entire set of flags.

    +VMA_POOL_CREATE_ALGORITHM_MASK 

    Bit mask to extract only ALGORITHM bits from entire set of flags.

    VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM 

    -

    Function Documentation

    +

    Function Documentation

    ◆ vmaAllocateMemory()

    @@ -963,7 +873,7 @@

    -

    Allocates memory suitable for given VkBuffer.

    +

    Allocates memory suitable for given VkBuffer.

    Parameters
    @@ -1014,7 +924,7 @@

    -

    Allocates memory suitable for given VkImage.

    +

    Allocates memory suitable for given VkImage.

    Parameters

    allocator
    @@ -1083,8 +993,8 @@

    vmaFreeMemory() or vmaFreeMemoryPages().

    -

    Word "pages" is just a suggestion to use this function to allocate pieces of memory needed for sparse binding. It is just a general purpose allocation function able to make multiple allocations at once. It may be internally optimized to be more efficient than calling vmaAllocateMemory() allocationCount times.

    -

    All allocations are made using same parameters. All of them are created out of the same memory pool and type. If any allocation fails, all allocations already made within this function call are also freed, so that when returned result is not VK_SUCCESS, pAllocation array is always entirely filled with VK_NULL_HANDLE.

    +

    Word "pages" is just a suggestion to use this function to allocate pieces of memory needed for sparse binding. It is just a general purpose allocation function able to make multiple allocations at once. It may be internally optimized to be more efficient than calling vmaAllocateMemory() allocationCount times.

    +

    All allocations are made using same parameters. All of them are created out of the same memory pool and type. If any allocation fails, all allocations already made within this function call are also freed, so that when returned result is not VK_SUCCESS, pAllocation array is always entirely filled with VK_NULL_HANDLE.

    @@ -1122,8 +1032,8 @@

    Returns
      -
    • VK_SUCCESS if defragmentation can begin.
    • -
    • VK_ERROR_FEATURE_NOT_PRESENT if defragmentation is not supported.
    • +
    • VK_SUCCESS if defragmentation can begin.
    • +
    • VK_ERROR_FEATURE_NOT_PRESENT if defragmentation is not supported.

    For more information about defragmentation, see documentation chapter: Defragmentation.

    @@ -1164,8 +1074,8 @@

    Returns
    @@ -1196,7 +1106,7 @@

    Binds buffer to allocation.

    -

    Binds specified buffer to region of memory represented by specified allocation. Gets VkDeviceMemory handle and offset from the allocation. If you want to create a buffer, allocate memory for it and bind them together separately, you should use this function for binding instead of standard vkBindBufferMemory(), because it ensures proper synchronization so that when a VkDeviceMemory object is used by multiple allocations, calls to vkBind*Memory() or vkMapMemory() won't happen from multiple threads simultaneously (which is illegal in Vulkan).

    +

    Binds specified buffer to region of memory represented by specified allocation. Gets VkDeviceMemory handle and offset from the allocation. If you want to create a buffer, allocate memory for it and bind them together separately, you should use this function for binding instead of standard vkBindBufferMemory(), because it ensures proper synchronization so that when a VkDeviceMemory object is used by multiple allocations, calls to vkBind*Memory() or vkMapMemory() won't happen from multiple threads simultaneously (which is illegal in Vulkan).

    It is recommended to use function vmaCreateBuffer() instead of this one.

    @@ -1240,14 +1150,14 @@

    - + - +
    allocator
    allocator
    allocation
    allocationLocalOffsetAdditional offset to be added while binding, relative to the beginning of the allocation. Normally it should be 0.
    allocationLocalOffsetAdditional offset to be added while binding, relative to the beginning of the allocation. Normally it should be 0.
    buffer
    pNextA chain of structures to be attached to VkBindBufferMemoryInfoKHR structure used internally. Normally it should be null.
    pNextA chain of structures to be attached to VkBindBufferMemoryInfoKHR structure used internally. Normally it should be null.

    This function is similar to vmaBindBufferMemory(), but it provides additional parameters.

    -

    If pNext is not null, VmaAllocator object must have been created with VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag or with VmaAllocatorCreateInfo::vulkanApiVersion >= VK_API_VERSION_1_1. Otherwise the call fails.

    +

    If pNext is not null, VmaAllocator object must have been created with VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag or with VmaAllocatorCreateInfo::vulkanApiVersion >= VK_API_VERSION_1_1. Otherwise the call fails.

    @@ -1276,7 +1186,7 @@

    Binds image to allocation.

    -

    Binds specified image to region of memory represented by specified allocation. Gets VkDeviceMemory handle and offset from the allocation. If you want to create an image, allocate memory for it and bind them together separately, you should use this function for binding instead of standard vkBindImageMemory(), because it ensures proper synchronization so that when a VkDeviceMemory object is used by multiple allocations, calls to vkBind*Memory() or vkMapMemory() won't happen from multiple threads simultaneously (which is illegal in Vulkan).

    +

    Binds specified image to region of memory represented by specified allocation. Gets VkDeviceMemory handle and offset from the allocation. If you want to create an image, allocate memory for it and bind them together separately, you should use this function for binding instead of standard vkBindImageMemory(), because it ensures proper synchronization so that when a VkDeviceMemory object is used by multiple allocations, calls to vkBind*Memory() or vkMapMemory() won't happen from multiple threads simultaneously (which is illegal in Vulkan).

    It is recommended to use function vmaCreateImage() instead of this one.

    @@ -1320,14 +1230,14 @@

    allocator allocation - allocationLocalOffsetAdditional offset to be added while binding, relative to the beginning of the allocation. Normally it should be 0. + allocationLocalOffsetAdditional offset to be added while binding, relative to the beginning of the allocation. Normally it should be 0. image - pNextA chain of structures to be attached to VkBindImageMemoryInfoKHR structure used internally. Normally it should be null. + pNextA chain of structures to be attached to VkBindImageMemoryInfoKHR structure used internally. Normally it should be null.

    This function is similar to vmaBindImageMemory(), but it provides additional parameters.

    -

    If pNext is not null, VmaAllocator object must have been created with VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag or with VmaAllocatorCreateInfo::vulkanApiVersion >= VK_API_VERSION_1_1. Otherwise the call fails.

    +

    If pNext is not null, VmaAllocator object must have been created with VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT flag or with VmaAllocatorCreateInfo::vulkanApiVersion >= VK_API_VERSION_1_1. Otherwise the call fails.

    @@ -1358,12 +1268,12 @@

    Corruption detection.

    +

    Corruption detection is enabled only when VMA_DEBUG_DETECT_CORRUPTION macro is defined to nonzero, VMA_DEBUG_MARGIN is defined to nonzero and only for memory types that are HOST_VISIBLE and HOST_COHERENT. For more information, see Corruption detection.

    Possible return values:

      -
    • VK_ERROR_FEATURE_NOT_PRESENT - corruption detection is not enabled for any of specified memory types.
    • -
    • VK_SUCCESS - corruption detection has been performed and succeeded.
    • -
    • VK_ERROR_UNKNOWN - corruption detection has been performed and found memory corruptions around one of the allocations. VMA_ASSERT is also fired in that case.
    • +
    • VK_ERROR_FEATURE_NOT_PRESENT - corruption detection is not enabled for any of specified memory types.
    • +
    • VK_SUCCESS - corruption detection has been performed and succeeded.
    • +
    • VK_ERROR_UNKNOWN - corruption detection has been performed and found memory corruptions around one of the allocations. VMA_ASSERT is also fired in that case.
    • Other value: Error returned by Vulkan, e.g. memory mapping failure.
    @@ -1389,12 +1299,12 @@

    Checks magic number in margins around all allocations in given memory pool in search for corruptions.

    -

    Corruption detection is enabled only when VMA_DEBUG_DETECT_CORRUPTION macro is defined to nonzero, VMA_DEBUG_MARGIN is defined to nonzero and the pool is created in memory type that is HOST_VISIBLE and HOST_COHERENT. For more information, see Corruption detection.

    +

    Corruption detection is enabled only when VMA_DEBUG_DETECT_CORRUPTION macro is defined to nonzero, VMA_DEBUG_MARGIN is defined to nonzero and the pool is created in memory type that is HOST_VISIBLE and HOST_COHERENT. For more information, see Corruption detection.

    Possible return values:

      -
    • VK_ERROR_FEATURE_NOT_PRESENT - corruption detection is not enabled for specified pool.
    • -
    • VK_SUCCESS - corruption detection has been performed and succeeded.
    • -
    • VK_ERROR_UNKNOWN - corruption detection has been performed and found memory corruptions around one of the allocations. VMA_ASSERT is also fired in that case.
    • +
    • VK_ERROR_FEATURE_NOT_PRESENT - corruption detection is not enabled for specified pool.
    • +
    • VK_SUCCESS - corruption detection has been performed and succeeded.
    • +
    • VK_ERROR_UNKNOWN - corruption detection has been performed and found memory corruptions around one of the allocations. VMA_ASSERT is also fired in that case.
    • Other value: Error returned by Vulkan, e.g. memory mapping failure.
    @@ -1439,15 +1349,15 @@

    allocator srcAllocationHandle to the allocation that becomes source of the copy. - srcAllocationLocalOffsetOffset within srcAllocation where to read copied data, in bytes. + srcAllocationLocalOffsetOffset within srcAllocation where to read copied data, in bytes. pDstHostPointerPointer to the host memory that become destination of the copy. sizeNumber of bytes to copy. -

    This is a convenience function that allows to copy data from an allocation to a host pointer easily. Same behavior can be achieved by calling vmaInvalidateAllocation(), vmaMapMemory(), memcpy(), vmaUnmapMemory().

    -

    This function should be called only for allocations created in a memory type that has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_CACHED_BIT flag. It can be ensured e.g. by using VMA_MEMORY_USAGE_AUTO and VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. Otherwise, the function may fail and generate a Validation Layers error. It may also work very slowly when reading from an uncached memory.

    -

    srcAllocationLocalOffset is relative to the contents of given srcAllocation. If you mean whole allocation, you should pass 0. Do not pass allocation's offset within device memory block as this parameter!

    +

    This is a convenience function that allows to copy data from an allocation to a host pointer easily. Same behavior can be achieved by calling vmaInvalidateAllocation(), vmaMapMemory(), memcpy(), vmaUnmapMemory().

    +

    This function should be called only for allocations created in a memory type that has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_CACHED_BIT flag. It can be ensured e.g. by using VMA_MEMORY_USAGE_AUTO and VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. Otherwise, the function may fail and generate a Validation Layers error. It may also work very slowly when reading from an uncached memory.

    +

    srcAllocationLocalOffset is relative to the contents of given srcAllocation. If you mean whole allocation, you should pass 0. Do not pass allocation's offset within device memory block as this parameter!

    @@ -1491,14 +1401,14 @@

    allocator pSrcHostPointerPointer to the host data that become source of the copy. dstAllocationHandle to the allocation that becomes destination of the copy. - dstAllocationLocalOffsetOffset within dstAllocation where to write copied data, in bytes. + dstAllocationLocalOffsetOffset within dstAllocation where to write copied data, in bytes. sizeNumber of bytes to copy. -

    This is a convenience function that allows to copy data from a host pointer to an allocation easily. Same behavior can be achieved by calling vmaMapMemory(), memcpy(), vmaUnmapMemory(), vmaFlushAllocation().

    -

    This function can be called only for allocations created in a memory type that has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT flag. It can be ensured e.g. by using VMA_MEMORY_USAGE_AUTO and VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. Otherwise, the function will fail and generate a Validation Layers error.

    -

    dstAllocationLocalOffset is relative to the contents of given dstAllocation. If you mean whole allocation, you should pass 0. Do not pass allocation's offset within device memory block this parameter!

    +

    This is a convenience function that allows to copy data from a host pointer to an allocation easily. Same behavior can be achieved by calling vmaMapMemory(), memcpy(), vmaUnmapMemory(), vmaFlushAllocation().

    +

    This function can be called only for allocations created in a memory type that has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT flag. It can be ensured e.g. by using VMA_MEMORY_USAGE_AUTO and VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. Otherwise, the function will fail and generate a Validation Layers error.

    +

    dstAllocationLocalOffset is relative to the contents of given dstAllocation. If you mean whole allocation, you should pass 0. Do not pass allocation's offset within device memory block this parameter!

    @@ -1531,7 +1441,7 @@

    -

    Creates a new VkBuffer, binds already created memory for it.

    +

    Creates a new VkBuffer, binds already created memory for it.

    Parameters
    @@ -1546,9 +1456,9 @@

    vmaDestroyBuffer().

    -
    Note
    There is a new version of this function augmented with parameter allocationLocalOffset - see vmaCreateAliasingBuffer2().
    +

    If any of these operations fail, buffer is not created, returned value is negative error code and *pBuffer is null.

    +

    If the function succeeded, you must destroy the buffer when you no longer need it using vkDestroyBuffer(). If you want to also destroy the corresponding allocation you can use convenience function vmaDestroyBuffer().

    +
    Note
    There is a new version of this function augmented with parameter allocationLocalOffset - see vmaCreateAliasingBuffer2().
    @@ -1586,7 +1496,7 @@

    -

    Creates a new VkBuffer, binds already created memory for it.

    +

    Creates a new VkBuffer, binds already created memory for it.

    Parameters

    allocator
    @@ -1602,9 +1512,9 @@

    vmaDestroyBuffer().

    -
    Note
    This is a new version of the function augmented with parameter allocationLocalOffset.
    +

    If any of these operations fail, buffer is not created, returned value is negative error code and *pBuffer is null.

    +

    If the function succeeded, you must destroy the buffer when you no longer need it using vkDestroyBuffer(). If you want to also destroy the corresponding allocation you can use convenience function vmaDestroyBuffer().

    +
    Note
    This is a new version of the function augmented with parameter allocationLocalOffset.
    @@ -1718,7 +1628,7 @@

    -

    Creates a new VkBuffer, allocates and binds memory for it.

    +

    Creates a new VkBuffer, allocates and binds memory for it.

    Parameters

    allocator
    @@ -1736,10 +1646,10 @@

    vmaDestroyBuffer() or separately, using vkDestroyBuffer() and vmaFreeMemory().

    +

    If any of these operations fail, buffer and allocation are not created, returned value is negative error code, *pBuffer and *pAllocation are null.

    +

    If the function succeeded, you must destroy both buffer and allocation when you no longer need them using either convenience function vmaDestroyBuffer() or separately, using vkDestroyBuffer() and vmaFreeMemory().

    If VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag was used, VK_KHR_dedicated_allocation extension is used internally to query driver whether it requires or prefers the new buffer to have dedicated allocation. If yes, and if dedicated allocation is possible (VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated allocation for this buffer, just like when using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.

    -
    Note
    This function creates a new VkBuffer. Sub-allocation of parts of one large buffer, although recommended as a good practice, is out of scope of this library and could be implemented by the user as a higher-level logic on top of VMA.
    +
    Note
    This function creates a new VkBuffer. Sub-allocation of parts of one large buffer, although recommended as a good practice, is out of scope of this library and could be implemented by the user as a higher-level logic on top of VMA.
    @@ -1788,7 +1698,7 @@

    Creates a buffer with additional minimum alignment.

    -

    Similar to vmaCreateBuffer() but provides additional parameter minAlignment which allows to specify custom, minimum alignment to be used when placing the buffer inside a larger memory block, which may be needed e.g. for interop with OpenGL.

    +

    Similar to vmaCreateBuffer() but provides additional parameter minAlignment which allows to specify custom, minimum alignment to be used when placing the buffer inside a larger memory block, which may be needed e.g. for interop with OpenGL.

    @@ -2029,11 +1939,11 @@

    VK_SUCCESS if no more moves are possible or VK_INCOMPLETE if more defragmentations are possible.

    +

    Ends incremental defragmentation pass and commits all defragmentation moves from pPassInfo. After this call:

    If no more moves are possible you can end whole defragmentation.

    @@ -2068,15 +1978,15 @@

    -

    Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.

    +

    Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.

    This algorithm tries to find a memory type that:

      -
    • Is allowed by memoryTypeBits.
    • -
    • Contains all the flags from pAllocationCreateInfo->requiredFlags.
    • +
    • Is allowed by memoryTypeBits.
    • +
    • Contains all the flags from pAllocationCreateInfo->requiredFlags.
    • Matches intended usage.
    • -
    • Has as many flags from pAllocationCreateInfo->preferredFlags as possible.
    • +
    • Has as many flags from pAllocationCreateInfo->preferredFlags as possible.
    -
    Returns
    Returns VK_ERROR_FEATURE_NOT_PRESENT if not found. Receiving such result from this function or any other allocating function probably means that your device doesn't support any memory type with requested features for the specific type of resource you want to use it for. Please check parameters of your resource, like image layout (OPTIMAL versus LINEAR) or mip level count.
    +
    Returns
    Returns VK_ERROR_FEATURE_NOT_PRESENT if not found. Receiving such result from this function or any other allocating function probably means that your device doesn't support any memory type with requested features for the specific type of resource you want to use it for. Please check parameters of your resource, like image layout (OPTIMAL versus LINEAR) or mip level count.
    @@ -2109,7 +2019,7 @@

    -

    Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.

    +

    Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.

    It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex. It may need to internally create a temporary, dummy buffer that never has memory bound.

    @@ -2143,7 +2053,7 @@

    -

    Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.

    +

    Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.

    It can be useful e.g. to determine value to be used as VmaPoolCreateInfo::memoryTypeIndex. It may need to internally create a temporary, dummy image that never has memory bound.

    @@ -2178,16 +2088,16 @@

    Flushes memory of given allocation.

    -

    Calls vkFlushMappedMemoryRanges() for memory associated with given range of given allocation. It needs to be called after writing to a mapped memory for memory types that are not HOST_COHERENT. Unmap operation doesn't do that automatically.

    +

    Calls vkFlushMappedMemoryRanges() for memory associated with given range of given allocation. It needs to be called after writing to a mapped memory for memory types that are not HOST_COHERENT. Unmap operation doesn't do that automatically.

      -
    • offset must be relative to the beginning of allocation.
    • -
    • size can be VK_WHOLE_SIZE. It means all memory from offset the the end of given allocation.
    • -
    • offset and size don't have to be aligned. They are internally rounded down/up to multiply of nonCoherentAtomSize.
    • -
    • If size is 0, this call is ignored.
    • -
    • If memory type that the allocation belongs to is not HOST_VISIBLE or it is HOST_COHERENT, this call is ignored.
    • +
    • offset must be relative to the beginning of allocation.
    • +
    • size can be VK_WHOLE_SIZE. It means all memory from offset the the end of given allocation.
    • +
    • offset and size don't have to be aligned. They are internally rounded down/up to multiply of nonCoherentAtomSize.
    • +
    • If size is 0, this call is ignored.
    • +
    • If memory type that the allocation belongs to is not HOST_VISIBLE or it is HOST_COHERENT, this call is ignored.
    -

    Warning! offset and size are relative to the contents of given allocation. If you mean whole allocation, you can pass 0 and VK_WHOLE_SIZE, respectively. Do not pass allocation's offset as offset!!!

    -

    This function returns the VkResult from vkFlushMappedMemoryRanges if it is called, otherwise VK_SUCCESS.

    +

    Warning! offset and size are relative to the contents of given allocation. If you mean whole allocation, you can pass 0 and VK_WHOLE_SIZE, respectively. Do not pass allocation's offset as offset!!!

    +

    This function returns the VkResult from vkFlushMappedMemoryRanges if it is called, otherwise VK_SUCCESS.

    @@ -2226,18 +2136,18 @@

    Flushes memory of given set of allocations.

    -

    Calls vkFlushMappedMemoryRanges() for memory associated with given ranges of given allocations. For more information, see documentation of vmaFlushAllocation().

    +

    Calls vkFlushMappedMemoryRanges() for memory associated with given ranges of given allocations. For more information, see documentation of vmaFlushAllocation().

    Parameters

    allocator
    - +
    allocator
    allocationCount
    allocations
    offsetsIf not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all offsets are zero.
    sizesIf not null, it must point to an array of sizes of regions to flush in respective allocations. Null means VK_WHOLE_SIZE for all allocations.
    sizesIf not null, it must point to an array of sizes of regions to flush in respective allocations. Null means VK_WHOLE_SIZE for all allocations.
    -

    This function returns the VkResult from vkFlushMappedMemoryRanges if it is called, otherwise VK_SUCCESS.

    +

    This function returns the VkResult from vkFlushMappedMemoryRanges if it is called, otherwise VK_SUCCESS.

    @@ -2261,7 +2171,7 @@

    Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().

    -

    Passing VK_NULL_HANDLE as allocation is valid. Such function call is just skipped.

    +

    Passing VK_NULL_HANDLE as allocation is valid. Such function call is just skipped.

    @@ -2290,8 +2200,8 @@

    Frees memory and destroys multiple allocations.

    -

    Word "pages" is just a suggestion to use this function to free pieces of memory used for sparse binding. It is just a general purpose function to free memory and destroy allocations made using e.g. vmaAllocateMemory(), vmaAllocateMemoryPages() and other functions. It may be internally optimized to be more efficient than calling vmaFreeMemory() allocationCount times.

    -

    Allocations in pAllocations array can come from any memory pools and types. Passing VK_NULL_HANDLE as elements of pAllocations array is valid. Such entries are just skipped.

    +

    Word "pages" is just a suggestion to use this function to free pieces of memory used for sparse binding. It is just a general purpose function to free memory and destroy allocations made using e.g. vmaAllocateMemory(), vmaAllocateMemoryPages() and other functions. It may be internally optimized to be more efficient than calling vmaFreeMemory() allocationCount times.

    +

    Allocations in pAllocations array can come from any memory pools and types. Passing VK_NULL_HANDLE as elements of pAllocations array is valid. Such entries are just skipped.

    @@ -2320,7 +2230,7 @@

    Returns current information about specified allocation.

    -

    Current parameters of given allocation are returned in pAllocationInfo.

    +

    Current parameters of given allocation are returned in pAllocationInfo.

    Although this function doesn't lock any mutex, so it should be quite efficient, you should avoid calling it too often. You can retrieve same VmaAllocationInfo structure while creating your resource, from function vmaCreateBuffer(), vmaCreateImage(). You can remember it if you are sure parameters don't change (e.g. due to defragmentation).

    There is also a new function vmaGetAllocationInfo2() that offers extended information about the allocation, returned using new structure VmaAllocationInfo2.

    @@ -2351,7 +2261,7 @@

    Returns extended information about specified allocation.

    -

    Current parameters of given allocation are returned in pAllocationInfo. Extended parameters in structure VmaAllocationInfo2 include memory block size and a flag telling whether the allocation has dedicated memory. It can be useful e.g. for interop with OpenGL.

    +

    Current parameters of given allocation are returned in pAllocationInfo. Extended parameters in structure VmaAllocationInfo2 include memory block size and a flag telling whether the allocation has dedicated memory. It can be useful e.g. for interop with OpenGL.

    @@ -2416,17 +2326,86 @@

    Parameters
    - + + + + +
    hTargetProcessMust be a valid handle to target process or null. If it's null, the function returns handle for the current process.
    allocatorThe main allocator object.
    allocationAllocation.
    hTargetProcessA valid handle to target process or null. If it's null, the function returns handle for the current process.
    [out]pHandleOutput parameter that returns the handle.
    +
    + +

    The function fills pHandle with handle that can be used in target process. The handle is fetched using function vkGetMemoryWin32HandleKHR.

    +

    Each call to this function creates a new handle that must be closed using:

    +
    CloseHandle(handle);
    +

    You can close it any time, before or after destroying the allocation object. It is reference-counted internally by Windows.

    +

    Note the handle is returned for the entire VkDeviceMemory block that the allocation belongs to. If the allocation is sub-allocated from a larger block, you may need to consider the offset of the allocation (VmaAllocationInfo::offset).

    +

    This function always uses VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT. An extended version of this function is available as vmaGetMemoryWin32Handle2() that allows using other handle type.

    +

    This function is available compile-time only when VK_KHR_external_memory_win32 extension is available. It can be manually disabled by predefining VMA_EXTERNAL_MEMORY_WIN32=0 macro.

    +

    If the function fails with VK_ERROR_FEATURE_NOT_PRESENT error code, please double-check that VmaVulkanFunctions::vkGetMemoryWin32HandleKHR function pointer is set, e.g. either by using macro VMA_DYNAMIC_VULKAN_FUNCTIONS or by manually passing it through VmaAllocatorCreateInfo::pVulkanFunctions.

    +

    For more information, see chapter Interop with other graphics APIs.

    + + + + +

    ◆ vmaGetMemoryWin32Handle2()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    VkResult vmaGetMemoryWin32Handle2 (VmaAllocator allocator,
    VmaAllocation allocation,
    VkExternalMemoryHandleTypeFlagBits handleType,
    HANDLE hTargetProcess,
    HANDLE * pHandle )
    +
    + +

    Given an allocation, returns Win32 handle that may be imported by other processes or APIs.

    +
    Parameters
    + + + + +
    allocatorThe main allocator object.
    allocationAllocation.
    handleTypeType of handle to be exported. It should be one of:
      +
    • VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR
    • +
    • VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR
    • +
    • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR
    • +
    • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR
    • +
    • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR
    • +
    • VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR
    • +
    +
    hTargetProcessA valid handle to target process or null. If it's null, the function returns handle for the current process.
    [out]pHandleOutput parameter that returns the handle.
    -

    The function fills pHandle with handle that can be used in target process. The handle is fetched using function vkGetMemoryWin32HandleKHR. When no longer needed, you must close it using:

    +

    The function fills pHandle with handle that can be used in target process. The handle is fetched using function vkGetMemoryWin32HandleKHR.

    +

    if handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, each call to this function creates a new handle that must be closed using:

    CloseHandle(handle);

    You can close it any time, before or after destroying the allocation object. It is reference-counted internally by Windows.

    -

    Note the handle is returned for the entire VkDeviceMemory block that the allocation belongs to. If the allocation is sub-allocated from a larger block, you may need to consider the offset of the allocation (VmaAllocationInfo::offset).

    -

    If the function fails with VK_ERROR_FEATURE_NOT_PRESENT error code, please double-check that VmaVulkanFunctions::vkGetMemoryWin32HandleKHR function pointer is set, e.g. either by using VMA_DYNAMIC_VULKAN_FUNCTIONS or by manually passing it through VmaAllocatorCreateInfo::pVulkanFunctions.

    -

    For more information, see chapter VK_KHR_external_memory_win32.

    +

    Note the handle is returned for the entire VkDeviceMemory block that the allocation belongs to. If the allocation is sub-allocated from a larger block, you may need to consider the offset of the allocation (VmaAllocationInfo::offset).

    +

    This function is available compile-time only when VK_KHR_external_memory_win32 extension is available. It can be manually disabled by predefining VMA_EXTERNAL_MEMORY_WIN32=0 macro.

    +

    If the function fails with VK_ERROR_FEATURE_NOT_PRESENT error code, please double-check that VmaVulkanFunctions::vkGetMemoryWin32HandleKHR function pointer is set, e.g. either by using macro VMA_DYNAMIC_VULKAN_FUNCTIONS or by manually passing it through VmaAllocatorCreateInfo::pVulkanFunctions.

    +

    For more information, see chapter Interop with other graphics APIs.

    @@ -2455,7 +2434,7 @@

    Retrieves name of a custom pool.

    -

    After the call ppName is either null or points to an internally-owned null-terminated string containing name of the pool that was previously set. The pointer becomes invalid when the pool is destroyed or its name is changed using vmaSetPoolName().

    +

    After the call ppName is either null or points to an internally-owned null-terminated string containing name of the pool that was previously set. The pointer becomes invalid when the pool is destroyed or its name is changed using vmaSetPoolName().

    @@ -2489,16 +2468,16 @@

    Invalidates memory of given allocation.

    -

    Calls vkInvalidateMappedMemoryRanges() for memory associated with given range of given allocation. It needs to be called before reading from a mapped memory for memory types that are not HOST_COHERENT. Map operation doesn't do that automatically.

    +

    Calls vkInvalidateMappedMemoryRanges() for memory associated with given range of given allocation. It needs to be called before reading from a mapped memory for memory types that are not HOST_COHERENT. Map operation doesn't do that automatically.

      -
    • offset must be relative to the beginning of allocation.
    • -
    • size can be VK_WHOLE_SIZE. It means all memory from offset the the end of given allocation.
    • -
    • offset and size don't have to be aligned. They are internally rounded down/up to multiply of nonCoherentAtomSize.
    • -
    • If size is 0, this call is ignored.
    • -
    • If memory type that the allocation belongs to is not HOST_VISIBLE or it is HOST_COHERENT, this call is ignored.
    • +
    • offset must be relative to the beginning of allocation.
    • +
    • size can be VK_WHOLE_SIZE. It means all memory from offset the the end of given allocation.
    • +
    • offset and size don't have to be aligned. They are internally rounded down/up to multiply of nonCoherentAtomSize.
    • +
    • If size is 0, this call is ignored.
    • +
    • If memory type that the allocation belongs to is not HOST_VISIBLE or it is HOST_COHERENT, this call is ignored.
    -

    Warning! offset and size are relative to the contents of given allocation. If you mean whole allocation, you can pass 0 and VK_WHOLE_SIZE, respectively. Do not pass allocation's offset as offset!!!

    -

    This function returns the VkResult from vkInvalidateMappedMemoryRanges if it is called, otherwise VK_SUCCESS.

    +

    Warning! offset and size are relative to the contents of given allocation. If you mean whole allocation, you can pass 0 and VK_WHOLE_SIZE, respectively. Do not pass allocation's offset as offset!!!

    +

    This function returns the VkResult from vkInvalidateMappedMemoryRanges if it is called, otherwise VK_SUCCESS.

    @@ -2537,18 +2516,18 @@

    Invalidates memory of given set of allocations.

    -

    Calls vkInvalidateMappedMemoryRanges() for memory associated with given ranges of given allocations. For more information, see documentation of vmaInvalidateAllocation().

    +

    Calls vkInvalidateMappedMemoryRanges() for memory associated with given ranges of given allocations. For more information, see documentation of vmaInvalidateAllocation().

    Parameters
    - +
    allocator
    allocationCount
    allocations
    offsetsIf not null, it must point to an array of offsets of regions to flush, relative to the beginning of respective allocations. Null means all offsets are zero.
    sizesIf not null, it must point to an array of sizes of regions to flush in respective allocations. Null means VK_WHOLE_SIZE for all allocations.
    sizesIf not null, it must point to an array of sizes of regions to flush in respective allocations. Null means VK_WHOLE_SIZE for all allocations.
    -

    This function returns the VkResult from vkInvalidateMappedMemoryRanges if it is called, otherwise VK_SUCCESS.

    +

    This function returns the VkResult from vkInvalidateMappedMemoryRanges if it is called, otherwise VK_SUCCESS.

    @@ -2577,14 +2556,14 @@

    Maps memory represented by given allocation and returns pointer to it.

    -

    Maps memory represented by given allocation to make it accessible to CPU code. When succeeded, *ppData contains pointer to first byte of this memory.

    -
    Warning
    If the allocation is part of a bigger VkDeviceMemory block, returned pointer is correctly offsetted to the beginning of region assigned to this particular allocation. Unlike the result of vkMapMemory, it points to the allocation, not to the beginning of the whole block. You should not add VmaAllocationInfo::offset to it!
    -

    Mapping is internally reference-counted and synchronized, so despite raw Vulkan function vkMapMemory() cannot be used to map same block of VkDeviceMemory multiple times simultaneously, it is safe to call this function on allocations assigned to the same memory block. Actual Vulkan memory will be mapped on first mapping and unmapped on last unmapping.

    +

    Maps memory represented by given allocation to make it accessible to CPU code. When succeeded, *ppData contains pointer to first byte of this memory.

    +
    Warning
    If the allocation is part of a bigger VkDeviceMemory block, returned pointer is correctly offsetted to the beginning of region assigned to this particular allocation. Unlike the result of vkMapMemory, it points to the allocation, not to the beginning of the whole block. You should not add VmaAllocationInfo::offset to it!
    +

    Mapping is internally reference-counted and synchronized, so despite raw Vulkan function vkMapMemory() cannot be used to map same block of VkDeviceMemory multiple times simultaneously, it is safe to call this function on allocations assigned to the same memory block. Actual Vulkan memory will be mapped on first mapping and unmapped on last unmapping.

    If the function succeeded, you must call vmaUnmapMemory() to unmap the allocation when mapping is no longer needed or before freeing the allocation, at the latest.

    It also safe to call this function multiple times on the same allocation. You must call vmaUnmapMemory() same number of times as you called vmaMapMemory().

    It is also safe to call this function on allocation created with VMA_ALLOCATION_CREATE_MAPPED_BIT flag. Its memory stays mapped all the time. You must still call vmaUnmapMemory() same number of times as you called vmaMapMemory(). You must not call vmaUnmapMemory() additional time to free the "0-th" mapping made automatically due to VMA_ALLOCATION_CREATE_MAPPED_BIT flag.

    -

    This function fails when used on allocation made in memory type that is not HOST_VISIBLE.

    -

    This function doesn't automatically flush or invalidate caches. If the allocation is made from a memory types that is not HOST_COHERENT, you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.

    +

    This function fails when used on allocation made in memory type that is not HOST_VISIBLE.

    +

    This function doesn't automatically flush or invalidate caches. If the allocation is made from a memory types that is not HOST_COHERENT, you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.

    @@ -2613,7 +2592,7 @@

    Sets pName in given allocation to new value.

    -

    pName must be either null, or pointer to a null-terminated string. The function makes local copy of the string and sets it as allocation's pName. String passed as pName doesn't need to be valid for whole lifetime of the allocation - you can free it after this call. String previously pointed by allocation's pName is freed from memory.

    +

    pName must be either null, or pointer to a null-terminated string. The function makes local copy of the string and sets it as allocation's pName. String passed as pName doesn't need to be valid for whole lifetime of the allocation - you can free it after this call. String previously pointed by allocation's pName is freed from memory.

    @@ -2642,7 +2621,7 @@

    Sets pUserData in given allocation to new value.

    -

    The value of pointer pUserData is copied to allocation's pUserData. It is opaque, so you can use it however you want - e.g. as a pointer, ordinal number or some handle to you own data.

    +

    The value of pointer pUserData is copied to allocation's pUserData. It is opaque, so you can use it however you want - e.g. as a pointer, ordinal number or some handle to you own data.

    @@ -2671,7 +2650,7 @@

    Sets name of a custom pool.

    -

    pName can be either null or pointer to a null-terminated string with new name for the pool. Function makes internal copy of the string, so it can be changed or freed immediately after this call.

    +

    pName can be either null or pointer to a null-terminated string with new name for the pool. Function makes internal copy of the string, so it can be changed or freed immediately after this call.

    @@ -2696,14 +2675,14 @@

    vmaMapMemory().

    For details, see description of vmaMapMemory().

    -

    This function doesn't automatically flush or invalidate caches. If the allocation is made from a memory types that is not HOST_COHERENT, you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.

    +

    This function doesn't automatically flush or invalidate caches. If the allocation is made from a memory types that is not HOST_COHERENT, you also need to use vmaInvalidateAllocation() / vmaFlushAllocation(), as required by Vulkan specification.

    diff --git a/docs/html/group__group__init.html b/docs/html/group__group__init.html index 4d9b2056..7f7e88e3 100644 --- a/docs/html/group__group__init.html +++ b/docs/html/group__group__init.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Library initialization - - @@ -33,35 +31,24 @@ - +
    -
    Typedefs | Enumerations | Functions
    -
    Library initialization
    +
    Library initialization

    API elements related to the initialization and management of the entire library, especially VmaAllocator object. More...

    - - - - - + + + - - + - - + - - + -

    +

    Classes

    struct  VmaDeviceMemoryCallbacks
     Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More...
     
    struct  VmaVulkanFunctions
    struct  VmaDeviceMemoryCallbacks
     Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More...
    struct  VmaVulkanFunctions
     Pointers to some Vulkan functions - a subset used by the library. More...
     
    struct  VmaAllocatorCreateInfo
    struct  VmaAllocatorCreateInfo
     Description of a Allocator to be created. More...
     
    struct  VmaAllocatorInfo
    struct  VmaAllocatorInfo
     Information about existing VmaAllocator object. More...
     
    struct  VmaAllocator
    struct  VmaAllocator
     Represents main object of this library initialized. More...
     
    - - - - - - - + - - -

    +

    Typedefs

    typedef enum VmaAllocatorCreateFlagBits VmaAllocatorCreateFlagBits
     Flags for created VmaAllocator.
     
    typedef VkFlags VmaAllocatorCreateFlags
     See VmaAllocatorCreateFlagBits.
     
    typedef void(VKAPI_PTR * PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData)
     Callback function called after successful vkAllocateMemory.
     
    typedef void(VKAPI_PTR * PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData)
     Callback function called before vkFreeMemory.
     
    typedef struct VmaDeviceMemoryCallbacks VmaDeviceMemoryCallbacks
     Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.
     
     Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.
    typedef struct VmaVulkanFunctions VmaVulkanFunctions
     Pointers to some Vulkan functions - a subset used by the library.
     
    typedef struct VmaAllocatorCreateInfo VmaAllocatorCreateInfo
     Description of a Allocator to be created.
     
    typedef struct VmaAllocatorInfo VmaAllocatorInfo
     Information about existing VmaAllocator object.
     
    - -

    +

    Enumerations

    enum  VmaAllocatorCreateFlagBits {
      VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001 @@ -160,36 +134,27 @@
    }
     Flags for created VmaAllocator. More...
     
    - - - + - - - - - - -

    +

    Functions

    VkResult vmaImportVulkanFunctionsFromVolk (const VmaAllocatorCreateInfo *pAllocatorCreateInfo, VmaVulkanFunctions *pDstVulkanFunctions)
     Fully initializes pDstVulkanFunctions structure with Vulkan functions needed by VMA using volk library.
     
     Fully initializes pDstVulkanFunctions structure with Vulkan functions needed by VMA using volk library.
    VkResult vmaCreateAllocator (const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator)
     Creates VmaAllocator object.
     
    void vmaDestroyAllocator (VmaAllocator allocator)
     Destroys allocator object.
     
    void vmaGetAllocatorInfo (VmaAllocator allocator, VmaAllocatorInfo *pAllocatorInfo)
     Returns information about existing VmaAllocator object - handle to Vulkan device etc.
     
    void vmaGetPhysicalDeviceProperties (VmaAllocator allocator, const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties)
     
    void vmaGetMemoryProperties (VmaAllocator allocator, const VkPhysicalDeviceMemoryProperties **ppPhysicalDeviceMemoryProperties)
     
    void vmaGetMemoryTypeProperties (VmaAllocator allocator, uint32_t memoryTypeIndex, VkMemoryPropertyFlags *pFlags)
     Given Memory Type Index, returns Property Flags of this memory type.
     
    void vmaSetCurrentFrameIndex (VmaAllocator allocator, uint32_t frameIndex)
     Sets index of the current frame.
     
    -

    Detailed Description

    +

    Detailed Description

    API elements related to the initialization and management of the entire library, especially VmaAllocator object.

    -

    Typedef Documentation

    +

    Typedef Documentation

    ◆ PFN_vmaAllocateDeviceMemoryFunction

    @@ -298,7 +263,7 @@

    -

    Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.

    +

    Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.

    Provided for informative purpose, e.g. to gather statistics about number of allocations or total amount of memory allocated in Vulkan.

    Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.

    @@ -321,7 +286,7 @@

    Enumeration Type Documentation

    +

    Enumeration Type Documentation

    ◆ VmaAllocatorCreateFlagBits

    @@ -340,7 +305,7 @@

    VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT 

    Enables usage of VK_KHR_dedicated_allocation extension.

    -

    The flag works only if VmaAllocatorCreateInfo::vulkanApiVersion == VK_API_VERSION_1_0. When it is VK_API_VERSION_1_1, the flag is ignored because the extension has been promoted to Vulkan 1.1.

    +

    The flag works only if VmaAllocatorCreateInfo::vulkanApiVersion == VK_API_VERSION_1_0. When it is VK_API_VERSION_1_1, the flag is ignored because the extension has been promoted to Vulkan 1.1.

    Using this extension will automatically allocate dedicated blocks of memory for some buffers and images instead of suballocating place for them out of bigger memory blocks (as if you explicitly used VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag) when it is recommended by the driver. It may improve performance on some GPUs.

    You may set this flag only if you found out that following device extensions are supported, you enabled them while creating Vulkan device passed as VmaAllocatorCreateInfo::device, and you want them to be used internally by this library:

    -

    The extension and accompanying device feature provide access to memory types with VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD and VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD flags. They are useful mostly for writing breadcrumb markers - a common method for debugging GPU crash/hang/TDR.

    -

    When the extension is not enabled, such memory types are still enumerated, but their usage is illegal. To protect from this error, if you don't create the allocator with this flag, it will refuse to allocate any memory or create a custom pool in such memory type, returning VK_ERROR_FEATURE_NOT_PRESENT.

    +

    The extension and accompanying device feature provide access to memory types with VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD and VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD flags. They are useful mostly for writing breadcrumb markers - a common method for debugging GPU crash/hang/TDR.

    +

    When the extension is not enabled, such memory types are still enumerated, but their usage is illegal. To protect from this error, if you don't create the allocator with this flag, it will refuse to allocate any memory or create a custom pool in such memory type, returning VK_ERROR_FEATURE_NOT_PRESENT.

    -VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT 

    Enables usage of "buffer device address" feature, which allows you to use function vkGetBufferDeviceAddress* to get raw GPU pointer to a buffer and pass it for usage inside a shader.

    +VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT 

    Enables usage of "buffer device address" feature, which allows you to use function vkGetBufferDeviceAddress* to get raw GPU pointer to a buffer and pass it for usage inside a shader.

    You may set this flag only if you:

    1. (For Vulkan version < 1.2) Found as available and enabled device extension VK_KHR_buffer_device_address. This extension is promoted to core Vulkan 1.2.
    2. -
    3. Found as available and enabled device feature VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress.
    4. +
    5. Found as available and enabled device feature VkPhysicalDeviceBufferDeviceAddressFeatures::bufferDeviceAddress.
    -

    When this flag is set, you can create buffers with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT using VMA. The library automatically adds VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT to allocated memory blocks wherever it might be needed.

    +

    When this flag is set, you can create buffers with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT using VMA. The library automatically adds VK_MEMORY_ALLOCATE_DEVICE_ADDRESS_BIT to allocated memory blocks wherever it might be needed.

    For more information, see documentation chapter Enabling buffer device address.

    VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT 

    Enables usage of VK_EXT_memory_priority extension in the library.

    -

    You may set this flag only if you found available and enabled this device extension, along with VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority == VK_TRUE, while creating Vulkan device passed as VmaAllocatorCreateInfo::device.

    +

    You may set this flag only if you found available and enabled this device extension, along with VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority == VK_TRUE, while creating Vulkan device passed as VmaAllocatorCreateInfo::device.

    When this flag is used, VmaAllocationCreateInfo::priority and VmaPoolCreateInfo::priority are used to set priorities of allocated Vulkan memory. Without it, these variables are ignored.

    -

    A priority must be a floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations. Larger values are higher priority. The granularity of the priorities is implementation-dependent. It is automatically passed to every call to vkAllocateMemory done by the library using structure VkMemoryPriorityAllocateInfoEXT. The value to be used for default priority is 0.5. For more details, see the documentation of the VK_EXT_memory_priority extension.

    +

    A priority must be a floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations. Larger values are higher priority. The granularity of the priorities is implementation-dependent. It is automatically passed to every call to vkAllocateMemory done by the library using structure VkMemoryPriorityAllocateInfoEXT. The value to be used for default priority is 0.5. For more details, see the documentation of the VK_EXT_memory_priority extension.

    VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT 

    Enables usage of VK_KHR_maintenance4 extension in the library.

    You may set this flag only if you found available and enabled this device extension, while creating Vulkan device passed as VmaAllocatorCreateInfo::device.

    @@ -392,14 +357,14 @@

    VmaAllocatorCreateInfo::device.

    VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT 

    Enables usage of VK_KHR_external_memory_win32 extension in the library.

    -

    You should set this flag if you found available and enabled this device extension, while creating Vulkan device passed as VmaAllocatorCreateInfo::device. For more information, see VK_KHR_external_memory_win32.

    +

    You should set this flag if you found available and enabled this device extension, while creating Vulkan device passed as VmaAllocatorCreateInfo::device. For more information, see Interop with other graphics APIs.

    VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM 

    -

    Function Documentation

    +

    Function Documentation

    ◆ vmaCreateAllocator()

    @@ -462,7 +427,7 @@

    Returns information about existing VmaAllocator object - handle to Vulkan device etc.

    -

    It might be useful if you want to keep just the VmaAllocator handle and fetch other required handles to VkPhysicalDevice, VkDevice etc. every time using this function.

    +

    It might be useful if you want to keep just the VmaAllocator handle and fetch other required handles to VkPhysicalDevice, VkDevice etc. every time using this function.

    @@ -558,16 +523,16 @@

    -

    Fully initializes pDstVulkanFunctions structure with Vulkan functions needed by VMA using volk library.

    +

    Fully initializes pDstVulkanFunctions structure with Vulkan functions needed by VMA using volk library.

    This function is defined in VMA header only if "volk.h" was included before it.

    To use this function properly:

    1. Initialize volk and Vulkan:
        -
      1. Call volkInitialize()
      2. -
      3. Create VkInstance object
      4. -
      5. Call volkLoadInstance()
      6. -
      7. Create VkDevice object
      8. -
      9. Call volkLoadDevice()
      10. +
      11. Call volkInitialize()
      12. +
      13. Create VkInstance object
      14. +
      15. Call volkLoadInstance()
      16. +
      17. Create VkDevice object
      18. +
      19. Call volkLoadDevice()
    2. Fill in structure VmaAllocatorCreateInfo, especially members:
    @@ -613,7 +578,7 @@

    uint32_t vulkanApiVersion
    Optional. Vulkan version that the application uses.
    Definition vk_mem_alloc.h:1132
    Represents main object of this library initialized.
    Pointers to some Vulkan functions - a subset used by the library.
    Definition vk_mem_alloc.h:1015
    -

    Internally in this function, pointers to functions related to the entire Vulkan instance are fetched using global function definitions, while pointers to functions related to the Vulkan device are fetched using volkLoadDeviceTable() for given pAllocatorCreateInfo->device.

    +

    Internally in this function, pointers to functions related to the entire Vulkan instance are fetched using global function definitions, while pointers to functions related to the Vulkan device are fetched using volkLoadDeviceTable() for given pAllocatorCreateInfo->device.

    @@ -643,7 +608,7 @@

    diff --git a/docs/html/group__group__stats.html b/docs/html/group__group__stats.html index 1a8c57a3..be757358 100644 --- a/docs/html/group__group__stats.html +++ b/docs/html/group__group__stats.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Statistics - - @@ -33,35 +31,24 @@ - +
    -
    Classes | Typedefs | Functions
    -
    Statistics
    +
    Statistics

    API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics. More...

    - - + - - + - - + - - + -

    +

    Classes

    struct  VmaStatistics
    struct  VmaStatistics
     Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total. More...
     
    struct  VmaDetailedStatistics
    struct  VmaDetailedStatistics
     More detailed statistics than VmaStatistics. More...
     
    struct  VmaTotalStatistics
    struct  VmaTotalStatistics
     General statistics from current state of the Allocator - total memory usage across all memory heaps and types. More...
     
    struct  VmaBudget
    struct  VmaBudget
     Statistics of current memory usage and available budget for a specific memory heap. More...
     
    - - - - -

    +

    Typedefs

    typedef struct VmaStatistics VmaStatistics
     Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total.
     
    typedef struct VmaDetailedStatistics VmaDetailedStatistics
     More detailed statistics than VmaStatistics.
     
    typedef struct VmaTotalStatistics VmaTotalStatistics
     General statistics from current state of the Allocator - total memory usage across all memory heaps and types.
     
    typedef struct VmaBudget VmaBudget
     Statistics of current memory usage and available budget for a specific memory heap.
     
    - - - - - - - - -

    +

    Functions

    void vmaCalculateStatistics (VmaAllocator allocator, VmaTotalStatistics *pStats)
     Retrieves statistics from current state of the Allocator.
     
    void vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets)
     Retrieves information about current memory usage and budget for all memory heaps.
     
    void vmaGetPoolStatistics (VmaAllocator allocator, VmaPool pool, VmaStatistics *pPoolStats)
     Retrieves statistics of existing VmaPool object.
     
    void vmaCalculatePoolStatistics (VmaAllocator allocator, VmaPool pool, VmaDetailedStatistics *pPoolStats)
     Retrieves detailed statistics of existing VmaPool object.
     
    void vmaBuildVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char **ppStatsString, VkBool32 detailedMap)
     Builds and returns a null-terminated string in JSON format with information about given VmaVirtualBlock.
     
    void vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString)
     Frees a string returned by vmaBuildVirtualBlockStatsString().
     
    void vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap)
     Builds and returns statistics as a null-terminated string in JSON format.
     
    void vmaFreeStatsString (VmaAllocator allocator, char *pStatsString)
     
    -

    Detailed Description

    +

    Detailed Description

    API elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics.

    -

    Typedef Documentation

    +

    Typedef Documentation

    ◆ VmaBudget

    @@ -226,7 +197,7 @@

    Function Documentation

    +

    Function Documentation

    ◆ vmaBuildStatsString()

    @@ -292,7 +263,7 @@

    virtualBlockVirtual block. [out]ppStatsStringReturned string. - detailedMapPass VK_FALSE to only obtain statistics as returned by vmaCalculateVirtualBlockStatistics(). Pass VK_TRUE to also obtain full list of allocations and free spaces. + detailedMapPass VK_FALSE to only obtain statistics as returned by vmaCalculateVirtualBlockStatistics(). Pass VK_TRUE to also obtain full list of allocations and free spaces. @@ -477,7 +448,7 @@

    diff --git a/docs/html/group__group__virtual.html b/docs/html/group__group__virtual.html index 5499709b..b5e23cc1 100644 --- a/docs/html/group__group__virtual.html +++ b/docs/html/group__group__virtual.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Virtual allocator - - @@ -33,35 +31,24 @@ - +
    -
    Typedefs | Enumerations | Functions
    -
    Virtual allocator
    +
    Virtual allocator

    API elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory. More...

    - - + - - + - - + - - + - - + -

    +

    Classes

    struct  VmaVirtualBlockCreateInfo
    struct  VmaVirtualBlockCreateInfo
     Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). More...
     
    struct  VmaVirtualAllocationCreateInfo
    struct  VmaVirtualAllocationCreateInfo
     Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). More...
     
    struct  VmaVirtualAllocationInfo
    struct  VmaVirtualAllocationInfo
     Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo(). More...
     
    struct  VmaVirtualAllocation
    struct  VmaVirtualAllocation
     Represents single memory allocation done inside VmaVirtualBlock. More...
     
    struct  VmaVirtualBlock
    struct  VmaVirtualBlock
     Handle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory. More...
     
    - - - - - - - -

    +

    Typedefs

    typedef enum VmaVirtualBlockCreateFlagBits VmaVirtualBlockCreateFlagBits
     Flags to be passed as VmaVirtualBlockCreateInfo::flags.
     
    typedef VkFlags VmaVirtualBlockCreateFlags
     Flags to be passed as VmaVirtualBlockCreateInfo::flags. See VmaVirtualBlockCreateFlagBits.
     
    typedef enum VmaVirtualAllocationCreateFlagBits VmaVirtualAllocationCreateFlagBits
     Flags to be passed as VmaVirtualAllocationCreateInfo::flags.
     
    typedef VkFlags VmaVirtualAllocationCreateFlags
     Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See VmaVirtualAllocationCreateFlagBits.
     
    typedef struct VmaVirtualBlockCreateInfo VmaVirtualBlockCreateInfo
     Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
     
    typedef struct VmaVirtualAllocationCreateInfo VmaVirtualAllocationCreateInfo
     Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
     
    typedef struct VmaVirtualAllocationInfo VmaVirtualAllocationInfo
     Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
     
    - - -

    +

    Enumerations

    enum  VmaVirtualBlockCreateFlagBits { VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 0x00000001 , VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK , VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF }
     Flags to be passed as VmaVirtualBlockCreateInfo::flags. More...
     
    enum  VmaVirtualAllocationCreateFlagBits {
      VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT , VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT @@ -157,44 +131,33 @@
    }
     Flags to be passed as VmaVirtualAllocationCreateInfo::flags. More...
     
    - - - - - - + - - - - - -

    +

    Functions

    VkResult vmaCreateVirtualBlock (const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock)
     Creates new VmaVirtualBlock object.
     
    void vmaDestroyVirtualBlock (VmaVirtualBlock virtualBlock)
     Destroys VmaVirtualBlock object.
     
    VkBool32 vmaIsVirtualBlockEmpty (VmaVirtualBlock virtualBlock)
     Returns true of the VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations.
     
    void vmaGetVirtualAllocationInfo (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, VmaVirtualAllocationInfo *pVirtualAllocInfo)
     Returns information about a specific virtual allocation within a virtual block, like its size and pUserData pointer.
     
     Returns information about a specific virtual allocation within a virtual block, like its size and pUserData pointer.
    VkResult vmaVirtualAllocate (VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VmaVirtualAllocation *pAllocation, VkDeviceSize *pOffset)
     Allocates new virtual allocation inside given VmaVirtualBlock.
     
    void vmaVirtualFree (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation)
     Frees virtual allocation inside given VmaVirtualBlock.
     
    void vmaClearVirtualBlock (VmaVirtualBlock virtualBlock)
     Frees all virtual allocations inside given VmaVirtualBlock.
     
    void vmaSetVirtualAllocationUserData (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, void *pUserData)
     Changes custom pointer associated with given virtual allocation.
     
    void vmaGetVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaStatistics *pStats)
     Calculates and returns statistics about virtual allocations and memory usage in given VmaVirtualBlock.
     
    void vmaCalculateVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaDetailedStatistics *pStats)
     Calculates and returns detailed statistics about virtual allocations and memory usage in given VmaVirtualBlock.
     
    -

    Detailed Description

    +

    Detailed Description

    API elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory.

    -

    Typedef Documentation

    +

    Typedef Documentation

    ◆ VmaVirtualAllocationCreateFlagBits

    @@ -307,7 +270,7 @@

    Enumeration Type Documentation

    +

    Enumeration Type Documentation

    ◆ VmaVirtualAllocationCreateFlagBits

    @@ -331,7 +294,7 @@

    VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT 

    Allocation strategy that chooses always the lowest offset in available space. This is not the most efficient strategy but achieves highly packed data.

    -VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK 

    A bit mask to extract only STRATEGY bits from entire set of flags.

    +VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK 

    A bit mask to extract only STRATEGY bits from entire set of flags.

    These strategy flags are binary compatible with equivalent flags in VmaAllocationCreateFlagBits.

    VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM  @@ -357,14 +320,14 @@

    Linear allocation algorithm.

    -VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK 

    Bit mask to extract only ALGORITHM bits from entire set of flags.

    +VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK 

    Bit mask to extract only ALGORITHM bits from entire set of flags.

    VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM 

    -

    Function Documentation

    +

    Function Documentation

    ◆ vmaCalculateVirtualBlockStatistics()

    @@ -406,7 +369,7 @@

    VmaVirtualBlock.

    You must either call this function or free each virtual allocation individually with vmaVirtualFree() before destroying a virtual block. Otherwise, an assert is called.

    -

    If you keep pointer to some additional metadata associated with your virtual allocation in its pUserData, don't forget to free it as well.

    +

    If you keep pointer to some additional metadata associated with your virtual allocation in its pUserData, don't forget to free it as well.

    @@ -433,7 +396,7 @@

    Parameters
    - +
    pCreateInfoParameters for creation.
    [out]pVirtualBlockReturned virtual block object or VMA_NULL if creation failed.
    [out]pVirtualBlockReturned virtual block object or VMA_NULL if creation failed.
    @@ -457,7 +420,7 @@

    VmaVirtualBlock object.

    Please note that you should consciously handle virtual allocations that could remain unfreed in the block. You should either free them individually using vmaVirtualFree() or call vmaClearVirtualBlock() if you are sure this is what you want. If you do neither, an assert is called.

    -

    If you keep pointers to some additional metadata associated with your virtual allocations in their pUserData, don't forget to free them.

    +

    If you keep pointers to some additional metadata associated with your virtual allocations in their pUserData, don't forget to free them.

    @@ -485,7 +448,7 @@

    -

    Returns information about a specific virtual allocation within a virtual block, like its size and pUserData pointer.

    +

    Returns information about a specific virtual allocation within a virtual block, like its size and pUserData pointer.

    @@ -590,7 +553,7 @@

    Allocates new virtual allocation inside given VmaVirtualBlock.

    -

    If the allocation fails due to not enough free space available, VK_ERROR_OUT_OF_DEVICE_MEMORY is returned (despite the function doesn't ever allocate actual GPU memory). pAllocation is then set to VK_NULL_HANDLE and pOffset, if not null, it set to UINT64_MAX.

    +

    If the allocation fails due to not enough free space available, VK_ERROR_OUT_OF_DEVICE_MEMORY is returned (despite the function doesn't ever allocate actual GPU memory). pAllocation is then set to VK_NULL_HANDLE and pOffset, if not null, it set to UINT64_MAX.

    Parameters
    @@ -623,14 +586,14 @@

    Frees virtual allocation inside given VmaVirtualBlock.

    -

    It is correct to call this function with allocation == VK_NULL_HANDLE - it does nothing.

    +

    It is correct to call this function with allocation == VK_NULL_HANDLE - it does nothing.

    diff --git a/docs/html/index.html b/docs/html/index.html index 06b26ef2..336de742 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Vulkan Memory Allocator - - @@ -33,35 +31,24 @@

    virtualBlockVirtual block
    - +
    -
    Vulkan Memory Allocator
    -

    Version 3.3.0

    +

    Version 3.4.0-development

    Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved.
    License: MIT
    -See also: product page on GPUOpen, repository on GitHub

    +See also: product page on GPUOpen, repository on GitHub

    API documentation divided into groups: Topics

    General documentation chapters:

    -
  • Interop with other graphics APIs
  • +
  • Interop with other graphics APIs +
  • Recommended usage patterns
  • General considerations
      @@ -191,7 +180,7 @@
  • diff --git a/docs/html/memory_mapping.html b/docs/html/memory_mapping.html index 39209d2a..4c910514 100644 --- a/docs/html/memory_mapping.html +++ b/docs/html/memory_mapping.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Memory mapping - - @@ -33,33 +31,22 @@
    - + -
    -
    Memory mapping
    +
    Memory mapping
    -

    To "map memory" in Vulkan means to obtain a CPU pointer to VkDeviceMemory, to be able to read from it or write to it in CPU code. Mapping is possible only of memory allocated from a memory type that has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT flag. Functions vkMapMemory(), vkUnmapMemory() are designed for this purpose. You can use them directly with memory allocated by this library, but it is not recommended because of following issue: Mapping the same VkDeviceMemory block multiple times is illegal - only one mapping at a time is allowed. This includes mapping disjoint regions. Mapping is not reference-counted internally by Vulkan. It is also not thread-safe. Because of this, Vulkan Memory Allocator provides following facilities:

    -
    Note
    If you want to be able to map an allocation, you need to specify one of the flags VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT in VmaAllocationCreateInfo::flags. These flags are required for an allocation to be mappable when using VMA_MEMORY_USAGE_AUTO or other VMA_MEMORY_USAGE_AUTO* enum values. For other usage values they are ignored and every such allocation made in HOST_VISIBLE memory type is mappable, but these flags can still be used for consistency.
    -

    +

    To "map memory" in Vulkan means to obtain a CPU pointer to VkDeviceMemory, to be able to read from it or write to it in CPU code. Mapping is possible only of memory allocated from a memory type that has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT flag. Functions vkMapMemory(), vkUnmapMemory() are designed for this purpose. You can use them directly with memory allocated by this library, but it is not recommended because of following issue: Mapping the same VkDeviceMemory block multiple times is illegal - only one mapping at a time is allowed. This includes mapping disjoint regions. Mapping is not reference-counted internally by Vulkan. It is also not thread-safe. Because of this, Vulkan Memory Allocator provides following facilities:

    +
    Note
    If you want to be able to map an allocation, you need to specify one of the flags VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT in VmaAllocationCreateInfo::flags. These flags are required for an allocation to be mappable when using VMA_MEMORY_USAGE_AUTO or other VMA_MEMORY_USAGE_AUTO* enum values. For other usage values they are ignored and every such allocation made in HOST_VISIBLE memory type is mappable, but these flags can still be used for consistency.
    +

    Copy functions

    -

    The easiest way to copy data from a host pointer to an allocation is to use convenience function vmaCopyMemoryToAllocation(). It automatically maps the Vulkan memory temporarily (if not already mapped), performs memcpy, and calls vkFlushMappedMemoryRanges (if required - if memory type is not HOST_COHERENT).

    -

    It is also the safest one, because using memcpy avoids a risk of accidentally introducing memory reads (e.g. by doing pMappedVectors[i] += v), which may be very slow on memory types that are not HOST_CACHED.

    +

    The easiest way to copy data from a host pointer to an allocation is to use convenience function vmaCopyMemoryToAllocation(). It automatically maps the Vulkan memory temporarily (if not already mapped), performs memcpy, and calls vkFlushMappedMemoryRanges (if required - if memory type is not HOST_COHERENT).

    +

    It is also the safest one, because using memcpy avoids a risk of accidentally introducing memory reads (e.g. by doing pMappedVectors[i] += v), which may be very slow on memory types that are not HOST_CACHED.

    struct ConstantBuffer
    {
    ...
    @@ -125,9 +112,9 @@

    VmaAllocationCreateFlags flags
    Use VmaAllocationCreateFlagBits enum.
    Definition vk_mem_alloc.h:1293
    Represents single memory allocation.

    Copy in the other direction - from an allocation to a host pointer can be performed the same way using function vmaCopyAllocationToMemory().

    -

    +

    Mapping functions

    -

    The library provides following functions for mapping of a specific allocation: vmaMapMemory(), vmaUnmapMemory(). They are safer and more convenient to use than standard Vulkan functions. You can map an allocation multiple times simultaneously - mapping is reference-counted internally. You can also map different allocations simultaneously regardless of whether they use the same VkDeviceMemory block. The way it is implemented is that the library always maps entire memory block, not just region of the allocation. For further details, see description of vmaMapMemory() function. Example:

    +

    The library provides following functions for mapping of a specific allocation: vmaMapMemory(), vmaUnmapMemory(). They are safer and more convenient to use than standard Vulkan functions. You can map an allocation multiple times simultaneously - mapping is reference-counted internally. You can also map different allocations simultaneously regardless of whether they use the same VkDeviceMemory block. The way it is implemented is that the library always maps entire memory block, not just region of the allocation. For further details, see description of vmaMapMemory() function. Example:

    // Having these objects initialized:
    struct ConstantBuffer
    {
    @@ -149,8 +136,8 @@

    VkResult vmaMapMemory(VmaAllocator allocator, VmaAllocation allocation, void **ppData)
    Maps memory represented by given allocation and returns pointer to it.

    When mapping, you may see a warning from Vulkan validation layer similar to this one:

    Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used.

    -

    It happens because the library maps entire VkDeviceMemory block, where different types of images and buffers may end up together, especially on GPUs with unified memory like Intel. You can safely ignore it if you are sure you access only memory of the intended object that you wanted to map.

    -

    +

    It happens because the library maps entire VkDeviceMemory block, where different types of images and buffers may end up together, especially on GPUs with unified memory like Intel. You can safely ignore it if you are sure you access only memory of the intended object that you wanted to map.

    +

    Persistently mapped memory

    Keeping your memory persistently mapped is generally OK in Vulkan. You don't need to unmap it before using its data on the GPU. The library provides a special feature designed for that: Allocations made with VMA_ALLOCATION_CREATE_MAPPED_BIT flag set in VmaAllocationCreateInfo::flags stay mapped all the time, so you can just access CPU pointer to it any time without a need to call any "map" or "unmap" function. Example:

    VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    @@ -172,17 +159,17 @@

    @ VMA_ALLOCATION_CREATE_MAPPED_BIT
    Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
    Definition vk_mem_alloc.h:610
    Definition vk_mem_alloc.h:1410
    void * pMappedData
    Pointer to the beginning of this allocation as mapped data.
    Definition vk_mem_alloc.h:1452
    -

    Note
    VMA_ALLOCATION_CREATE_MAPPED_BIT by itself doesn't guarantee that the allocation will end up in a mappable memory type. For this, you need to also specify VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. VMA_ALLOCATION_CREATE_MAPPED_BIT only guarantees that if the memory is HOST_VISIBLE, the allocation will be mapped on creation. For an example of how to make use of this fact, see section Advanced data uploading.
    -

    +

    Note
    VMA_ALLOCATION_CREATE_MAPPED_BIT by itself doesn't guarantee that the allocation will end up in a mappable memory type. For this, you need to also specify VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. VMA_ALLOCATION_CREATE_MAPPED_BIT only guarantees that if the memory is HOST_VISIBLE, the allocation will be mapped on creation. For an example of how to make use of this fact, see section Advanced data uploading.
    +

    Cache flush and invalidate

    -

    Memory in Vulkan doesn't need to be unmapped before using it on GPU, but unless a memory types has VK_MEMORY_PROPERTY_HOST_COHERENT_BIT flag set, you need to manually invalidate cache before reading of mapped pointer and flush cache after writing to mapped pointer. Map/unmap operations don't do that automatically. Vulkan provides following functions for this purpose vkFlushMappedMemoryRanges(), vkInvalidateMappedMemoryRanges(), but this library provides more convenient functions that refer to given allocation object: vmaFlushAllocation(), vmaInvalidateAllocation(), or multiple objects at once: vmaFlushAllocations(), vmaInvalidateAllocations().

    -

    Regions of memory specified for flush/invalidate must be aligned to VkPhysicalDeviceLimits::nonCoherentAtomSize. This is automatically ensured by the library. In any memory type that is HOST_VISIBLE but not HOST_COHERENT, all allocations within blocks are aligned to this value, so their offsets are always multiply of nonCoherentAtomSize and two different allocations never share same "line" of this size.

    -

    Also, Windows drivers from all 3 PC GPU vendors (AMD, Intel, NVIDIA) currently provide HOST_COHERENT flag on all memory types that are HOST_VISIBLE, so on PC you may not need to bother.

    +

    Memory in Vulkan doesn't need to be unmapped before using it on GPU, but unless a memory types has VK_MEMORY_PROPERTY_HOST_COHERENT_BIT flag set, you need to manually invalidate cache before reading of mapped pointer and flush cache after writing to mapped pointer. Map/unmap operations don't do that automatically. Vulkan provides following functions for this purpose vkFlushMappedMemoryRanges(), vkInvalidateMappedMemoryRanges(), but this library provides more convenient functions that refer to given allocation object: vmaFlushAllocation(), vmaInvalidateAllocation(), or multiple objects at once: vmaFlushAllocations(), vmaInvalidateAllocations().

    +

    Regions of memory specified for flush/invalidate must be aligned to VkPhysicalDeviceLimits::nonCoherentAtomSize. This is automatically ensured by the library. In any memory type that is HOST_VISIBLE but not HOST_COHERENT, all allocations within blocks are aligned to this value, so their offsets are always multiply of nonCoherentAtomSize and two different allocations never share same "line" of this size.

    +

    Also, Windows drivers from all 3 PC GPU vendors (AMD, Intel, NVIDIA) currently provide HOST_COHERENT flag on all memory types that are HOST_VISIBLE, so on PC you may not need to bother.

    diff --git a/docs/html/menu.js b/docs/html/menu.js index 0fd1e990..15f9c522 100644 --- a/docs/html/menu.js +++ b/docs/html/menu.js @@ -49,7 +49,7 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { searchBoxHtml='
    '+ '
    '+ '
     '+ + '" method="get">'+ ''+ @@ -60,8 +60,8 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { } else { searchBoxHtml='
    '+ ''+ - ' '+ + ''+ ''+ ''+ - ''+ + '
    '+ '
    '+ '
    '; } @@ -84,9 +83,7 @@ function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { '
    '); $('#main-nav').append(makeTree(menudata,relPath)); $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); - if (searchBoxHtml) { - $('#main-menu').append('
  • '); - } + $('#main-menu').append('
  • '); const $mainMenuState = $('#main-menu-state'); let prevWidth = 0; if ($mainMenuState.length) { diff --git a/docs/html/navtree.css b/docs/html/navtree.css index 69211d4a..0ea3a07a 100644 --- a/docs/html/navtree.css +++ b/docs/html/navtree.css @@ -11,8 +11,8 @@ #nav-tree li { white-space:nowrap; - margin:0px; - padding:0px; + margin:0; + padding:0; } #nav-tree .plus { @@ -20,15 +20,10 @@ } #nav-tree .selected { - background-image: url('tab_a.png'); - background-repeat:repeat-x; - color: var(--nav-text-active-color); - text-shadow: var(--nav-text-active-shadow); -} - -#nav-tree .selected .arrow { - color: var(--nav-arrow-selected-color); - text-shadow: none; + position: relative; + background-color: var(--nav-menu-active-bg); + border-radius: 0 6px 6px 0; + /*margin-right: 5px;*/ } #nav-tree img { @@ -48,6 +43,7 @@ margin:0px; padding:0px; font: 12px var(--font-family-nav); + line-height: 22px; } #nav-tree .label a { @@ -56,7 +52,7 @@ #nav-tree .selected a { text-decoration:none; - color:var(--nav-text-active-color); + color:var(--page-link-color); } #nav-tree .children_ul { @@ -65,8 +61,9 @@ } #nav-tree .item { - margin:0px; - padding:0px; + margin: 0 6px 0 -5px; + padding: 0 0 0 5px; + height: 22px; } #nav-tree { @@ -89,7 +86,6 @@ display:block; position: absolute; left: 0px; - width: $width; overflow : hidden; } @@ -98,15 +94,31 @@ } .ui-resizable-e { - background-image:var(--nav-splitbar-image); - background-size:100%; - background-repeat:repeat-y; - background-attachment: scroll; - cursor:ew-resize; + transition: opacity 0.5s ease; + background-color: var(--nav-splitbar-bg-color); + opacity:0; + cursor:col-resize; height:100%; right:0; top:0; width:6px; + position: relative; +} + +.ui-resizable-e:after { + content: ''; + display: block; + top: 50%; + left: 1px; + width: 2px; + height: 15px; + border-left: 1px solid var(--nav-splitbar-handle-color); + border-right: 1px solid var(--nav-splitbar-handle-color); + position: absolute; +} + +.ui-resizable-e:hover { + opacity: 1; } .ui-resizable-handle { @@ -121,24 +133,97 @@ } #nav-tree { - background-repeat:repeat-x; background-color: var(--nav-background-color); -webkit-overflow-scrolling : touch; /* iOS 5+ */ + scrollbar-width: thin; + border-right: 1px solid var(--nav-border-color); + padding-left: 5px; } #nav-sync { position:absolute; - top:5px; - right:24px; - z-index:0; + top:0px; + right:0px; + z-index:1; } #nav-sync img { opacity:0.3; } -#nav-sync img:hover { - opacity:0.9; +div.nav-sync-icon { + position: relative; + width: 24px; + height: 17px; + left: -6px; + top: -1px; + opacity: 0.7; + display: inline-block; + background-color: var(--sync-icon-background-color); + border: 1px solid var(--sync-icon-border-color); + box-sizing: content-box; +} + +div.nav-sync-icon:hover { + background-color: var(--sync-icon-selected-background-color); + opacity: 1.0; +} + +div.nav-sync-icon.active:after { + content: ''; + background-color: var(--sync-icon-background-color); + border-top: 2px solid var(--sync-icon-color); + position: absolute; + width: 16px; + height: 0px; + top: 7px; + left: 4px; +} + +div.nav-sync-icon.active:hover:after { + border-top: 2px solid var(--sync-icon-selected-color); +} + +span.sync-icon-left { + position: absolute; + padding: 0; + margin: 0; + top: 3px; + left: 4px; + display: inline-block; + width: 8px; + height: 8px; + border-left: 2px solid var(--sync-icon-color); + border-top: 2px solid var(--sync-icon-color); + transform: rotate(-45deg); +} + +span.sync-icon-right { + position: absolute; + padding: 0; + margin: 0; + top: 3px; + left: 10px; + display: inline-block; + width: 8px; + height: 8px; + border-right: 2px solid var(--sync-icon-color); + border-bottom: 2px solid var(--sync-icon-color); + transform: rotate(-45deg); +} + +div.nav-sync-icon:hover span.sync-icon-left { + border-left: 2px solid var(--sync-icon-selected-color); + border-top: 2px solid var(--sync-icon-selected-color); +} + +div.nav-sync-icon:hover span.sync-icon-right { + border-right: 2px solid var(--sync-icon-selected-color); + border-bottom: 2px solid var(--sync-icon-selected-color); +} + +#nav-path ul { + border-top: 1px solid var(--nav-breadcrumb-separator-color); } @media print @@ -147,3 +232,96 @@ div.ui-resizable-handle { display: none; position: relative; } } +/*---------------------------*/ +#container { + display: grid; + grid-template-columns: auto auto; + overflow: hidden; +} + +#page-nav { + background: var(--nav-background-color); + display: block; + width: 250px; + box-sizing: content-box; + position: relative; + border-left: 1px solid var(--nav-border-color); +} + +#page-nav-tree { + display: inline-block; +} + +#page-nav-resize-handle { + transition: opacity 0.5s ease; + background-color: var(--nav-splitbar-bg-color); + opacity:0; + cursor:col-resize; + height:100%; + right:0; + top:0; + width:6px; + position: relative; + z-index: 1; + user-select: none; +} + +#page-nav-resize-handle:after { + content: ''; + display: block; + top: 50%; + left: 1px; + width: 2px; + height: 15px; + border-left: 1px solid var(--nav-splitbar-handle-color); + border-right: 1px solid var(--nav-splitbar-handle-color); + position: absolute; +} + +#page-nav-resize-handle.dragging, +#page-nav-resize-handle:hover { + opacity: 1; +} + +#page-nav-contents { + padding: 0; + margin: 0; + display: block; + top: 0; + left: 0; + height: 100%; + width: 100%; + position: absolute; + overflow: auto; + scrollbar-width: thin; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +ul.page-outline, +ul.page-outline ul { + text-indent: 0; + list-style: none outside none; + padding: 0 0 0 4px; +} + +ul.page-outline { + margin: 0 4px 4px 6px; +} + +ul.page-outline div.item { + font: 12px var(--font-family-nav); + line-height: 22px; +} + +ul.page-outline li { + white-space: nowrap; +} + +ul.page-outline li.vis { + background-color: var(--nav-breadcrumb-active-bg); +} + +#container.resizing { + cursor: col-resize; + user-select: none; +} diff --git a/docs/html/other_api_interop.html b/docs/html/other_api_interop.html index bb918d5b..3ff051fe 100644 --- a/docs/html/other_api_interop.html +++ b/docs/html/other_api_interop.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Interop with other graphics APIs - - @@ -33,33 +31,22 @@
    - + -
    -
    Interop with other graphics APIs
    +
    Interop with other graphics APIs
    -

    VMA provides some features that help with interoperability with other graphics APIs, e.g. OpenGL.

    -

    +

    VMA provides some features that help with interoperability with other graphics APIs, e.g. OpenGL, Direct3D 11, Direct3D 12.

    +

    Exporting memory

    -

    If you want to attach VkExportMemoryAllocateInfoKHR or other structure to pNext chain of memory allocations made by the library:

    -

    You can create Custom memory pools for such allocations. Define and fill in your VkExportMemoryAllocateInfoKHR structure and attach it to VmaPoolCreateInfo::pMemoryAllocateNext while creating the custom pool. Please note that the structure must remain alive and unchanged for the whole lifetime of the VmaPool, not only while creating it, as no copy of the structure is made, but its original pointer is used for each allocation instead.

    -

    If you want to export all memory allocated by VMA from certain memory types, also dedicated allocations or other allocations made from default pools, an alternative solution is to fill in VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes. It should point to an array with VkExternalMemoryHandleTypeFlagsKHR to be automatically passed by the library through VkExportMemoryAllocateInfoKHR on each allocation made from a specific memory type. Please note that new versions of the library also support dedicated allocations created in custom pools.

    -

    You should not mix these two methods in a way that allows to apply both to the same memory type. Otherwise, VkExportMemoryAllocateInfoKHR structure would be attached twice to the pNext chain of VkMemoryAllocateInfo.

    -

    -Custom alignment

    -

    Buffers or images exported to a different API like OpenGL may require a different alignment, higher than the one used by the library automatically, queried from functions like vkGetBufferMemoryRequirements. To impose such alignment:

    -

    You can create Custom memory pools for such allocations. Set VmaPoolCreateInfo::minAllocationAlignment member to the minimum alignment required for each allocation to be made out of this pool. The alignment actually used will be the maximum of this member and the alignment returned for the specific buffer or image from a function like vkGetBufferMemoryRequirements, which is called by VMA automatically.

    -

    If you want to create a buffer with a specific minimum alignment out of default pools, use special function vmaCreateBufferWithAlignment(), which takes additional parameter minAlignment.

    -

    Note the problem of alignment affects only resources placed inside bigger VkDeviceMemory blocks and not dedicated allocations, as these, by definition, always have alignment = 0 because the resource is bound to the beginning of its dedicated block. You can ensure that an allocation is created as dedicated by using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Contrary to Direct3D 12, Vulkan doesn't have a concept of alignment of the entire memory block passed on its allocation.

    -

    -Extended allocation information

    -

    If you want to rely on VMA to allocate your buffers and images inside larger memory blocks, but you need to know the size of the entire block and whether the allocation was made with its own dedicated memory, use function vmaGetAllocationInfo2() to retrieve extended allocation information in structure VmaAllocationInfo2.

    +

    On Windows, the VK_KHR_external_memory_win32 device extension allows exporting a Win32 HANDLE of a VkDeviceMemory block, to be able to reference the memory on other Vulkan logical devices or instances, in multiple processes, and/or in multiple APIs. VMA offers support for it.

    +

    +Initialization

    +

    1) Make sure the extension is defined in the code by including following header before including VMA:

    +
    #include <vulkan/vulkan_win32.h>
    +

    2) Check if "VK_KHR_external_memory_win32" is available among device extensions. Enable it when creating the VkDevice object.

    +

    3) Enable the usage of this extension in VMA by setting flag VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT when calling vmaCreateAllocator().

    +

    4) Make sure that VMA has access to the vkGetMemoryWin32HandleKHR function by either enabling VMA_DYNAMIC_VULKAN_FUNCTIONS macro or setting VmaVulkanFunctions::vkGetMemoryWin32HandleKHR explicitly. For more information, see Importing Vulkan functions.

    +

    +Preparations

    +

    You can find example usage among tests, in file "Tests.cpp", function TestWin32Handles().

    +

    To use the extenion, buffers need to be created with VkExternalMemoryBufferCreateInfoKHR attached to their pNext chain, and memory allocations need to be made with VkExportMemoryAllocateInfoKHR attached to their pNext chain. To make use of them, you need to use Custom memory pools. Example:

    +
    constexpr VkExternalMemoryHandleTypeFlagsKHR handleType =
    +
    VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR;
    +
    +
    // Define an example buffer and allocation parameters.
    +
    VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = {
    +
    VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR,
    +
    nullptr,
    +
    handleType
    +
    };
    +
    VkBufferCreateInfo exampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    +
    exampleBufCreateInfo.size = 0x10000; // Doesn't matter here.
    +
    exampleBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
    +
    exampleBufCreateInfo.pNext = &externalMemBufCreateInfo;
    +
    +
    VmaAllocationCreateInfo exampleAllocCreateInfo = {};
    +
    exampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
    +
    +
    // Find memory type index to use for the custom pool.
    +
    uint32_t memTypeIndex;
    +
    VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_Allocator,
    +
    &exampleBufCreateInfo, &exampleAllocCreateInfo, &memTypeIndex);
    +
    // Check res...
    +
    +
    // Create a custom pool.
    +
    constexpr static VkExportMemoryAllocateInfoKHR exportMemAllocInfo = {
    +
    VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR,
    +
    nullptr,
    +
    handleType
    +
    };
    +
    VmaPoolCreateInfo poolCreateInfo = {};
    +
    poolCreateInfo.memoryTypeIndex = memTypeIndex;
    +
    poolCreateInfo.pMemoryAllocateNext = (void*)&exportMemAllocInfo;
    +
    +
    VmaPool pool;
    +
    res = vmaCreatePool(g_Allocator, &poolCreateInfo, &pool);
    +
    // Check res...
    +
    +
    // YOUR OTHER CODE COMES HERE....
    +
    +
    // At the end, don't forget to destroy it!
    +
    vmaDestroyPool(g_Allocator, pool);
    +
    void vmaDestroyPool(VmaAllocator allocator, VmaPool pool)
    Destroys VmaPool object and frees Vulkan device memory.
    +
    VkResult vmaCreatePool(VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
    Allocates Vulkan device memory and creates VmaPool object.
    +
    VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
    Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
    +
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:550
    +
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1291
    +
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1299
    +
    Describes parameter of created VmaPool.
    Definition vk_mem_alloc.h:1342
    +
    uint32_t memoryTypeIndex
    Vulkan memory type index to allocate this pool from.
    Definition vk_mem_alloc.h:1345
    +
    void *VkMemoryAllocateInfo pMemoryAllocateNext
    Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this ...
    Definition vk_mem_alloc.h:1394
    +
    Represents custom memory pool.
    +

    Note that the structure passed as VmaPoolCreateInfo::pMemoryAllocateNext must remain alive and unchanged for the whole lifetime of the custom pool, because it will be used when the pool allocates a new device memory block. No copy is made internally. This is why variable exportMemAllocInfo is defined as static.

    +

    If you want to export all memory allocated by VMA from certain memory types, also dedicated allocations or other allocations made from default pools, an alternative solution is to fill in VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes. It should point to an array with VkExternalMemoryHandleTypeFlagsKHR to be automatically passed by the library through VkExportMemoryAllocateInfoKHR on each allocation made from a specific memory type. You should not mix these two methods in a way that allows to apply both to the same memory type. Otherwise, VkExportMemoryAllocateInfoKHR structure would be attached twice to the pNext chain of VkMemoryAllocateInfo.

    +

    +Memory allocation

    +

    Finally, you can create a buffer with an allocation out of the custom pool. The buffer should use same flags as the sample buffer used to find the memory type. It should also specify VkExternalMemoryBufferCreateInfoKHR in its pNext chain.

    +
    VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = {
    +
    VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR,
    +
    nullptr,
    +
    handleType
    +
    };
    +
    VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    +
    bufCreateInfo.size = // Your desired buffer size.
    +
    bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
    +
    bufCreateInfo.pNext = &externalMemBufCreateInfo;
    +
    +
    VmaAllocationCreateInfo allocCreateInfo = {};
    +
    allocCreateInfo.pool = pool; // It is enough to set this one member.
    +
    +
    VkBuffer buf;
    + +
    res = vmaCreateBuffer(g_Allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr);
    +
    // Check res...
    +
    +
    // YOUR OTHER CODE COMES HERE....
    +
    +
    // At the end, don't forget to destroy it!
    +
    vmaDestroyBuffer(g_Allocator, buf, alloc);
    +
    void vmaDestroyBuffer(VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
    Destroys Vulkan buffer and frees allocated memory.
    +
    VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    Creates a new VkBuffer, allocates and binds memory for it.
    +
    VmaPool pool
    Pool that this allocation should be created in.
    Definition vk_mem_alloc.h:1323
    +
    Represents single memory allocation.
    +

    If you need each allocation to have its own device memory block and start at offset 0, you can still do by using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag. It works also with custom pools.

    +

    +Exporting Win32 handle

    +

    After the allocation is created, you can acquire a Win32 HANDLE to the VkDeviceMemory block it belongs to. VMA function vmaGetMemoryWin32Handle2() is a replacement of the Vulkan function vkGetMemoryWin32HandleKHR.

    +
    HANDLE handle;
    +
    res = vmaGetMemoryWin32Handle2(g_Allocator, alloc, handleType, nullptr, &handle);
    +
    // Check res...
    +
    +
    // YOUR OTHER CODE COMES HERE....
    +
    +
    // At the end, you must close the handle.
    +
    CloseHandle(handle);
    +
    VkResult vmaGetMemoryWin32Handle2(VmaAllocator allocator, VmaAllocation allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE *pHandle)
    Given an allocation, returns Win32 handle that may be imported by other processes or APIs.
    +

    Documentation of the VK_KHR_external_memory_win32 extension states that:

    +
    +

    If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.

    +
    +

    This is ensured automatically inside VMA. If VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT is used as the handle type, the library fetches the handle on first use, remembers it internally, and closes it when the memory block or dedicated allocation is destroyed. Every time you call vmaGetMemoryWin32Handle2(), VMA calls DuplicateHandle and returns a new handle that you need to close. For further information, please check the documentation of this function.

    +

    +Custom alignment

    +

    Buffers or images exported to a different API like OpenGL may require a different alignment, higher than the one used by the library automatically, queried from functions like vkGetBufferMemoryRequirements. To impose such alignment:

    +

    You can create Custom memory pools for such allocations. Set VmaPoolCreateInfo::minAllocationAlignment member to the minimum alignment required for each allocation to be made out of this pool. The alignment actually used will be the maximum of this member and the alignment returned for the specific buffer or image from a function like vkGetBufferMemoryRequirements, which is called by VMA automatically.

    +

    If you want to create a buffer with a specific minimum alignment out of default pools, you can use special function vmaCreateBufferWithAlignment(), which takes additional parameter minAlignment.

    +

    Note the problem of alignment affects only resources placed inside bigger VkDeviceMemory blocks and not dedicated allocations, as these, by definition, always have alignment = 0 because the resource is bound to the beginning of its dedicated block. You can ensure that an allocation is created as dedicated by using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Contrary to Direct3D 12, Vulkan doesn't have a concept of alignment of the entire memory block passed on its allocation.

    +

    +Extended allocation information

    +

    If you want to rely on VMA to allocate your buffers and images inside larger memory blocks, but you need to know the size of the entire block and whether the allocation was made with its own dedicated memory, use function vmaGetAllocationInfo2() to retrieve extended allocation information in structure VmaAllocationInfo2, which provides extra members: blockSize and dedicatedMemory.

    diff --git a/docs/html/pages.html b/docs/html/pages.html index 154dc70d..a32f44bd 100644 --- a/docs/html/pages.html +++ b/docs/html/pages.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Related Pages - - @@ -33,35 +31,24 @@
    - +
    -
    diff --git a/docs/html/quick_start.html b/docs/html/quick_start.html index 64fa9d4a..044fa469 100644 --- a/docs/html/quick_start.html +++ b/docs/html/quick_start.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Quick start - - @@ -33,33 +31,22 @@
    - + -
    -
    Quick start
    +
    Quick start
    -

    +

    Project setup

    Vulkan Memory Allocator comes in form of a "stb-style" single header file. While you can pull the entire repository e.g. as Git module, there is also Cmake script provided, you don't need to build it as a separate library project. You can add file "vk_mem_alloc.h" directly to your project and submit it to code repository next to your other source files.

    "Single header" doesn't mean that everything is contained in C/C++ declarations, like it tends to be in case of inline functions or C++ templates. It means that implementation is bundled with interface in a single file and needs to be extracted using preprocessor macro. If you don't do it properly, it will result in linker errors.

    @@ -104,75 +91,75 @@
    #include "vk_mem_alloc.h"

    It may be a good idea to create dedicated CPP file just for this purpose, e.g. "VmaUsage.cpp".

    -

    This library includes header <vulkan/vulkan.h>, which in turn includes <windows.h> on Windows. If you need some specific macros defined before including these headers (like WIN32_LEAN_AND_MEAN or WINVER for Windows, VK_USE_PLATFORM_WIN32_KHR for Vulkan), you must define them before every #include of this library. It may be a good idea to create a dedicate header file for this purpose, e.g. "VmaUsage.h", that will be included in other source files instead of VMA header directly.

    -

    This library is written in C++, but has C-compatible interface. Thus, you can include and use "vk_mem_alloc.h" in C or C++ code, but full implementation with VMA_IMPLEMENTATION macro must be compiled as C++, NOT as C. Some features of C++14 are used and required. Features of C++20 are used optionally when available. Some headers of standard C and C++ library are used, but STL containers, RTTI, or C++ exceptions are not used.

    -

    +

    This library includes header <vulkan/vulkan.h>, which in turn includes <windows.h> on Windows. If you need some specific macros defined before including these headers (like WIN32_LEAN_AND_MEAN or WINVER for Windows, VK_USE_PLATFORM_WIN32_KHR for Vulkan), you must define them before every #include of this library. It may be a good idea to create a dedicate header file for this purpose, e.g. "VmaUsage.h", that will be included in other source files instead of VMA header directly.

    +

    This library is written in C++, but has C-compatible interface. Thus, you can include and use "vk_mem_alloc.h" in C or C++ code, but full implementation with VMA_IMPLEMENTATION macro must be compiled as C++, NOT as C. Some features of C++14 are used and required. Features of C++20 are used optionally when available. Some headers of standard C and C++ library are used, but STL containers, RTTI, or C++ exceptions are not used.

    +

    Initialization

    -

    VMA offers library interface in a style similar to Vulkan, with object handles like VmaAllocation, structures describing parameters of objects to be created like VmaAllocationCreateInfo, and errors codes returned from functions using VkResult type.

    -

    The first and the main object that needs to be created is VmaAllocator. It represents the initialization of the entire library. Only one such object should be created per VkDevice. You should create it at program startup, after VkDevice was created, and before any device memory allocator needs to be made. It must be destroyed before VkDevice is destroyed.

    +

    VMA offers library interface in a style similar to Vulkan, with object handles like VmaAllocation, structures describing parameters of objects to be created like VmaAllocationCreateInfo, and errors codes returned from functions using VkResult type.

    +

    The first and the main object that needs to be created is VmaAllocator. It represents the initialization of the entire library. Only one such object should be created per VkDevice. You should create it at program startup, after VkDevice was created, and before any device memory allocator needs to be made. It must be destroyed before VkDevice is destroyed.

    At program startup:

      -
    1. Initialize Vulkan to have VkInstance, VkPhysicalDevice, VkDevice object.
    2. +
    3. Initialize Vulkan to have VkInstance, VkPhysicalDevice, VkDevice object.
    4. Fill VmaAllocatorCreateInfo structure and call vmaCreateAllocator() to create VmaAllocator object.
    -

    Only members physicalDevice, device, instance are required. However, you should inform the library which Vulkan version do you use by setting VmaAllocatorCreateInfo::vulkanApiVersion and which extensions did you enable by setting VmaAllocatorCreateInfo::flags. Otherwise, VMA would use only features of Vulkan 1.0 core with no extensions. See below for details.

    -

    +

    Only members physicalDevice, device, instance are required. However, you should inform the library which Vulkan version do you use by setting VmaAllocatorCreateInfo::vulkanApiVersion and which extensions did you enable by setting VmaAllocatorCreateInfo::flags. Otherwise, VMA would use only features of Vulkan 1.0 core with no extensions. See below for details.

    +

    Selecting Vulkan version

    VMA supports Vulkan version down to 1.0, for backward compatibility. If you want to use higher version, you need to inform the library about it. This is a two-step process.

    -

    Step 1: Compile time. By default, VMA compiles with code supporting the highest Vulkan version found in the included <vulkan/vulkan.h> that is also supported by the library. If this is OK, you don't need to do anything. However, if you want to compile VMA as if only some lower Vulkan version was available, define macro VMA_VULKAN_VERSION before every #include "vk_mem_alloc.h". It should have decimal numeric value in form of ABBBCCC, where A = major, BBB = minor, CCC = patch Vulkan version. For example, to compile against Vulkan 1.2:

    +

    Step 1: Compile time. By default, VMA compiles with code supporting the highest Vulkan version found in the included <vulkan/vulkan.h> that is also supported by the library. If this is OK, you don't need to do anything. However, if you want to compile VMA as if only some lower Vulkan version was available, define macro VMA_VULKAN_VERSION before every #include "vk_mem_alloc.h". It should have decimal numeric value in form of ABBBCCC, where A = major, BBB = minor, CCC = patch Vulkan version. For example, to compile against Vulkan 1.2:

    #define VMA_VULKAN_VERSION 1002000 // Vulkan 1.2
    #include "vk_mem_alloc.h"
    -

    Step 2: Runtime. Even when compiled with higher Vulkan version available, VMA can use only features of a lower version, which is configurable during creation of the VmaAllocator object. By default, only Vulkan 1.0 is used. To initialize the allocator with support for higher Vulkan version, you need to set member VmaAllocatorCreateInfo::vulkanApiVersion to an appropriate value, e.g. using constants like VK_API_VERSION_1_2. See code sample below.

    -

    +

    Step 2: Runtime. Even when compiled with higher Vulkan version available, VMA can use only features of a lower version, which is configurable during creation of the VmaAllocator object. By default, only Vulkan 1.0 is used. To initialize the allocator with support for higher Vulkan version, you need to set member VmaAllocatorCreateInfo::vulkanApiVersion to an appropriate value, e.g. using constants like VK_API_VERSION_1_2. See code sample below.

    +

    Importing Vulkan functions

    You may need to configure importing Vulkan functions. There are 4 ways to do this:

    1. If you link with Vulkan static library (e.g. "vulkan-1.lib" on Windows):
      • You don't need to do anything.
      • -
      • VMA will use these, as macro VMA_STATIC_VULKAN_FUNCTIONS is defined to 1 by default.
      • +
      • VMA will use these, as macro VMA_STATIC_VULKAN_FUNCTIONS is defined to 1 by default.
    2. -
    3. If you want VMA to fetch pointers to Vulkan functions dynamically using vkGetInstanceProcAddr, vkGetDeviceProcAddr (this is the option presented in the example below):
        -
      • Define VMA_STATIC_VULKAN_FUNCTIONS to 0, VMA_DYNAMIC_VULKAN_FUNCTIONS to 1.
      • +
      • If you want VMA to fetch pointers to Vulkan functions dynamically using vkGetInstanceProcAddr, vkGetDeviceProcAddr (this is the option presented in the example below):
      • If you fetch pointers to all Vulkan functions in a custom way:
          -
        • Define VMA_STATIC_VULKAN_FUNCTIONS and VMA_DYNAMIC_VULKAN_FUNCTIONS to 0.
        • +
        • Define VMA_STATIC_VULKAN_FUNCTIONS and VMA_DYNAMIC_VULKAN_FUNCTIONS to 0.
        • Pass these pointers via structure VmaVulkanFunctions.
      • If you use volk library:
          -
        • Define VMA_STATIC_VULKAN_FUNCTIONS and VMA_DYNAMIC_VULKAN_FUNCTIONS to 0.
        • +
        • Define VMA_STATIC_VULKAN_FUNCTIONS and VMA_DYNAMIC_VULKAN_FUNCTIONS to 0.
        • Use function vmaImportVulkanFunctionsFromVolk() to fill in the structure VmaVulkanFunctions. For more information, see the description of this function.
    -

    +

    Enabling extensions

    -

    VMA can automatically use following Vulkan extensions. If you found them available on the selected physical device and you enabled them while creating VkInstance / VkDevice object, inform VMA about their availability by setting appropriate flags in VmaAllocatorCreateInfo::flags.

    +

    VMA can automatically use following Vulkan extensions. If you found them available on the selected physical device and you enabled them while creating VkInstance / VkDevice object, inform VMA about their availability by setting appropriate flags in VmaAllocatorCreateInfo::flags.

    - + - + - + - + - + - + - + - + - + - +
    Vulkan extension VMA flag
    Vulkan extension VMA flag
    VK_KHR_dedicated_allocation VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT
    VK_KHR_dedicated_allocation VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT
    VK_KHR_bind_memory2 VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT
    VK_KHR_bind_memory2 VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT
    VK_KHR_maintenance4 VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT
    VK_KHR_maintenance4 VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT
    VK_KHR_maintenance5 VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT
    VK_KHR_maintenance5 VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT
    VK_EXT_memory_budget VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT
    VK_EXT_memory_budget VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT
    VK_KHR_buffer_device_address VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT
    VK_KHR_buffer_device_address VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT
    VK_EXT_memory_priority VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT
    VK_EXT_memory_priority VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT
    VK_AMD_device_coherent_memory VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT
    VK_AMD_device_coherent_memory VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT
    VK_KHR_external_memory_win32 VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT
    VK_KHR_external_memory_win32 VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT

    Example with fetching pointers to Vulkan functions dynamically:

    #define VMA_STATIC_VULKAN_FUNCTIONS 0
    @@ -211,16 +198,16 @@

    VkDevice device
    Vulkan device.
    Definition vk_mem_alloc.h:1076
    uint32_t vulkanApiVersion
    Optional. Vulkan version that the application uses.
    Definition vk_mem_alloc.h:1132
    Represents main object of this library initialized.
    -

    +

    Other configuration options

    -

    There are additional configuration options available through preprocessor macros that you can define before including VMA header and through parameters passed in VmaAllocatorCreateInfo. They include a possibility to use your own callbacks for host memory allocations (VkAllocationCallbacks), callbacks for device memory allocations (instead of vkAllocateMemory, vkFreeMemory), or your custom VMA_ASSERT macro, among others. For more information, see: Configuration.

    -

    +

    There are additional configuration options available through preprocessor macros that you can define before including VMA header and through parameters passed in VmaAllocatorCreateInfo. They include a possibility to use your own callbacks for host memory allocations (VkAllocationCallbacks), callbacks for device memory allocations (instead of vkAllocateMemory, vkFreeMemory), or your custom VMA_ASSERT macro, among others. For more information, see: Configuration.

    +

    Resource allocation

    When you want to create a buffer or image:

      -
    1. Fill VkBufferCreateInfo / VkImageCreateInfo structure.
    2. +
    3. Fill VkBufferCreateInfo / VkImageCreateInfo structure.
    4. Fill VmaAllocationCreateInfo structure.
    5. -
    6. Call vmaCreateBuffer() / vmaCreateImage() to get VkBuffer/VkImage with memory already allocated and bound to it, plus VmaAllocation objects that represents its underlying memory.
    7. +
    8. Call vmaCreateBuffer() / vmaCreateImage() to get VkBuffer/VkImage with memory already allocated and bound to it, plus VmaAllocation objects that represents its underlying memory.
    VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    bufferInfo.size = 65536;
    @@ -245,7 +232,7 @@

    diff --git a/docs/html/resource_aliasing.html b/docs/html/resource_aliasing.html index 275ac4e3..126cf28f 100644 --- a/docs/html/resource_aliasing.html +++ b/docs/html/resource_aliasing.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Resource aliasing (overlap) - - @@ -33,33 +31,22 @@
    - + -
    -
    Resource aliasing (overlap)
    +
    Resource aliasing (overlap)

    New explicit graphics APIs (Vulkan and Direct3D 12), thanks to manual memory management, give an opportunity to alias (overlap) multiple resources in the same region of memory - a feature not available in the old APIs (Direct3D 11, OpenGL). It can be useful to save video memory, but it must be used with caution.

    @@ -165,19 +152,19 @@
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1291
    VkMemoryPropertyFlags preferredFlags
    Flags that preferably should be set in a memory type chosen for an allocation.
    Definition vk_mem_alloc.h:1309
    Represents single memory allocation.
    -

    VMA also provides convenience functions that create a buffer or image and bind it to memory represented by an existing VmaAllocation: vmaCreateAliasingBuffer(), vmaCreateAliasingBuffer2(), vmaCreateAliasingImage(), vmaCreateAliasingImage2(). Versions with "2" offer additional parameter allocationLocalOffset.

    -

    Remember that using resources that alias in memory requires proper synchronization. You need to issue a memory barrier to make sure commands that use img1 and img2 don't overlap on GPU timeline. You also need to treat a resource after aliasing as uninitialized - containing garbage data. For example, if you use img1 and then want to use img2, you need to issue an image memory barrier for img2 with oldLayout = VK_IMAGE_LAYOUT_UNDEFINED.

    +

    VMA also provides convenience functions that create a buffer or image and bind it to memory represented by an existing VmaAllocation: vmaCreateAliasingBuffer(), vmaCreateAliasingBuffer2(), vmaCreateAliasingImage(), vmaCreateAliasingImage2(). Versions with "2" offer additional parameter allocationLocalOffset.

    +

    Remember that using resources that alias in memory requires proper synchronization. You need to issue a memory barrier to make sure commands that use img1 and img2 don't overlap on GPU timeline. You also need to treat a resource after aliasing as uninitialized - containing garbage data. For example, if you use img1 and then want to use img2, you need to issue an image memory barrier for img2 with oldLayout = VK_IMAGE_LAYOUT_UNDEFINED.

    Additional considerations:

      -
    • Vulkan also allows to interpret contents of memory between aliasing resources consistently in some cases. See chapter 11.8. "Memory Aliasing" of Vulkan specification or VK_IMAGE_CREATE_ALIAS_BIT flag.
    • +
    • Vulkan also allows to interpret contents of memory between aliasing resources consistently in some cases. See chapter 11.8. "Memory Aliasing" of Vulkan specification or VK_IMAGE_CREATE_ALIAS_BIT flag.
    • You can create more complex layout where different images and buffers are bound at different offsets inside one large allocation. For example, one can imagine a big texture used in some render passes, aliasing with a set of many small buffers used between in some further passes. To bind a resource at non-zero offset in an allocation, use vmaBindBufferMemory2() / vmaBindImageMemory2().
    • -
    • Before allocating memory for the resources you want to alias, check memoryTypeBits returned in memory requirements of each resource to make sure the bits overlap. Some GPUs may expose multiple memory types suitable e.g. only for buffers or images with COLOR_ATTACHMENT usage, so the sets of memory types supported by your resources may be disjoint. Aliasing them is not possible in that case.
    • +
    • Before allocating memory for the resources you want to alias, check memoryTypeBits returned in memory requirements of each resource to make sure the bits overlap. Some GPUs may expose multiple memory types suitable e.g. only for buffers or images with COLOR_ATTACHMENT usage, so the sets of memory types supported by your resources may be disjoint. Aliasing them is not possible in that case.
    diff --git a/docs/html/search/all_0.js b/docs/html/search/all_0.js index e87544b5..3d751453 100644 --- a/docs/html/search/all_0.js +++ b/docs/html/search/all_0.js @@ -5,13 +5,13 @@ var searchData= ['advanced_20data_20uploading_2',['Advanced data uploading',['../usage_patterns.html#usage_patterns_advanced_data_uploading',1,'']]], ['algorithm_3',['algorithm',['../general_considerations.html#general_considerations_allocation_algorithm',1,'Allocation algorithm'],['../custom_memory_pools.html#linear_algorithm',1,'Linear allocation algorithm']]], ['aliasing_20overlap_4',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]], - ['alignment_5',['alignment',['../struct_vma_virtual_allocation_create_info.html#a9d19709872fc1904a105079e1c885821',1,'VmaVirtualAllocationCreateInfo::alignment'],['../other_api_interop.html#opengl_interop_custom_alignment',1,'Custom alignment']]], + ['alignment_5',['alignment',['../struct_vma_virtual_allocation_create_info.html#a9d19709872fc1904a105079e1c885821',1,'VmaVirtualAllocationCreateInfo::alignment'],['../other_api_interop.html#other_api_interop_exporting_custom_alignment',1,'Custom alignment']]], ['alignment_20and_20units_6',['Alignment and units',['../virtual_allocator.html#virtual_allocator_alignment_and_units',1,'']]], - ['allocation_7',['allocation',['../group__group__alloc.html',1,'Memory allocation'],['../vk_khr_external_memory_win32.html#vk_khr_external_memory_win32_memory_allocation',1,'Memory allocation'],['../quick_start.html#quick_start_resource_allocation',1,'Resource allocation']]], + ['allocation_7',['allocation',['../group__group__alloc.html',1,'Memory allocation'],['../other_api_interop.html#other_api_interop_exporting_memory_allocation',1,'Memory allocation'],['../quick_start.html#quick_start_resource_allocation',1,'Resource allocation']]], ['allocation_20algorithm_8',['Allocation algorithm',['../general_considerations.html#general_considerations_allocation_algorithm',1,'']]], ['allocation_20algorithm_9',['Linear allocation algorithm',['../custom_memory_pools.html#linear_algorithm',1,'']]], ['allocation_20callbacks_10',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]], - ['allocation_20information_11',['Extended allocation information',['../other_api_interop.html#opengl_interop_extended_allocation_information',1,'']]], + ['allocation_20information_11',['Extended allocation information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'']]], ['allocation_20names_12',['Allocation names',['../allocation_annotation.html#allocation_names',1,'']]], ['allocation_20names_20and_20user_20data_13',['Allocation names and user data',['../allocation_annotation.html',1,'index']]], ['allocation_20parameters_14',['Allocation parameters',['../virtual_allocator.html#virtual_allocator_allocation_parameters',1,'']]], diff --git a/docs/html/search/all_14.js b/docs/html/search/all_14.js index bb614caf..3248dcb9 100644 --- a/docs/html/search/all_14.js +++ b/docs/html/search/all_14.js @@ -9,173 +9,173 @@ var searchData= ['vk_5famd_5fdevice_5fcoherent_5fmemory_6',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]], ['vk_5fext_5fmemory_5fpriority_7',['VK_EXT_memory_priority',['../vk_ext_memory_priority.html',1,'index']]], ['vk_5fkhr_5fdedicated_5fallocation_8',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]], - ['vk_5fkhr_5fexternal_5fmemory_5fwin32_9',['VK_KHR_external_memory_win32',['../vk_khr_external_memory_win32.html',1,'index']]], - ['vk_5fmem_5falloc_2eh_10',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]], - ['vkallocatememory_11',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]], - ['vkbindbuffermemory_12',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]], - ['vkbindbuffermemory2khr_13',['vkBindBufferMemory2KHR',['../struct_vma_vulkan_functions.html#a0c4907235aab9df2767b79836afa2dc9',1,'VmaVulkanFunctions']]], - ['vkbindimagememory_14',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]], - ['vkbindimagememory2khr_15',['vkBindImageMemory2KHR',['../struct_vma_vulkan_functions.html#ab95aaa73ab8a3fe9fd3daaaec4e0b2bf',1,'VmaVulkanFunctions']]], - ['vkcmdcopybuffer_16',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]], - ['vkcreatebuffer_17',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]], - ['vkcreateimage_18',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]], - ['vkdestroybuffer_19',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]], - ['vkdestroyimage_20',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]], - ['vkflushmappedmemoryranges_21',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]], - ['vkfreememory_22',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]], - ['vkgetbuffermemoryrequirements_23',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]], - ['vkgetbuffermemoryrequirements2khr_24',['vkGetBufferMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9d8d1b05d2b1e7e1d9b27f6f585acf9c',1,'VmaVulkanFunctions']]], - ['vkgetdevicebuffermemoryrequirements_25',['vkGetDeviceBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#ab25228053223e8a4dcd062574beed88d',1,'VmaVulkanFunctions']]], - ['vkgetdeviceimagememoryrequirements_26',['vkGetDeviceImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a10a9bf098a46640fa0a75f1c5fd80b9a',1,'VmaVulkanFunctions']]], - ['vkgetdeviceprocaddr_27',['vkGetDeviceProcAddr',['../struct_vma_vulkan_functions.html#ac383ab9af127e5e136622fa4ebea9e57',1,'VmaVulkanFunctions']]], - ['vkgetimagememoryrequirements_28',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]], - ['vkgetimagememoryrequirements2khr_29',['vkGetImageMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9cdcdc1e2b2ea7c571f7d27e30ba6875',1,'VmaVulkanFunctions']]], - ['vkgetinstanceprocaddr_30',['vkGetInstanceProcAddr',['../struct_vma_vulkan_functions.html#a3eafa102f5f8915f093f40675636b849',1,'VmaVulkanFunctions']]], - ['vkgetmemorywin32handlekhr_31',['vkGetMemoryWin32HandleKHR',['../struct_vma_vulkan_functions.html#af45d10a2b47971f4cf5bcacf1d331f86',1,'VmaVulkanFunctions']]], - ['vkgetphysicaldevicememoryproperties_32',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]], - ['vkgetphysicaldevicememoryproperties2khr_33',['vkGetPhysicalDeviceMemoryProperties2KHR',['../struct_vma_vulkan_functions.html#a0d992896e6ffcf92b9d7ea049fa5c445',1,'VmaVulkanFunctions']]], - ['vkgetphysicaldeviceproperties_34',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]], - ['vkinvalidatemappedmemoryranges_35',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]], - ['vkmapmemory_36',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]], - ['vkunmapmemory_37',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]], - ['vma_5fallocation_5fcreate_5fcan_5falias_5fbit_38',['VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597afb0ee060cd733aaa5e249704ff589ad6',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fdedicated_5fmemory_5fbit_39',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_40',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_41',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fhost_5faccess_5fallow_5ftransfer_5finstead_5fbit_42',['VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a11337f96eacf34c1016c339eac165cad',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fhost_5faccess_5frandom_5fbit_43',['VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597add61238d98e20917b9a06c617763f492',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fhost_5faccess_5fsequential_5fwrite_5fbit_44',['VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a9be224df3bfc1cfa06203aed689a30c5',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fmapped_5fbit_45',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_46',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_47',['VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a839826775c62319466441f86496f036d',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fstrategy_5ffirst_5ffit_5fbit_48',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fstrategy_5fmask_49',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_50',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a8af1210cf591784afa026d94998f735d',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5foffset_5fbit_51',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a8099acedc0d04cdccaaddcfe37fd227d',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_52',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a0729e932b7ea170e3a128cad96c5cf6d',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_53',['VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a42ba3a2d2c7117953210b7c3ef8da0df',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fuser_5fdata_5fcopy_5fstring_5fbit_54',['VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fwithin_5fbudget_5fbit_55',['VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5famd_5fdevice_5fcoherent_5fmemory_5fbit_56',['VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca2acce4886d8078552efa38878413970f',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fbuffer_5fdevice_5faddress_5fbit_57',['VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca5f1b28b0414319d1687e1f2b30ab0089',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fext_5fmemory_5fbudget_5fbit_58',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca4d4687863f7bd4b418c6006dc04400b0',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fext_5fmemory_5fpriority_5fbit_59',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_60',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_61',['VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7cae4d5ad929caba5f23eb502b13bd5286c',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fkhr_5fbind_5fmemory2_5fbit_62',['VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca8fb75bf07cd184ab903596295e863dee',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fkhr_5fdedicated_5fallocation_5fbit_63',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fkhr_5fexternal_5fmemory_5fwin32_5fbit_64',['VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca4897d1181a186e327f4dadd680ad00ac',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fkhr_5fmaintenance4_5fbit_65',['VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7caa2566e7f75e19ae7ec9c4fa509fea5fb',1,'vk_mem_alloc.h']]], - ['vma_5fallocator_5fcreate_5fkhr_5fmaintenance5_5fbit_66',['VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7caca82d4ce40bdb59d3da52a539c21d6b8',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fflag_5falgorithm_5fbalanced_5fbit_67',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50caec35a4138111605a6ff32ca61aa871b6',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fflag_5falgorithm_5fextensive_5fbit_68',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50cae45a9469e5337731627758671741e412',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fflag_5falgorithm_5ffast_5fbit_69',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50ca2e6469bcf5a094776ceb5d118263f04b',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fflag_5falgorithm_5ffull_5fbit_70',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50cafa162eac5be800bcdd4011427a71156d',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fflag_5falgorithm_5fmask_71',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_MASK',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50cabcbbdb3bfd53c4c3ab4eaeb5fd4894e9',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_72',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fmove_5foperation_5fcopy_73',['VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY',['../group__group__alloc.html#ggada9e3861caf96f08894b0bcc160ec257ad4a06ac46c4cb1c67b0ebc1edfab9f18',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fmove_5foperation_5fdestroy_74',['VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY',['../group__group__alloc.html#ggada9e3861caf96f08894b0bcc160ec257a9786f8492a9be2c03bd26395e352ab85',1,'vk_mem_alloc.h']]], - ['vma_5fdefragmentation_5fmove_5foperation_5fignore_75',['VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE',['../group__group__alloc.html#ggada9e3861caf96f08894b0bcc160ec257ad25bc6f816b226b4fd5170e845f218d2',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fauto_76',['VMA_MEMORY_USAGE_AUTO',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca27cde9026a84d34d525777baa41fce6e',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fauto_5fprefer_5fdevice_77',['VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305ccae2adb696d6a73c18bb20c23666661327',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fauto_5fprefer_5fhost_78',['VMA_MEMORY_USAGE_AUTO_PREFER_HOST',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca9b422585242160b8ed3418310ee6664d',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fcpu_5fcopy_79',['VMA_MEMORY_USAGE_CPU_COPY',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fcpu_5fonly_80',['VMA_MEMORY_USAGE_CPU_ONLY',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_81',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_82',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fgpu_5fonly_83',['VMA_MEMORY_USAGE_GPU_ONLY',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_84',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5fmax_5fenum_85',['VMA_MEMORY_USAGE_MAX_ENUM',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]], - ['vma_5fmemory_5fusage_5funknown_86',['VMA_MEMORY_USAGE_UNKNOWN',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]], - ['vma_5fpool_5fcreate_5falgorithm_5fmask_87',['VMA_POOL_CREATE_ALGORITHM_MASK',['../group__group__alloc.html#gga9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]], - ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_88',['VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__alloc.html#gga9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec',1,'vk_mem_alloc.h']]], - ['vma_5fpool_5fcreate_5fignore_5fbuffer_5fimage_5fgranularity_5fbit_89',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../group__group__alloc.html#gga9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]], - ['vma_5fpool_5fcreate_5flinear_5falgorithm_5fbit_90',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../group__group__alloc.html#gga9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_91',['VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmask_92',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_93',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6ae2a9591a62b5e3b1bdcbc81c6188a1bf',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5foffset_5fbit_94',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6a3bb82d2aedd587a64846a1d7778852e6',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_95',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6a562d10a46012719d33167d3dc5dbbf9b',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fupper_5faddress_5fbit_96',['VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6a9524a329a55b5ec390d57d90b67ad78e',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fblock_5fcreate_5falgorithm_5fmask_97',['VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaaf9487467136e1a9e371894dc3a7c4844',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fblock_5fcreate_5fflag_5fbits_5fmax_5fenum_98',['VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaa5fc0d333c3d5687a8bbf57df9b377a87',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fblock_5fcreate_5flinear_5falgorithm_5fbit_99',['VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96',1,'vk_mem_alloc.h']]], - ['vmaallocatememory_100',['vmaAllocateMemory',['../group__group__alloc.html#gabf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]], - ['vmaallocatememoryforbuffer_101',['vmaAllocateMemoryForBuffer',['../group__group__alloc.html#ga7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]], - ['vmaallocatememoryforimage_102',['vmaAllocateMemoryForImage',['../group__group__alloc.html#ga0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]], - ['vmaallocatememorypages_103',['vmaAllocateMemoryPages',['../group__group__alloc.html#gad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]], - ['vmaallocation_104',['VmaAllocation',['../struct_vma_allocation.html',1,'']]], - ['vmaallocationcreateflagbits_105',['VmaAllocationCreateFlagBits',['../group__group__alloc.html#gad9889c10c798b040d59c92f257cae597',1,'VmaAllocationCreateFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga4fceecc301f4064dc808d3cd6c038941',1,'VmaAllocationCreateFlagBits: vk_mem_alloc.h']]], - ['vmaallocationcreateflags_106',['VmaAllocationCreateFlags',['../group__group__alloc.html#ga5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]], - ['vmaallocationcreateinfo_107',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../group__group__alloc.html#ga3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo: vk_mem_alloc.h']]], - ['vmaallocationinfo_108',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../group__group__alloc.html#ga1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo: vk_mem_alloc.h']]], - ['vmaallocationinfo2_109',['VmaAllocationInfo2',['../struct_vma_allocation_info2.html',1,'VmaAllocationInfo2'],['../group__group__alloc.html#ga25ede29f830f326b8572a18ce879bf64',1,'VmaAllocationInfo2: vk_mem_alloc.h']]], - ['vmaallocator_110',['VmaAllocator',['../struct_vma_allocator.html',1,'']]], - ['vmaallocatorcreateflagbits_111',['VmaAllocatorCreateFlagBits',['../group__group__init.html#ga4f87c9100d154a65a4ad495f7763cf7c',1,'VmaAllocatorCreateFlagBits: vk_mem_alloc.h'],['../group__group__init.html#gafd73b95e737ee7e76f827cb5472f559f',1,'VmaAllocatorCreateFlagBits: vk_mem_alloc.h']]], - ['vmaallocatorcreateflags_112',['VmaAllocatorCreateFlags',['../group__group__init.html#gacfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]], - ['vmaallocatorcreateinfo_113',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../group__group__init.html#gaad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo: vk_mem_alloc.h']]], - ['vmaallocatorinfo_114',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../group__group__init.html#ga1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo: vk_mem_alloc.h']]], - ['vmabegindefragmentation_115',['vmaBeginDefragmentation',['../group__group__alloc.html#gac3335566858b45541fa9c0d7a6bbb57e',1,'vk_mem_alloc.h']]], - ['vmabegindefragmentationpass_116',['vmaBeginDefragmentationPass',['../group__group__alloc.html#ga980d7da2ce3b1fd5c8b8476bc362cc00',1,'vk_mem_alloc.h']]], - ['vmabindbuffermemory_117',['vmaBindBufferMemory',['../group__group__alloc.html#ga6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]], - ['vmabindbuffermemory2_118',['vmaBindBufferMemory2',['../group__group__alloc.html#ga861f4f27189a7d11ab9d9eedc825cb6b',1,'vk_mem_alloc.h']]], - ['vmabindimagememory_119',['vmaBindImageMemory',['../group__group__alloc.html#ga3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]], - ['vmabindimagememory2_120',['vmaBindImageMemory2',['../group__group__alloc.html#ga5f3502dd7d38b53fb1533ea3921d038d',1,'vk_mem_alloc.h']]], - ['vmabudget_121',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../group__group__stats.html#gaa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget: vk_mem_alloc.h']]], - ['vmabuildstatsstring_122',['vmaBuildStatsString',['../group__group__stats.html#gaa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]], - ['vmabuildvirtualblockstatsstring_123',['vmaBuildVirtualBlockStatsString',['../group__group__stats.html#ga52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]], - ['vmacalculatepoolstatistics_124',['vmaCalculatePoolStatistics',['../group__group__stats.html#ga50ba0eb25d2b363b792be4645ca7a380',1,'vk_mem_alloc.h']]], - ['vmacalculatestatistics_125',['vmaCalculateStatistics',['../group__group__stats.html#ga36f3484de7aa6cd6edc4de9edfa0ff59',1,'vk_mem_alloc.h']]], - ['vmacalculatevirtualblockstatistics_126',['vmaCalculateVirtualBlockStatistics',['../group__group__virtual.html#ga93c5741bca44b43e5b849cacbd616098',1,'vk_mem_alloc.h']]], - ['vmacheckcorruption_127',['vmaCheckCorruption',['../group__group__alloc.html#ga49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]], - ['vmacheckpoolcorruption_128',['vmaCheckPoolCorruption',['../group__group__alloc.html#gad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]], - ['vmaclearvirtualblock_129',['vmaClearVirtualBlock',['../group__group__virtual.html#ga5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]], - ['vmacopyallocationtomemory_130',['vmaCopyAllocationToMemory',['../group__group__alloc.html#gaac883dd38863944335071213b9ae8477',1,'vk_mem_alloc.h']]], - ['vmacopymemorytoallocation_131',['vmaCopyMemoryToAllocation',['../group__group__alloc.html#ga11731ec58a3a43a22bb925e0780ef405',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingbuffer_132',['vmaCreateAliasingBuffer',['../group__group__alloc.html#ga60d5d4803e3c82505a2bfddb929adb03',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingbuffer2_133',['vmaCreateAliasingBuffer2',['../group__group__alloc.html#gaf0cf014344213e117bd9f9cf5f928122',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingimage_134',['vmaCreateAliasingImage',['../group__group__alloc.html#gaebc4db1f94b53dba2338b4c0fd80d0dc',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingimage2_135',['vmaCreateAliasingImage2',['../group__group__alloc.html#ga69ac829f5bb0737449fa92c2d971f1bb',1,'vk_mem_alloc.h']]], - ['vmacreateallocator_136',['vmaCreateAllocator',['../group__group__init.html#ga200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]], - ['vmacreatebuffer_137',['vmaCreateBuffer',['../group__group__alloc.html#gac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]], - ['vmacreatebufferwithalignment_138',['vmaCreateBufferWithAlignment',['../group__group__alloc.html#gaa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]], - ['vmacreateimage_139',['vmaCreateImage',['../group__group__alloc.html#ga02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]], - ['vmacreatepool_140',['vmaCreatePool',['../group__group__alloc.html#ga5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], - ['vmacreatevirtualblock_141',['vmaCreateVirtualBlock',['../group__group__virtual.html#gab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], - ['vmadefragmentationcontext_142',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]], - ['vmadefragmentationflagbits_143',['VmaDefragmentationFlagBits',['../group__group__alloc.html#ga6552a65b71d16f378c6994b3ceaef50c',1,'VmaDefragmentationFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga13415cc0b443353a7b5abda300b833fc',1,'VmaDefragmentationFlagBits: vk_mem_alloc.h']]], - ['vmadefragmentationflags_144',['VmaDefragmentationFlags',['../group__group__alloc.html#ga88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]], - ['vmadefragmentationinfo_145',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../group__group__alloc.html#ga2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo: vk_mem_alloc.h']]], - ['vmadefragmentationmove_146',['VmaDefragmentationMove',['../struct_vma_defragmentation_move.html',1,'VmaDefragmentationMove'],['../group__group__alloc.html#ga563f4b43d3e31ed603d80cacc9ba8589',1,'VmaDefragmentationMove: vk_mem_alloc.h']]], - ['vmadefragmentationmoveoperation_147',['VmaDefragmentationMoveOperation',['../group__group__alloc.html#gada9e3861caf96f08894b0bcc160ec257',1,'VmaDefragmentationMoveOperation: vk_mem_alloc.h'],['../group__group__alloc.html#ga2ea666deeb3c2c74806a097e27cdb4a1',1,'VmaDefragmentationMoveOperation: vk_mem_alloc.h']]], - ['vmadefragmentationpassmoveinfo_148',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../group__group__alloc.html#gad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo: vk_mem_alloc.h']]], - ['vmadefragmentationstats_149',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../group__group__alloc.html#gad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats: vk_mem_alloc.h']]], - ['vmadestroyallocator_150',['vmaDestroyAllocator',['../group__group__init.html#gaa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], - ['vmadestroybuffer_151',['vmaDestroyBuffer',['../group__group__alloc.html#ga0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], - ['vmadestroyimage_152',['vmaDestroyImage',['../group__group__alloc.html#gae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], - ['vmadestroypool_153',['vmaDestroyPool',['../group__group__alloc.html#ga5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], - ['vmadestroyvirtualblock_154',['vmaDestroyVirtualBlock',['../group__group__virtual.html#ga3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], - ['vmadetailedstatistics_155',['VmaDetailedStatistics',['../struct_vma_detailed_statistics.html',1,'VmaDetailedStatistics'],['../group__group__stats.html#ga9ab0c535a6ca655dc63b8609ab4b8394',1,'VmaDetailedStatistics: vk_mem_alloc.h']]], - ['vmadevicememorycallbacks_156',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../group__group__init.html#ga77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks: vk_mem_alloc.h']]], - ['vmaenddefragmentation_157',['vmaEndDefragmentation',['../group__group__alloc.html#ga59f01ca3d53d50b7cca9b442b77a3e87',1,'vk_mem_alloc.h']]], - ['vmaenddefragmentationpass_158',['vmaEndDefragmentationPass',['../group__group__alloc.html#gaded05a445742a00718ee766144c5c226',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindex_159',['vmaFindMemoryTypeIndex',['../group__group__alloc.html#gaef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindexforbufferinfo_160',['vmaFindMemoryTypeIndexForBufferInfo',['../group__group__alloc.html#gae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindexforimageinfo_161',['vmaFindMemoryTypeIndexForImageInfo',['../group__group__alloc.html#ga088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], - ['vmaflushallocation_162',['vmaFlushAllocation',['../group__group__alloc.html#ga30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], - ['vmaflushallocations_163',['vmaFlushAllocations',['../group__group__alloc.html#gac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], - ['vmafreememory_164',['vmaFreeMemory',['../group__group__alloc.html#ga11f0fbc034fa81a4efedd73d61ce7568',1,'vk_mem_alloc.h']]], - ['vmafreememorypages_165',['vmaFreeMemoryPages',['../group__group__alloc.html#ga834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], - ['vmafreestatsstring_166',['vmaFreeStatsString',['../group__group__stats.html#ga3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], - ['vmafreevirtualblockstatsstring_167',['vmaFreeVirtualBlockStatsString',['../group__group__stats.html#ga47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], - ['vmagetallocationinfo_168',['vmaGetAllocationInfo',['../group__group__alloc.html#ga86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], - ['vmagetallocationinfo2_169',['vmaGetAllocationInfo2',['../group__group__alloc.html#ga1405cf3eae2fd1305d645879173031a0',1,'vk_mem_alloc.h']]], - ['vmagetallocationmemoryproperties_170',['vmaGetAllocationMemoryProperties',['../group__group__alloc.html#ga571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], - ['vmagetallocatorinfo_171',['vmaGetAllocatorInfo',['../group__group__init.html#gafa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], - ['vmagetheapbudgets_172',['vmaGetHeapBudgets',['../group__group__stats.html#ga9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], - ['vmagetmemoryproperties_173',['vmaGetMemoryProperties',['../group__group__init.html#gab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], - ['vmagetmemorytypeproperties_174',['vmaGetMemoryTypeProperties',['../group__group__init.html#ga8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], - ['vmagetmemorywin32handle_175',['vmaGetMemoryWin32Handle',['../group__group__alloc.html#ga8d327b7458d8cf426b84b5efba9bb9bf',1,'vk_mem_alloc.h']]], + ['vk_5fmem_5falloc_2eh_9',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]], + ['vkallocatememory_10',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]], + ['vkbindbuffermemory_11',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]], + ['vkbindbuffermemory2khr_12',['vkBindBufferMemory2KHR',['../struct_vma_vulkan_functions.html#a0c4907235aab9df2767b79836afa2dc9',1,'VmaVulkanFunctions']]], + ['vkbindimagememory_13',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]], + ['vkbindimagememory2khr_14',['vkBindImageMemory2KHR',['../struct_vma_vulkan_functions.html#ab95aaa73ab8a3fe9fd3daaaec4e0b2bf',1,'VmaVulkanFunctions']]], + ['vkcmdcopybuffer_15',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]], + ['vkcreatebuffer_16',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]], + ['vkcreateimage_17',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]], + ['vkdestroybuffer_18',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]], + ['vkdestroyimage_19',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]], + ['vkflushmappedmemoryranges_20',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]], + ['vkfreememory_21',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]], + ['vkgetbuffermemoryrequirements_22',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]], + ['vkgetbuffermemoryrequirements2khr_23',['vkGetBufferMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9d8d1b05d2b1e7e1d9b27f6f585acf9c',1,'VmaVulkanFunctions']]], + ['vkgetdevicebuffermemoryrequirements_24',['vkGetDeviceBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#ab25228053223e8a4dcd062574beed88d',1,'VmaVulkanFunctions']]], + ['vkgetdeviceimagememoryrequirements_25',['vkGetDeviceImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a10a9bf098a46640fa0a75f1c5fd80b9a',1,'VmaVulkanFunctions']]], + ['vkgetdeviceprocaddr_26',['vkGetDeviceProcAddr',['../struct_vma_vulkan_functions.html#ac383ab9af127e5e136622fa4ebea9e57',1,'VmaVulkanFunctions']]], + ['vkgetimagememoryrequirements_27',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]], + ['vkgetimagememoryrequirements2khr_28',['vkGetImageMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9cdcdc1e2b2ea7c571f7d27e30ba6875',1,'VmaVulkanFunctions']]], + ['vkgetinstanceprocaddr_29',['vkGetInstanceProcAddr',['../struct_vma_vulkan_functions.html#a3eafa102f5f8915f093f40675636b849',1,'VmaVulkanFunctions']]], + ['vkgetmemorywin32handlekhr_30',['vkGetMemoryWin32HandleKHR',['../struct_vma_vulkan_functions.html#af45d10a2b47971f4cf5bcacf1d331f86',1,'VmaVulkanFunctions']]], + ['vkgetphysicaldevicememoryproperties_31',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]], + ['vkgetphysicaldevicememoryproperties2khr_32',['vkGetPhysicalDeviceMemoryProperties2KHR',['../struct_vma_vulkan_functions.html#a0d992896e6ffcf92b9d7ea049fa5c445',1,'VmaVulkanFunctions']]], + ['vkgetphysicaldeviceproperties_33',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]], + ['vkinvalidatemappedmemoryranges_34',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]], + ['vkmapmemory_35',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]], + ['vkunmapmemory_36',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]], + ['vma_5fallocation_5fcreate_5fcan_5falias_5fbit_37',['VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597afb0ee060cd733aaa5e249704ff589ad6',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fdedicated_5fmemory_5fbit_38',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_39',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_40',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fhost_5faccess_5fallow_5ftransfer_5finstead_5fbit_41',['VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a11337f96eacf34c1016c339eac165cad',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fhost_5faccess_5frandom_5fbit_42',['VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597add61238d98e20917b9a06c617763f492',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fhost_5faccess_5fsequential_5fwrite_5fbit_43',['VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a9be224df3bfc1cfa06203aed689a30c5',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fmapped_5fbit_44',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_45',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_46',['VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a839826775c62319466441f86496f036d',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5ffirst_5ffit_5fbit_47',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fmask_48',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_49',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a8af1210cf591784afa026d94998f735d',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5foffset_5fbit_50',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a8099acedc0d04cdccaaddcfe37fd227d',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_51',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a0729e932b7ea170e3a128cad96c5cf6d',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_52',['VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597a42ba3a2d2c7117953210b7c3ef8da0df',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fuser_5fdata_5fcopy_5fstring_5fbit_53',['VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fwithin_5fbudget_5fbit_54',['VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT',['../group__group__alloc.html#ggad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5famd_5fdevice_5fcoherent_5fmemory_5fbit_55',['VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca2acce4886d8078552efa38878413970f',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fbuffer_5fdevice_5faddress_5fbit_56',['VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca5f1b28b0414319d1687e1f2b30ab0089',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fext_5fmemory_5fbudget_5fbit_57',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca4d4687863f7bd4b418c6006dc04400b0',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fext_5fmemory_5fpriority_5fbit_58',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_59',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_60',['VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7cae4d5ad929caba5f23eb502b13bd5286c',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fkhr_5fbind_5fmemory2_5fbit_61',['VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca8fb75bf07cd184ab903596295e863dee',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fkhr_5fdedicated_5fallocation_5fbit_62',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fkhr_5fexternal_5fmemory_5fwin32_5fbit_63',['VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7ca4897d1181a186e327f4dadd680ad00ac',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fkhr_5fmaintenance4_5fbit_64',['VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE4_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7caa2566e7f75e19ae7ec9c4fa509fea5fb',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fkhr_5fmaintenance5_5fbit_65',['VMA_ALLOCATOR_CREATE_KHR_MAINTENANCE5_BIT',['../group__group__init.html#gga4f87c9100d154a65a4ad495f7763cf7caca82d4ce40bdb59d3da52a539c21d6b8',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fflag_5falgorithm_5fbalanced_5fbit_66',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50caec35a4138111605a6ff32ca61aa871b6',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fflag_5falgorithm_5fextensive_5fbit_67',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_EXTENSIVE_BIT',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50cae45a9469e5337731627758671741e412',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fflag_5falgorithm_5ffast_5fbit_68',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50ca2e6469bcf5a094776ceb5d118263f04b',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fflag_5falgorithm_5ffull_5fbit_69',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FULL_BIT',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50cafa162eac5be800bcdd4011427a71156d',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fflag_5falgorithm_5fmask_70',['VMA_DEFRAGMENTATION_FLAG_ALGORITHM_MASK',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50cabcbbdb3bfd53c4c3ab4eaeb5fd4894e9',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_71',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../group__group__alloc.html#gga6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fmove_5foperation_5fcopy_72',['VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY',['../group__group__alloc.html#ggada9e3861caf96f08894b0bcc160ec257ad4a06ac46c4cb1c67b0ebc1edfab9f18',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fmove_5foperation_5fdestroy_73',['VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY',['../group__group__alloc.html#ggada9e3861caf96f08894b0bcc160ec257a9786f8492a9be2c03bd26395e352ab85',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fmove_5foperation_5fignore_74',['VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE',['../group__group__alloc.html#ggada9e3861caf96f08894b0bcc160ec257ad25bc6f816b226b4fd5170e845f218d2',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fauto_75',['VMA_MEMORY_USAGE_AUTO',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca27cde9026a84d34d525777baa41fce6e',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fauto_5fprefer_5fdevice_76',['VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305ccae2adb696d6a73c18bb20c23666661327',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fauto_5fprefer_5fhost_77',['VMA_MEMORY_USAGE_AUTO_PREFER_HOST',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca9b422585242160b8ed3418310ee6664d',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fcpu_5fcopy_78',['VMA_MEMORY_USAGE_CPU_COPY',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fcpu_5fonly_79',['VMA_MEMORY_USAGE_CPU_ONLY',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_80',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_81',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fgpu_5fonly_82',['VMA_MEMORY_USAGE_GPU_ONLY',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_83',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fmax_5fenum_84',['VMA_MEMORY_USAGE_MAX_ENUM',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5funknown_85',['VMA_MEMORY_USAGE_UNKNOWN',['../group__group__alloc.html#ggaa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5falgorithm_5fmask_86',['VMA_POOL_CREATE_ALGORITHM_MASK',['../group__group__alloc.html#gga9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_87',['VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__alloc.html#gga9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5fignore_5fbuffer_5fimage_5fgranularity_5fbit_88',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../group__group__alloc.html#gga9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5flinear_5falgorithm_5fbit_89',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../group__group__alloc.html#gga9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_90',['VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmask_91',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_92',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6ae2a9591a62b5e3b1bdcbc81c6188a1bf',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5foffset_5fbit_93',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_OFFSET_BIT',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6a3bb82d2aedd587a64846a1d7778852e6',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_94',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6a562d10a46012719d33167d3dc5dbbf9b',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fupper_5faddress_5fbit_95',['VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../group__group__virtual.html#gga2e9c64d405b14156fea7e10c4ad06cb6a9524a329a55b5ec390d57d90b67ad78e',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5falgorithm_5fmask_96',['VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaaf9487467136e1a9e371894dc3a7c4844',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5fflag_5fbits_5fmax_5fenum_97',['VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaa5fc0d333c3d5687a8bbf57df9b377a87',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5flinear_5falgorithm_5fbit_98',['VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96',1,'vk_mem_alloc.h']]], + ['vmaallocatememory_99',['vmaAllocateMemory',['../group__group__alloc.html#gabf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]], + ['vmaallocatememoryforbuffer_100',['vmaAllocateMemoryForBuffer',['../group__group__alloc.html#ga7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]], + ['vmaallocatememoryforimage_101',['vmaAllocateMemoryForImage',['../group__group__alloc.html#ga0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]], + ['vmaallocatememorypages_102',['vmaAllocateMemoryPages',['../group__group__alloc.html#gad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]], + ['vmaallocation_103',['VmaAllocation',['../struct_vma_allocation.html',1,'']]], + ['vmaallocationcreateflagbits_104',['VmaAllocationCreateFlagBits',['../group__group__alloc.html#gad9889c10c798b040d59c92f257cae597',1,'VmaAllocationCreateFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga4fceecc301f4064dc808d3cd6c038941',1,'VmaAllocationCreateFlagBits: vk_mem_alloc.h']]], + ['vmaallocationcreateflags_105',['VmaAllocationCreateFlags',['../group__group__alloc.html#ga5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]], + ['vmaallocationcreateinfo_106',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../group__group__alloc.html#ga3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo: vk_mem_alloc.h']]], + ['vmaallocationinfo_107',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../group__group__alloc.html#ga1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo: vk_mem_alloc.h']]], + ['vmaallocationinfo2_108',['VmaAllocationInfo2',['../struct_vma_allocation_info2.html',1,'VmaAllocationInfo2'],['../group__group__alloc.html#ga25ede29f830f326b8572a18ce879bf64',1,'VmaAllocationInfo2: vk_mem_alloc.h']]], + ['vmaallocator_109',['VmaAllocator',['../struct_vma_allocator.html',1,'']]], + ['vmaallocatorcreateflagbits_110',['VmaAllocatorCreateFlagBits',['../group__group__init.html#ga4f87c9100d154a65a4ad495f7763cf7c',1,'VmaAllocatorCreateFlagBits: vk_mem_alloc.h'],['../group__group__init.html#gafd73b95e737ee7e76f827cb5472f559f',1,'VmaAllocatorCreateFlagBits: vk_mem_alloc.h']]], + ['vmaallocatorcreateflags_111',['VmaAllocatorCreateFlags',['../group__group__init.html#gacfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]], + ['vmaallocatorcreateinfo_112',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../group__group__init.html#gaad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo: vk_mem_alloc.h']]], + ['vmaallocatorinfo_113',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../group__group__init.html#ga1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo: vk_mem_alloc.h']]], + ['vmabegindefragmentation_114',['vmaBeginDefragmentation',['../group__group__alloc.html#gac3335566858b45541fa9c0d7a6bbb57e',1,'vk_mem_alloc.h']]], + ['vmabegindefragmentationpass_115',['vmaBeginDefragmentationPass',['../group__group__alloc.html#ga980d7da2ce3b1fd5c8b8476bc362cc00',1,'vk_mem_alloc.h']]], + ['vmabindbuffermemory_116',['vmaBindBufferMemory',['../group__group__alloc.html#ga6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]], + ['vmabindbuffermemory2_117',['vmaBindBufferMemory2',['../group__group__alloc.html#ga861f4f27189a7d11ab9d9eedc825cb6b',1,'vk_mem_alloc.h']]], + ['vmabindimagememory_118',['vmaBindImageMemory',['../group__group__alloc.html#ga3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]], + ['vmabindimagememory2_119',['vmaBindImageMemory2',['../group__group__alloc.html#ga5f3502dd7d38b53fb1533ea3921d038d',1,'vk_mem_alloc.h']]], + ['vmabudget_120',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../group__group__stats.html#gaa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget: vk_mem_alloc.h']]], + ['vmabuildstatsstring_121',['vmaBuildStatsString',['../group__group__stats.html#gaa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]], + ['vmabuildvirtualblockstatsstring_122',['vmaBuildVirtualBlockStatsString',['../group__group__stats.html#ga52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]], + ['vmacalculatepoolstatistics_123',['vmaCalculatePoolStatistics',['../group__group__stats.html#ga50ba0eb25d2b363b792be4645ca7a380',1,'vk_mem_alloc.h']]], + ['vmacalculatestatistics_124',['vmaCalculateStatistics',['../group__group__stats.html#ga36f3484de7aa6cd6edc4de9edfa0ff59',1,'vk_mem_alloc.h']]], + ['vmacalculatevirtualblockstatistics_125',['vmaCalculateVirtualBlockStatistics',['../group__group__virtual.html#ga93c5741bca44b43e5b849cacbd616098',1,'vk_mem_alloc.h']]], + ['vmacheckcorruption_126',['vmaCheckCorruption',['../group__group__alloc.html#ga49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]], + ['vmacheckpoolcorruption_127',['vmaCheckPoolCorruption',['../group__group__alloc.html#gad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]], + ['vmaclearvirtualblock_128',['vmaClearVirtualBlock',['../group__group__virtual.html#ga5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]], + ['vmacopyallocationtomemory_129',['vmaCopyAllocationToMemory',['../group__group__alloc.html#gaac883dd38863944335071213b9ae8477',1,'vk_mem_alloc.h']]], + ['vmacopymemorytoallocation_130',['vmaCopyMemoryToAllocation',['../group__group__alloc.html#ga11731ec58a3a43a22bb925e0780ef405',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingbuffer_131',['vmaCreateAliasingBuffer',['../group__group__alloc.html#ga60d5d4803e3c82505a2bfddb929adb03',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingbuffer2_132',['vmaCreateAliasingBuffer2',['../group__group__alloc.html#gaf0cf014344213e117bd9f9cf5f928122',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingimage_133',['vmaCreateAliasingImage',['../group__group__alloc.html#gaebc4db1f94b53dba2338b4c0fd80d0dc',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingimage2_134',['vmaCreateAliasingImage2',['../group__group__alloc.html#ga69ac829f5bb0737449fa92c2d971f1bb',1,'vk_mem_alloc.h']]], + ['vmacreateallocator_135',['vmaCreateAllocator',['../group__group__init.html#ga200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]], + ['vmacreatebuffer_136',['vmaCreateBuffer',['../group__group__alloc.html#gac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]], + ['vmacreatebufferwithalignment_137',['vmaCreateBufferWithAlignment',['../group__group__alloc.html#gaa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]], + ['vmacreateimage_138',['vmaCreateImage',['../group__group__alloc.html#ga02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]], + ['vmacreatepool_139',['vmaCreatePool',['../group__group__alloc.html#ga5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], + ['vmacreatevirtualblock_140',['vmaCreateVirtualBlock',['../group__group__virtual.html#gab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], + ['vmadefragmentationcontext_141',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]], + ['vmadefragmentationflagbits_142',['VmaDefragmentationFlagBits',['../group__group__alloc.html#ga6552a65b71d16f378c6994b3ceaef50c',1,'VmaDefragmentationFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga13415cc0b443353a7b5abda300b833fc',1,'VmaDefragmentationFlagBits: vk_mem_alloc.h']]], + ['vmadefragmentationflags_143',['VmaDefragmentationFlags',['../group__group__alloc.html#ga88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]], + ['vmadefragmentationinfo_144',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../group__group__alloc.html#ga2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo: vk_mem_alloc.h']]], + ['vmadefragmentationmove_145',['VmaDefragmentationMove',['../struct_vma_defragmentation_move.html',1,'VmaDefragmentationMove'],['../group__group__alloc.html#ga563f4b43d3e31ed603d80cacc9ba8589',1,'VmaDefragmentationMove: vk_mem_alloc.h']]], + ['vmadefragmentationmoveoperation_146',['VmaDefragmentationMoveOperation',['../group__group__alloc.html#gada9e3861caf96f08894b0bcc160ec257',1,'VmaDefragmentationMoveOperation: vk_mem_alloc.h'],['../group__group__alloc.html#ga2ea666deeb3c2c74806a097e27cdb4a1',1,'VmaDefragmentationMoveOperation: vk_mem_alloc.h']]], + ['vmadefragmentationpassmoveinfo_147',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../group__group__alloc.html#gad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo: vk_mem_alloc.h']]], + ['vmadefragmentationstats_148',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../group__group__alloc.html#gad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats: vk_mem_alloc.h']]], + ['vmadestroyallocator_149',['vmaDestroyAllocator',['../group__group__init.html#gaa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], + ['vmadestroybuffer_150',['vmaDestroyBuffer',['../group__group__alloc.html#ga0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], + ['vmadestroyimage_151',['vmaDestroyImage',['../group__group__alloc.html#gae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], + ['vmadestroypool_152',['vmaDestroyPool',['../group__group__alloc.html#ga5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], + ['vmadestroyvirtualblock_153',['vmaDestroyVirtualBlock',['../group__group__virtual.html#ga3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], + ['vmadetailedstatistics_154',['VmaDetailedStatistics',['../struct_vma_detailed_statistics.html',1,'VmaDetailedStatistics'],['../group__group__stats.html#ga9ab0c535a6ca655dc63b8609ab4b8394',1,'VmaDetailedStatistics: vk_mem_alloc.h']]], + ['vmadevicememorycallbacks_155',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../group__group__init.html#ga77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks: vk_mem_alloc.h']]], + ['vmaenddefragmentation_156',['vmaEndDefragmentation',['../group__group__alloc.html#ga59f01ca3d53d50b7cca9b442b77a3e87',1,'vk_mem_alloc.h']]], + ['vmaenddefragmentationpass_157',['vmaEndDefragmentationPass',['../group__group__alloc.html#gaded05a445742a00718ee766144c5c226',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindex_158',['vmaFindMemoryTypeIndex',['../group__group__alloc.html#gaef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforbufferinfo_159',['vmaFindMemoryTypeIndexForBufferInfo',['../group__group__alloc.html#gae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforimageinfo_160',['vmaFindMemoryTypeIndexForImageInfo',['../group__group__alloc.html#ga088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], + ['vmaflushallocation_161',['vmaFlushAllocation',['../group__group__alloc.html#ga30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], + ['vmaflushallocations_162',['vmaFlushAllocations',['../group__group__alloc.html#gac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], + ['vmafreememory_163',['vmaFreeMemory',['../group__group__alloc.html#ga11f0fbc034fa81a4efedd73d61ce7568',1,'vk_mem_alloc.h']]], + ['vmafreememorypages_164',['vmaFreeMemoryPages',['../group__group__alloc.html#ga834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], + ['vmafreestatsstring_165',['vmaFreeStatsString',['../group__group__stats.html#ga3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], + ['vmafreevirtualblockstatsstring_166',['vmaFreeVirtualBlockStatsString',['../group__group__stats.html#ga47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], + ['vmagetallocationinfo_167',['vmaGetAllocationInfo',['../group__group__alloc.html#ga86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], + ['vmagetallocationinfo2_168',['vmaGetAllocationInfo2',['../group__group__alloc.html#ga1405cf3eae2fd1305d645879173031a0',1,'vk_mem_alloc.h']]], + ['vmagetallocationmemoryproperties_169',['vmaGetAllocationMemoryProperties',['../group__group__alloc.html#ga571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], + ['vmagetallocatorinfo_170',['vmaGetAllocatorInfo',['../group__group__init.html#gafa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], + ['vmagetheapbudgets_171',['vmaGetHeapBudgets',['../group__group__stats.html#ga9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], + ['vmagetmemoryproperties_172',['vmaGetMemoryProperties',['../group__group__init.html#gab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], + ['vmagetmemorytypeproperties_173',['vmaGetMemoryTypeProperties',['../group__group__init.html#ga8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], + ['vmagetmemorywin32handle_174',['vmaGetMemoryWin32Handle',['../group__group__alloc.html#ga8d327b7458d8cf426b84b5efba9bb9bf',1,'vk_mem_alloc.h']]], + ['vmagetmemorywin32handle2_175',['vmaGetMemoryWin32Handle2',['../group__group__alloc.html#ga1a8d7aba3bf5a4de66c801b9988afa58',1,'vk_mem_alloc.h']]], ['vmagetphysicaldeviceproperties_176',['vmaGetPhysicalDeviceProperties',['../group__group__init.html#gaecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], ['vmagetpoolname_177',['vmaGetPoolName',['../group__group__alloc.html#gaf09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], ['vmagetpoolstatistics_178',['vmaGetPoolStatistics',['../group__group__stats.html#ga34d8e7d83774eed0caee5c5ae88e217d',1,'vk_mem_alloc.h']]], diff --git a/docs/html/search/all_15.js b/docs/html/search/all_15.js index f7f21336..b58aac7d 100644 --- a/docs/html/search/all_15.js +++ b/docs/html/search/all_15.js @@ -2,7 +2,7 @@ var searchData= [ ['warnings_0',['Validation layer warnings',['../general_considerations.html#general_considerations_validation_layer_warnings',1,'']]], ['when_20not_20to_20use_20custom_20pools_1',['When not to use custom pools',['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'']]], - ['win32_20handle_2',['Exporting Win32 handle',['../vk_khr_external_memory_win32.html#vk_khr_external_memory_win32_exporting_win32_handle',1,'']]], + ['win32_20handle_2',['Exporting Win32 handle',['../other_api_interop.html#other_api_interop_exporting_exporting_win32_handle',1,'']]], ['with_20other_20graphics_20apis_3',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], ['within_20budget_4',['Staying within budget',['../staying_within_budget.html',1,'index']]] ]; diff --git a/docs/html/search/all_2.js b/docs/html/search/all_2.js index 17c13258..4b9f9927 100644 --- a/docs/html/search/all_2.js +++ b/docs/html/search/all_2.js @@ -14,7 +14,7 @@ var searchData= ['copy_20functions_11',['Copy functions',['../memory_mapping.html#memory_mapping_copy_functions',1,'']]], ['corruption_20detection_12',['Corruption detection',['../debugging_memory_usage.html#debugging_memory_usage_corruption_detection',1,'']]], ['creating_20virtual_20block_13',['Creating virtual block',['../virtual_allocator.html#virtual_allocator_creating_virtual_block',1,'']]], - ['custom_20alignment_14',['Custom alignment',['../other_api_interop.html#opengl_interop_custom_alignment',1,'']]], + ['custom_20alignment_14',['Custom alignment',['../other_api_interop.html#other_api_interop_exporting_custom_alignment',1,'']]], ['custom_20host_20memory_20allocator_15',['Custom host memory allocator',['../configuration.html#custom_memory_allocator',1,'']]], ['custom_20memory_20pools_16',['Custom memory pools',['../custom_memory_pools.html',1,'Custom memory pools'],['../choosing_memory_type.html#choosing_memory_type_custom_memory_pools',1,'Custom memory pools']]], ['custom_20pools_17',['When not to use custom pools',['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'']]] diff --git a/docs/html/search/all_4.js b/docs/html/search/all_4.js index 3f6f0fb6..7d0bba21 100644 --- a/docs/html/search/all_4.js +++ b/docs/html/search/all_4.js @@ -3,8 +3,8 @@ var searchData= ['enabling_20buffer_20device_20address_0',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]], ['enabling_20extensions_1',['Enabling extensions',['../quick_start.html#quick_start_initialization_enabling_extensions',1,'']]], ['explicit_20memory_20types_2',['Explicit memory types',['../choosing_memory_type.html#choosing_memory_type_explicit_memory_types',1,'']]], - ['exporting_20memory_3',['Exporting memory',['../other_api_interop.html#opengl_interop_exporting_memory',1,'']]], - ['exporting_20win32_20handle_4',['Exporting Win32 handle',['../vk_khr_external_memory_win32.html#vk_khr_external_memory_win32_exporting_win32_handle',1,'']]], - ['extended_20allocation_20information_5',['Extended allocation information',['../other_api_interop.html#opengl_interop_extended_allocation_information',1,'']]], + ['exporting_20memory_3',['Exporting memory',['../other_api_interop.html#other_api_interop_exporting_memory',1,'']]], + ['exporting_20win32_20handle_4',['Exporting Win32 handle',['../other_api_interop.html#other_api_interop_exporting_exporting_win32_handle',1,'']]], + ['extended_20allocation_20information_5',['Extended allocation information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'']]], ['extensions_6',['Enabling extensions',['../quick_start.html#quick_start_initialization_enabling_extensions',1,'']]] ]; diff --git a/docs/html/search/all_7.js b/docs/html/search/all_7.js index 3c46c939..35fd2a48 100644 --- a/docs/html/search/all_7.js +++ b/docs/html/search/all_7.js @@ -1,6 +1,6 @@ var searchData= [ - ['handle_0',['Exporting Win32 handle',['../vk_khr_external_memory_win32.html#vk_khr_external_memory_win32_exporting_win32_handle',1,'']]], + ['handle_0',['Exporting Win32 handle',['../other_api_interop.html#other_api_interop_exporting_exporting_win32_handle',1,'']]], ['heap_20memory_20limit_1',['Device heap memory limit',['../configuration.html#heap_memory_limit',1,'']]], ['host_20memory_20allocator_2',['Custom host memory allocator',['../configuration.html#custom_memory_allocator',1,'']]] ]; diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js index c41930b2..d659bcf7 100644 --- a/docs/html/search/all_8.js +++ b/docs/html/search/all_8.js @@ -3,8 +3,8 @@ var searchData= ['importing_20vulkan_20functions_0',['Importing Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'']]], ['incorrect_20memory_20usage_1',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], ['index_2',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], - ['information_3',['information',['../other_api_interop.html#opengl_interop_extended_allocation_information',1,'Extended allocation information'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_more_information',1,'More information'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_more_information',1,'More information']]], - ['initialization_4',['Initialization',['../quick_start.html#quick_start_initialization',1,'Initialization'],['../vk_ext_memory_priority.html#vk_ext_memory_priority_initialization',1,'Initialization'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_initialization',1,'Initialization'],['../vk_khr_external_memory_win32.html#vk_khr_external_memory_win32_initialization',1,'Initialization'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_initialization',1,'Initialization']]], + ['information_3',['information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'Extended allocation information'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_more_information',1,'More information'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_more_information',1,'More information']]], + ['initialization_4',['Initialization',['../quick_start.html#quick_start_initialization',1,'Initialization'],['../other_api_interop.html#other_api_interop_exporting_initialization',1,'Initialization'],['../vk_ext_memory_priority.html#vk_ext_memory_priority_initialization',1,'Initialization'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_initialization',1,'Initialization'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_initialization',1,'Initialization']]], ['initialization_5',['initialization',['../group__group__init.html',1,'Library initialization'],['../debugging_memory_usage.html#debugging_memory_usage_initialization',1,'Memory initialization']]], ['instance_6',['instance',['../struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b',1,'VmaAllocatorCreateInfo::instance'],['../struct_vma_allocator_info.html#a2ed6a4d2d3fea039d66a13f15d0ce5fe',1,'VmaAllocatorInfo::instance']]], ['interop_20with_20other_20graphics_20apis_7',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js index 0c40a63a..559df43f 100644 --- a/docs/html/search/all_b.js +++ b/docs/html/search/all_b.js @@ -8,8 +8,8 @@ var searchData= ['maxallocationsperpass_5',['maxAllocationsPerPass',['../struct_vma_defragmentation_info.html#ac2db29d309bebc4f7d55041416e9694b',1,'VmaDefragmentationInfo']]], ['maxblockcount_6',['maxBlockCount',['../struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c',1,'VmaPoolCreateInfo']]], ['maxbytesperpass_7',['maxBytesPerPass',['../struct_vma_defragmentation_info.html#a637ada77b02179a27fa92290000afac4',1,'VmaDefragmentationInfo']]], - ['memory_8',['memory',['../other_api_interop.html#opengl_interop_exporting_memory',1,'Exporting memory'],['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'Persistently mapped memory']]], - ['memory_20allocation_9',['Memory allocation',['../group__group__alloc.html',1,'Memory allocation'],['../vk_khr_external_memory_win32.html#vk_khr_external_memory_win32_memory_allocation',1,'Memory allocation']]], + ['memory_8',['memory',['../other_api_interop.html#other_api_interop_exporting_memory',1,'Exporting memory'],['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'Persistently mapped memory']]], + ['memory_20allocation_9',['Memory allocation',['../group__group__alloc.html',1,'Memory allocation'],['../other_api_interop.html#other_api_interop_exporting_memory_allocation',1,'Memory allocation']]], ['memory_20allocation_20callbacks_10',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]], ['memory_20allocator_11',['Vulkan Memory Allocator',['../index.html',1,'']]], ['memory_20allocator_12',['Custom host memory allocator',['../configuration.html#custom_memory_allocator',1,'']]], diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js index fb085787..496ef618 100644 --- a/docs/html/search/all_e.js +++ b/docs/html/search/all_e.js @@ -24,7 +24,7 @@ var searchData= ['preferred_20flags_21',['Required and preferred flags',['../choosing_memory_type.html#choosing_memory_type_required_preferred_flags',1,'']]], ['preferredflags_22',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]], ['preferredlargeheapblocksize_23',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]], - ['preparations_24',['Preparations',['../vk_khr_external_memory_win32.html#vk_khr_external_memory_win32_preparations',1,'']]], + ['preparations_24',['Preparations',['../other_api_interop.html#other_api_interop_exporting_preparations',1,'']]], ['priority_25',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority']]], ['project_20setup_26',['Project setup',['../quick_start.html#quick_start_project_setup',1,'']]], ['ptypeexternalmemoryhandletypes_27',['pTypeExternalMemoryHandleTypes',['../struct_vma_allocator_create_info.html#ae8f0db05e5cb4c43d7713bf4a49a736b',1,'VmaAllocatorCreateInfo']]], diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js index 5f822829..375bec41 100644 --- a/docs/html/search/functions_0.js +++ b/docs/html/search/functions_0.js @@ -54,22 +54,23 @@ var searchData= ['vmagetmemoryproperties_51',['vmaGetMemoryProperties',['../group__group__init.html#gab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], ['vmagetmemorytypeproperties_52',['vmaGetMemoryTypeProperties',['../group__group__init.html#ga8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], ['vmagetmemorywin32handle_53',['vmaGetMemoryWin32Handle',['../group__group__alloc.html#ga8d327b7458d8cf426b84b5efba9bb9bf',1,'vk_mem_alloc.h']]], - ['vmagetphysicaldeviceproperties_54',['vmaGetPhysicalDeviceProperties',['../group__group__init.html#gaecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], - ['vmagetpoolname_55',['vmaGetPoolName',['../group__group__alloc.html#gaf09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], - ['vmagetpoolstatistics_56',['vmaGetPoolStatistics',['../group__group__stats.html#ga34d8e7d83774eed0caee5c5ae88e217d',1,'vk_mem_alloc.h']]], - ['vmagetvirtualallocationinfo_57',['vmaGetVirtualAllocationInfo',['../group__group__virtual.html#ga8ee14ceb1fe033ec84d8aa29e1f75afa',1,'vk_mem_alloc.h']]], - ['vmagetvirtualblockstatistics_58',['vmaGetVirtualBlockStatistics',['../group__group__virtual.html#ga2902aa3130866afcc64bb5f984113db3',1,'vk_mem_alloc.h']]], - ['vmaimportvulkanfunctionsfromvolk_59',['vmaImportVulkanFunctionsFromVolk',['../group__group__init.html#gaf8d9ee01910a7af7f552145ef0065b9c',1,'vk_mem_alloc.h']]], - ['vmainvalidateallocation_60',['vmaInvalidateAllocation',['../group__group__alloc.html#gaaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], - ['vmainvalidateallocations_61',['vmaInvalidateAllocations',['../group__group__alloc.html#gab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], - ['vmaisvirtualblockempty_62',['vmaIsVirtualBlockEmpty',['../group__group__virtual.html#gacd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], - ['vmamapmemory_63',['vmaMapMemory',['../group__group__alloc.html#gad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], - ['vmasetallocationname_64',['vmaSetAllocationName',['../group__group__alloc.html#gabe02cbb0cd913b3f125958179f2020fc',1,'vk_mem_alloc.h']]], - ['vmasetallocationuserdata_65',['vmaSetAllocationUserData',['../group__group__alloc.html#gaf9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], - ['vmasetcurrentframeindex_66',['vmaSetCurrentFrameIndex',['../group__group__init.html#gade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], - ['vmasetpoolname_67',['vmaSetPoolName',['../group__group__alloc.html#gadbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], - ['vmasetvirtualallocationuserdata_68',['vmaSetVirtualAllocationUserData',['../group__group__virtual.html#ga001ea1850458a4062b829e09c303fca2',1,'vk_mem_alloc.h']]], - ['vmaunmapmemory_69',['vmaUnmapMemory',['../group__group__alloc.html#ga9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], - ['vmavirtualallocate_70',['vmaVirtualAllocate',['../group__group__virtual.html#ga6b7cdcc1c3e5103c323fedc4e1319e01',1,'vk_mem_alloc.h']]], - ['vmavirtualfree_71',['vmaVirtualFree',['../group__group__virtual.html#ga09fc688c0c3653ff23723b037e5d5033',1,'vk_mem_alloc.h']]] + ['vmagetmemorywin32handle2_54',['vmaGetMemoryWin32Handle2',['../group__group__alloc.html#ga1a8d7aba3bf5a4de66c801b9988afa58',1,'vk_mem_alloc.h']]], + ['vmagetphysicaldeviceproperties_55',['vmaGetPhysicalDeviceProperties',['../group__group__init.html#gaecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], + ['vmagetpoolname_56',['vmaGetPoolName',['../group__group__alloc.html#gaf09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], + ['vmagetpoolstatistics_57',['vmaGetPoolStatistics',['../group__group__stats.html#ga34d8e7d83774eed0caee5c5ae88e217d',1,'vk_mem_alloc.h']]], + ['vmagetvirtualallocationinfo_58',['vmaGetVirtualAllocationInfo',['../group__group__virtual.html#ga8ee14ceb1fe033ec84d8aa29e1f75afa',1,'vk_mem_alloc.h']]], + ['vmagetvirtualblockstatistics_59',['vmaGetVirtualBlockStatistics',['../group__group__virtual.html#ga2902aa3130866afcc64bb5f984113db3',1,'vk_mem_alloc.h']]], + ['vmaimportvulkanfunctionsfromvolk_60',['vmaImportVulkanFunctionsFromVolk',['../group__group__init.html#gaf8d9ee01910a7af7f552145ef0065b9c',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocation_61',['vmaInvalidateAllocation',['../group__group__alloc.html#gaaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocations_62',['vmaInvalidateAllocations',['../group__group__alloc.html#gab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], + ['vmaisvirtualblockempty_63',['vmaIsVirtualBlockEmpty',['../group__group__virtual.html#gacd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], + ['vmamapmemory_64',['vmaMapMemory',['../group__group__alloc.html#gad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], + ['vmasetallocationname_65',['vmaSetAllocationName',['../group__group__alloc.html#gabe02cbb0cd913b3f125958179f2020fc',1,'vk_mem_alloc.h']]], + ['vmasetallocationuserdata_66',['vmaSetAllocationUserData',['../group__group__alloc.html#gaf9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], + ['vmasetcurrentframeindex_67',['vmaSetCurrentFrameIndex',['../group__group__init.html#gade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], + ['vmasetpoolname_68',['vmaSetPoolName',['../group__group__alloc.html#gadbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], + ['vmasetvirtualallocationuserdata_69',['vmaSetVirtualAllocationUserData',['../group__group__virtual.html#ga001ea1850458a4062b829e09c303fca2',1,'vk_mem_alloc.h']]], + ['vmaunmapmemory_70',['vmaUnmapMemory',['../group__group__alloc.html#ga9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], + ['vmavirtualallocate_71',['vmaVirtualAllocate',['../group__group__virtual.html#ga6b7cdcc1c3e5103c323fedc4e1319e01',1,'vk_mem_alloc.h']]], + ['vmavirtualfree_72',['vmaVirtualFree',['../group__group__virtual.html#ga09fc688c0c3653ff23723b037e5d5033',1,'vk_mem_alloc.h']]] ]; diff --git a/docs/html/search/pages_0.js b/docs/html/search/pages_0.js index 6be377af..042f123b 100644 --- a/docs/html/search/pages_0.js +++ b/docs/html/search/pages_0.js @@ -1,11 +1,30 @@ var searchData= [ - ['address_0',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]], - ['aliasing_20overlap_1',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]], - ['allocation_20names_20and_20user_20data_2',['Allocation names and user data',['../allocation_annotation.html',1,'index']]], - ['allocator_3',['Vulkan Memory Allocator',['../index.html',1,'']]], - ['allocator_4',['Virtual allocator',['../virtual_allocator.html',1,'index']]], - ['and_20user_20data_5',['Allocation names and user data',['../allocation_annotation.html',1,'index']]], - ['apis_6',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], - ['asked_20questions_7',['Frequently asked questions',['../faq.html',1,'index']]] + ['additional_20considerations_0',['Additional considerations',['../virtual_allocator.html#virtual_allocator_additional_considerations',1,'']]], + ['address_1',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]], + ['advanced_20data_20uploading_2',['Advanced data uploading',['../usage_patterns.html#usage_patterns_advanced_data_uploading',1,'']]], + ['algorithm_3',['algorithm',['../general_considerations.html#general_considerations_allocation_algorithm',1,'Allocation algorithm'],['../custom_memory_pools.html#linear_algorithm',1,'Linear allocation algorithm']]], + ['aliasing_20overlap_4',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]], + ['alignment_5',['Custom alignment',['../other_api_interop.html#other_api_interop_exporting_custom_alignment',1,'']]], + ['alignment_20and_20units_6',['Alignment and units',['../virtual_allocator.html#virtual_allocator_alignment_and_units',1,'']]], + ['allocation_7',['allocation',['../other_api_interop.html#other_api_interop_exporting_memory_allocation',1,'Memory allocation'],['../quick_start.html#quick_start_resource_allocation',1,'Resource allocation']]], + ['allocation_20algorithm_8',['Allocation algorithm',['../general_considerations.html#general_considerations_allocation_algorithm',1,'']]], + ['allocation_20algorithm_9',['Linear allocation algorithm',['../custom_memory_pools.html#linear_algorithm',1,'']]], + ['allocation_20callbacks_10',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]], + ['allocation_20information_11',['Extended allocation information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'']]], + ['allocation_20names_12',['Allocation names',['../allocation_annotation.html#allocation_names',1,'']]], + ['allocation_20names_20and_20user_20data_13',['Allocation names and user data',['../allocation_annotation.html',1,'index']]], + ['allocation_20parameters_14',['Allocation parameters',['../virtual_allocator.html#virtual_allocator_allocation_parameters',1,'']]], + ['allocation_20user_20data_15',['Allocation user data',['../allocation_annotation.html#allocation_user_data',1,'']]], + ['allocations_16',['allocations',['../choosing_memory_type.html#choosing_memory_type_dedicated_allocations',1,'Dedicated allocations'],['../virtual_allocator.html#virtual_allocator_making_virtual_allocations',1,'Making virtual allocations']]], + ['allocator_17',['Vulkan Memory Allocator',['../index.html',1,'']]], + ['allocator_18',['allocator',['../configuration.html#custom_memory_allocator',1,'Custom host memory allocator'],['../virtual_allocator.html',1,'Virtual allocator']]], + ['and_20compatibility_19',['Versioning and compatibility',['../general_considerations.html#general_considerations_versioning_and_compatibility',1,'']]], + ['and_20invalidate_20',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]], + ['and_20preferred_20flags_21',['Required and preferred flags',['../choosing_memory_type.html#choosing_memory_type_required_preferred_flags',1,'']]], + ['and_20units_22',['Alignment and units',['../virtual_allocator.html#virtual_allocator_alignment_and_units',1,'']]], + ['and_20user_20data_23',['Allocation names and user data',['../allocation_annotation.html',1,'index']]], + ['apis_24',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], + ['asked_20questions_25',['Frequently asked questions',['../faq.html',1,'index']]], + ['at_20once_26',['Free-at-once',['../custom_memory_pools.html#linear_algorithm_free_at_once',1,'']]] ]; diff --git a/docs/html/search/pages_1.js b/docs/html/search/pages_1.js index be4a6179..c4b82e84 100644 --- a/docs/html/search/pages_1.js +++ b/docs/html/search/pages_1.js @@ -1,5 +1,7 @@ var searchData= [ - ['budget_0',['Staying within budget',['../staying_within_budget.html',1,'index']]], - ['buffer_20device_20address_1',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]] + ['block_0',['Creating virtual block',['../virtual_allocator.html#virtual_allocator_creating_virtual_block',1,'']]], + ['budget_1',['budget',['../staying_within_budget.html#staying_within_budget_querying_for_budget',1,'Querying for budget'],['../staying_within_budget.html',1,'Staying within budget']]], + ['buffer_2',['Ring buffer',['../custom_memory_pools.html#linear_algorithm_ring_buffer',1,'']]], + ['buffer_20device_20address_3',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]] ]; diff --git a/docs/html/search/pages_10.js b/docs/html/search/pages_10.js index 0576116d..587b74cb 100644 --- a/docs/html/search/pages_10.js +++ b/docs/html/search/pages_10.js @@ -1,4 +1,10 @@ var searchData= [ - ['type_0',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]] + ['readback_0',['Readback',['../usage_patterns.html#usage_patterns_readback',1,'']]], + ['recommended_20usage_20patterns_1',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], + ['required_20and_20preferred_20flags_2',['Required and preferred flags',['../choosing_memory_type.html#choosing_memory_type_required_preferred_flags',1,'']]], + ['resource_3',['GPU-only resource',['../usage_patterns.html#usage_patterns_gpu_only',1,'']]], + ['resource_20aliasing_20overlap_4',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]], + ['resource_20allocation_5',['Resource allocation',['../quick_start.html#quick_start_resource_allocation',1,'']]], + ['ring_20buffer_6',['Ring buffer',['../custom_memory_pools.html#linear_algorithm_ring_buffer',1,'']]] ]; diff --git a/docs/html/search/pages_11.js b/docs/html/search/pages_11.js index 0c94e560..9bb2905b 100644 --- a/docs/html/search/pages_11.js +++ b/docs/html/search/pages_11.js @@ -1,6 +1,14 @@ var searchData= [ - ['usage_0',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], - ['usage_20patterns_1',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], - ['user_20data_2',['Allocation names and user data',['../allocation_annotation.html',1,'index']]] + ['safety_0',['Thread safety',['../general_considerations.html#general_considerations_thread_safety',1,'']]], + ['selecting_20vulkan_20version_1',['Selecting Vulkan version',['../quick_start.html#quick_start_initialization_selecting_vulkan_version',1,'']]], + ['setup_2',['Project setup',['../quick_start.html#quick_start_project_setup',1,'']]], + ['stack_3',['Stack',['../custom_memory_pools.html#linear_algorithm_stack',1,'']]], + ['stack_4',['Double stack',['../custom_memory_pools.html#linear_algorithm_double_stack',1,'']]], + ['staging_20copy_20for_20upload_5',['Staging copy for upload',['../usage_patterns.html#usage_patterns_staging_copy_upload',1,'']]], + ['start_6',['Quick start',['../quick_start.html',1,'index']]], + ['statistics_7',['Statistics',['../statistics.html',1,'Statistics'],['../virtual_allocator.html#virtual_allocator_statistics',1,'Statistics']]], + ['statistics_8',['Numeric statistics',['../statistics.html#statistics_numeric_statistics',1,'']]], + ['staying_20within_20budget_9',['Staying within budget',['../staying_within_budget.html',1,'index']]], + ['supported_10',['Features not supported',['../general_considerations.html#general_considerations_features_not_supported',1,'']]] ]; diff --git a/docs/html/search/pages_12.js b/docs/html/search/pages_12.js index 4f08533b..4ab889ec 100644 --- a/docs/html/search/pages_12.js +++ b/docs/html/search/pages_12.js @@ -1,9 +1,9 @@ var searchData= [ - ['virtual_20allocator_0',['Virtual allocator',['../virtual_allocator.html',1,'index']]], - ['vk_5famd_5fdevice_5fcoherent_5fmemory_1',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]], - ['vk_5fext_5fmemory_5fpriority_2',['VK_EXT_memory_priority',['../vk_ext_memory_priority.html',1,'index']]], - ['vk_5fkhr_5fdedicated_5fallocation_3',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]], - ['vk_5fkhr_5fexternal_5fmemory_5fwin32_4',['VK_KHR_external_memory_win32',['../vk_khr_external_memory_win32.html',1,'index']]], - ['vulkan_20memory_20allocator_5',['Vulkan Memory Allocator',['../index.html',1,'']]] + ['thread_20safety_0',['Thread safety',['../general_considerations.html#general_considerations_thread_safety',1,'']]], + ['to_20use_20custom_20pools_1',['When not to use custom pools',['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'']]], + ['to_20vulkan_20functions_2',['Pointers to Vulkan functions',['../configuration.html#config_Vulkan_functions',1,'']]], + ['type_3',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]], + ['type_20index_4',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], + ['types_5',['Explicit memory types',['../choosing_memory_type.html#choosing_memory_type_explicit_memory_types',1,'']]] ]; diff --git a/docs/html/search/pages_13.js b/docs/html/search/pages_13.js index 8873ed20..bd46f3cb 100644 --- a/docs/html/search/pages_13.js +++ b/docs/html/search/pages_13.js @@ -1,5 +1,12 @@ var searchData= [ - ['with_20other_20graphics_20apis_0',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], - ['within_20budget_1',['Staying within budget',['../staying_within_budget.html',1,'index']]] + ['units_0',['Alignment and units',['../virtual_allocator.html#virtual_allocator_alignment_and_units',1,'']]], + ['upload_1',['Staging copy for upload',['../usage_patterns.html#usage_patterns_staging_copy_upload',1,'']]], + ['uploading_2',['Advanced data uploading',['../usage_patterns.html#usage_patterns_advanced_data_uploading',1,'']]], + ['usage_3',['Usage',['../choosing_memory_type.html#choosing_memory_type_usage',1,'Usage'],['../vk_ext_memory_priority.html#vk_ext_memory_priority_usage',1,'Usage'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_usage',1,'Usage'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_usage',1,'Usage']]], + ['usage_4',['usage',['../staying_within_budget.html#staying_within_budget_controlling_memory_usage',1,'Controlling memory usage'],['../debugging_memory_usage.html',1,'Debugging incorrect memory usage']]], + ['usage_20patterns_5',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], + ['use_20cases_6',['Other use cases',['../usage_patterns.html#usage_patterns_other_use_cases',1,'']]], + ['use_20custom_20pools_7',['When not to use custom pools',['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'']]], + ['user_20data_8',['user data',['../allocation_annotation.html',1,'Allocation names and user data'],['../allocation_annotation.html#allocation_user_data',1,'Allocation user data']]] ]; diff --git a/docs/html/search/pages_14.js b/docs/html/search/pages_14.js new file mode 100644 index 00000000..24252d02 --- /dev/null +++ b/docs/html/search/pages_14.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['validation_20layer_20warnings_0',['Validation layer warnings',['../general_considerations.html#general_considerations_validation_layer_warnings',1,'']]], + ['version_1',['Selecting Vulkan version',['../quick_start.html#quick_start_initialization_selecting_vulkan_version',1,'']]], + ['versioning_20and_20compatibility_2',['Versioning and compatibility',['../general_considerations.html#general_considerations_versioning_and_compatibility',1,'']]], + ['virtual_20allocations_3',['Making virtual allocations',['../virtual_allocator.html#virtual_allocator_making_virtual_allocations',1,'']]], + ['virtual_20allocator_4',['Virtual allocator',['../virtual_allocator.html',1,'index']]], + ['virtual_20block_5',['Creating virtual block',['../virtual_allocator.html#virtual_allocator_creating_virtual_block',1,'']]], + ['vk_5famd_5fdevice_5fcoherent_5fmemory_6',['VK_AMD_device_coherent_memory',['../vk_amd_device_coherent_memory.html',1,'index']]], + ['vk_5fext_5fmemory_5fpriority_7',['VK_EXT_memory_priority',['../vk_ext_memory_priority.html',1,'index']]], + ['vk_5fkhr_5fdedicated_5fallocation_8',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]], + ['vulkan_20functions_9',['Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'Importing Vulkan functions'],['../configuration.html#config_Vulkan_functions',1,'Pointers to Vulkan functions']]], + ['vulkan_20memory_20allocator_10',['Vulkan Memory Allocator',['../index.html',1,'']]], + ['vulkan_20version_11',['Selecting Vulkan version',['../quick_start.html#quick_start_initialization_selecting_vulkan_version',1,'']]] +]; diff --git a/docs/html/search/pages_15.js b/docs/html/search/pages_15.js new file mode 100644 index 00000000..b58aac7d --- /dev/null +++ b/docs/html/search/pages_15.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['warnings_0',['Validation layer warnings',['../general_considerations.html#general_considerations_validation_layer_warnings',1,'']]], + ['when_20not_20to_20use_20custom_20pools_1',['When not to use custom pools',['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'']]], + ['win32_20handle_2',['Exporting Win32 handle',['../other_api_interop.html#other_api_interop_exporting_exporting_win32_handle',1,'']]], + ['with_20other_20graphics_20apis_3',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], + ['within_20budget_4',['Staying within budget',['../staying_within_budget.html',1,'index']]] +]; diff --git a/docs/html/search/pages_2.js b/docs/html/search/pages_2.js index d8103783..4b9f9927 100644 --- a/docs/html/search/pages_2.js +++ b/docs/html/search/pages_2.js @@ -1,7 +1,21 @@ var searchData= [ - ['choosing_20memory_20type_0',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]], - ['configuration_1',['Configuration',['../configuration.html',1,'index']]], - ['considerations_2',['General considerations',['../general_considerations.html',1,'index']]], - ['custom_20memory_20pools_3',['Custom memory pools',['../custom_memory_pools.html',1,'index']]] + ['cache_20flush_20and_20invalidate_0',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]], + ['callbacks_1',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]], + ['cases_2',['Other use cases',['../usage_patterns.html#usage_patterns_other_use_cases',1,'']]], + ['choosing_20memory_20type_3',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]], + ['choosing_20memory_20type_20index_4',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], + ['compatibility_5',['Versioning and compatibility',['../general_considerations.html#general_considerations_versioning_and_compatibility',1,'']]], + ['configuration_6',['Configuration',['../configuration.html',1,'index']]], + ['configuration_20options_7',['Other configuration options',['../quick_start.html#quick_start_initialization_other_config',1,'']]], + ['considerations_8',['considerations',['../virtual_allocator.html#virtual_allocator_additional_considerations',1,'Additional considerations'],['../general_considerations.html',1,'General considerations']]], + ['controlling_20memory_20usage_9',['Controlling memory usage',['../staying_within_budget.html#staying_within_budget_controlling_memory_usage',1,'']]], + ['copy_20for_20upload_10',['Staging copy for upload',['../usage_patterns.html#usage_patterns_staging_copy_upload',1,'']]], + ['copy_20functions_11',['Copy functions',['../memory_mapping.html#memory_mapping_copy_functions',1,'']]], + ['corruption_20detection_12',['Corruption detection',['../debugging_memory_usage.html#debugging_memory_usage_corruption_detection',1,'']]], + ['creating_20virtual_20block_13',['Creating virtual block',['../virtual_allocator.html#virtual_allocator_creating_virtual_block',1,'']]], + ['custom_20alignment_14',['Custom alignment',['../other_api_interop.html#other_api_interop_exporting_custom_alignment',1,'']]], + ['custom_20host_20memory_20allocator_15',['Custom host memory allocator',['../configuration.html#custom_memory_allocator',1,'']]], + ['custom_20memory_20pools_16',['Custom memory pools',['../custom_memory_pools.html',1,'Custom memory pools'],['../choosing_memory_type.html#choosing_memory_type_custom_memory_pools',1,'Custom memory pools']]], + ['custom_20pools_17',['When not to use custom pools',['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'']]] ]; diff --git a/docs/html/search/pages_3.js b/docs/html/search/pages_3.js index 2af6d03b..065c250e 100644 --- a/docs/html/search/pages_3.js +++ b/docs/html/search/pages_3.js @@ -1,8 +1,17 @@ var searchData= [ - ['data_0',['Allocation names and user data',['../allocation_annotation.html',1,'index']]], - ['debugging_20incorrect_20memory_20usage_1',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], - ['defragmentation_2',['Defragmentation',['../defragmentation.html',1,'index']]], - ['deprecated_20list_3',['Deprecated List',['../deprecated.html',1,'']]], - ['device_20address_4',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]] + ['data_0',['data',['../allocation_annotation.html',1,'Allocation names and user data'],['../allocation_annotation.html#allocation_user_data',1,'Allocation user data']]], + ['data_20uploading_1',['Advanced data uploading',['../usage_patterns.html#usage_patterns_advanced_data_uploading',1,'']]], + ['deallocation_2',['Deallocation',['../virtual_allocator.html#virtual_allocator_deallocation',1,'']]], + ['debugging_20incorrect_20memory_20usage_3',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], + ['dedicated_20allocations_4',['Dedicated allocations',['../choosing_memory_type.html#choosing_memory_type_dedicated_allocations',1,'']]], + ['defragmentation_5',['Defragmentation',['../defragmentation.html',1,'index']]], + ['deprecated_20list_6',['Deprecated List',['../deprecated.html',1,'']]], + ['detection_7',['Corruption detection',['../debugging_memory_usage.html#debugging_memory_usage_corruption_detection',1,'']]], + ['detection_20features_8',['Leak detection features',['../debugging_memory_usage.html#debugging_memory_usage_leak_detection',1,'']]], + ['device_20address_9',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]], + ['device_20heap_20memory_20limit_10',['Device heap memory limit',['../configuration.html#heap_memory_limit',1,'']]], + ['device_20memory_20allocation_20callbacks_11',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]], + ['double_20stack_12',['Double stack',['../custom_memory_pools.html#linear_algorithm_double_stack',1,'']]], + ['dump_13',['JSON dump',['../statistics.html#statistics_json_dump',1,'']]] ]; diff --git a/docs/html/search/pages_4.js b/docs/html/search/pages_4.js index 4b000a20..7d0bba21 100644 --- a/docs/html/search/pages_4.js +++ b/docs/html/search/pages_4.js @@ -1,4 +1,10 @@ var searchData= [ - ['enabling_20buffer_20device_20address_0',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]] + ['enabling_20buffer_20device_20address_0',['Enabling buffer device address',['../enabling_buffer_device_address.html',1,'index']]], + ['enabling_20extensions_1',['Enabling extensions',['../quick_start.html#quick_start_initialization_enabling_extensions',1,'']]], + ['explicit_20memory_20types_2',['Explicit memory types',['../choosing_memory_type.html#choosing_memory_type_explicit_memory_types',1,'']]], + ['exporting_20memory_3',['Exporting memory',['../other_api_interop.html#other_api_interop_exporting_memory',1,'']]], + ['exporting_20win32_20handle_4',['Exporting Win32 handle',['../other_api_interop.html#other_api_interop_exporting_exporting_win32_handle',1,'']]], + ['extended_20allocation_20information_5',['Extended allocation information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'']]], + ['extensions_6',['Enabling extensions',['../quick_start.html#quick_start_initialization_enabling_extensions',1,'']]] ]; diff --git a/docs/html/search/pages_5.js b/docs/html/search/pages_5.js index 842b2bbb..45408ba1 100644 --- a/docs/html/search/pages_5.js +++ b/docs/html/search/pages_5.js @@ -1,4 +1,12 @@ var searchData= [ - ['frequently_20asked_20questions_0',['Frequently asked questions',['../faq.html',1,'index']]] + ['features_0',['Leak detection features',['../debugging_memory_usage.html#debugging_memory_usage_leak_detection',1,'']]], + ['features_20not_20supported_1',['Features not supported',['../general_considerations.html#general_considerations_features_not_supported',1,'']]], + ['flags_2',['Required and preferred flags',['../choosing_memory_type.html#choosing_memory_type_required_preferred_flags',1,'']]], + ['flush_20and_20invalidate_3',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]], + ['for_20budget_4',['Querying for budget',['../staying_within_budget.html#staying_within_budget_querying_for_budget',1,'']]], + ['for_20upload_5',['Staging copy for upload',['../usage_patterns.html#usage_patterns_staging_copy_upload',1,'']]], + ['free_20at_20once_6',['Free-at-once',['../custom_memory_pools.html#linear_algorithm_free_at_once',1,'']]], + ['frequently_20asked_20questions_7',['Frequently asked questions',['../faq.html',1,'index']]], + ['functions_8',['functions',['../memory_mapping.html#memory_mapping_copy_functions',1,'Copy functions'],['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'Importing Vulkan functions'],['../memory_mapping.html#memory_mapping_mapping_functions',1,'Mapping functions'],['../configuration.html#config_Vulkan_functions',1,'Pointers to Vulkan functions']]] ]; diff --git a/docs/html/search/pages_6.js b/docs/html/search/pages_6.js index 82e869ff..0a3d83e1 100644 --- a/docs/html/search/pages_6.js +++ b/docs/html/search/pages_6.js @@ -1,5 +1,6 @@ var searchData= [ ['general_20considerations_0',['General considerations',['../general_considerations.html',1,'index']]], - ['graphics_20apis_1',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]] + ['gpu_20only_20resource_1',['GPU-only resource',['../usage_patterns.html#usage_patterns_gpu_only',1,'']]], + ['graphics_20apis_2',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]] ]; diff --git a/docs/html/search/pages_7.js b/docs/html/search/pages_7.js index 37e2f5d6..35fd2a48 100644 --- a/docs/html/search/pages_7.js +++ b/docs/html/search/pages_7.js @@ -1,5 +1,6 @@ var searchData= [ - ['incorrect_20memory_20usage_0',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], - ['interop_20with_20other_20graphics_20apis_1',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]] + ['handle_0',['Exporting Win32 handle',['../other_api_interop.html#other_api_interop_exporting_exporting_win32_handle',1,'']]], + ['heap_20memory_20limit_1',['Device heap memory limit',['../configuration.html#heap_memory_limit',1,'']]], + ['host_20memory_20allocator_2',['Custom host memory allocator',['../configuration.html#custom_memory_allocator',1,'']]] ]; diff --git a/docs/html/search/pages_8.js b/docs/html/search/pages_8.js index 1ad91e39..3bebba8b 100644 --- a/docs/html/search/pages_8.js +++ b/docs/html/search/pages_8.js @@ -1,4 +1,11 @@ var searchData= [ - ['list_0',['Deprecated List',['../deprecated.html',1,'']]] + ['importing_20vulkan_20functions_0',['Importing Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'']]], + ['incorrect_20memory_20usage_1',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], + ['index_2',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], + ['information_3',['information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'Extended allocation information'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_more_information',1,'More information'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_more_information',1,'More information']]], + ['initialization_4',['Initialization',['../quick_start.html#quick_start_initialization',1,'Initialization'],['../other_api_interop.html#other_api_interop_exporting_initialization',1,'Initialization'],['../vk_ext_memory_priority.html#vk_ext_memory_priority_initialization',1,'Initialization'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_initialization',1,'Initialization'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_initialization',1,'Initialization']]], + ['initialization_5',['Memory initialization',['../debugging_memory_usage.html#debugging_memory_usage_initialization',1,'']]], + ['interop_20with_20other_20graphics_20apis_6',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], + ['invalidate_7',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]] ]; diff --git a/docs/html/search/pages_9.js b/docs/html/search/pages_9.js index e23a0325..2f270a2e 100644 --- a/docs/html/search/pages_9.js +++ b/docs/html/search/pages_9.js @@ -1,9 +1,4 @@ var searchData= [ - ['mapping_0',['Memory mapping',['../memory_mapping.html',1,'index']]], - ['memory_20allocator_1',['Vulkan Memory Allocator',['../index.html',1,'']]], - ['memory_20mapping_2',['Memory mapping',['../memory_mapping.html',1,'index']]], - ['memory_20pools_3',['Custom memory pools',['../custom_memory_pools.html',1,'index']]], - ['memory_20type_4',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]], - ['memory_20usage_5',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]] + ['json_20dump_0',['JSON dump',['../statistics.html#statistics_json_dump',1,'']]] ]; diff --git a/docs/html/search/pages_a.js b/docs/html/search/pages_a.js index 592ca86d..1be00c53 100644 --- a/docs/html/search/pages_a.js +++ b/docs/html/search/pages_a.js @@ -1,4 +1,8 @@ var searchData= [ - ['names_20and_20user_20data_0',['Allocation names and user data',['../allocation_annotation.html',1,'index']]] + ['layer_20warnings_0',['Validation layer warnings',['../general_considerations.html#general_considerations_validation_layer_warnings',1,'']]], + ['leak_20detection_20features_1',['Leak detection features',['../debugging_memory_usage.html#debugging_memory_usage_leak_detection',1,'']]], + ['limit_2',['Device heap memory limit',['../configuration.html#heap_memory_limit',1,'']]], + ['linear_20allocation_20algorithm_3',['Linear allocation algorithm',['../custom_memory_pools.html#linear_algorithm',1,'']]], + ['list_4',['Deprecated List',['../deprecated.html',1,'']]] ]; diff --git a/docs/html/search/pages_b.js b/docs/html/search/pages_b.js index 8e59d085..c14c2a7b 100644 --- a/docs/html/search/pages_b.js +++ b/docs/html/search/pages_b.js @@ -1,5 +1,22 @@ var searchData= [ - ['other_20graphics_20apis_0',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], - ['overlap_1',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]] + ['making_20virtual_20allocations_0',['Making virtual allocations',['../virtual_allocator.html#virtual_allocator_making_virtual_allocations',1,'']]], + ['mapped_20memory_1',['Persistently mapped memory',['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'']]], + ['mapping_2',['Memory mapping',['../memory_mapping.html',1,'index']]], + ['mapping_20functions_3',['Mapping functions',['../memory_mapping.html#memory_mapping_mapping_functions',1,'']]], + ['margins_4',['Margins',['../debugging_memory_usage.html#debugging_memory_usage_margins',1,'']]], + ['memory_5',['memory',['../other_api_interop.html#other_api_interop_exporting_memory',1,'Exporting memory'],['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'Persistently mapped memory']]], + ['memory_20allocation_6',['Memory allocation',['../other_api_interop.html#other_api_interop_exporting_memory_allocation',1,'']]], + ['memory_20allocation_20callbacks_7',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]], + ['memory_20allocator_8',['Vulkan Memory Allocator',['../index.html',1,'']]], + ['memory_20allocator_9',['Custom host memory allocator',['../configuration.html#custom_memory_allocator',1,'']]], + ['memory_20initialization_10',['Memory initialization',['../debugging_memory_usage.html#debugging_memory_usage_initialization',1,'']]], + ['memory_20limit_11',['Device heap memory limit',['../configuration.html#heap_memory_limit',1,'']]], + ['memory_20mapping_12',['Memory mapping',['../memory_mapping.html',1,'index']]], + ['memory_20pools_13',['memory pools',['../custom_memory_pools.html',1,'Custom memory pools'],['../choosing_memory_type.html#choosing_memory_type_custom_memory_pools',1,'Custom memory pools']]], + ['memory_20type_14',['Choosing memory type',['../choosing_memory_type.html',1,'faq']]], + ['memory_20type_20index_15',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], + ['memory_20types_16',['Explicit memory types',['../choosing_memory_type.html#choosing_memory_type_explicit_memory_types',1,'']]], + ['memory_20usage_17',['memory usage',['../staying_within_budget.html#staying_within_budget_controlling_memory_usage',1,'Controlling memory usage'],['../debugging_memory_usage.html',1,'Debugging incorrect memory usage']]], + ['more_20information_18',['More information',['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_more_information',1,'More information'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_more_information',1,'More information']]] ]; diff --git a/docs/html/search/pages_c.js b/docs/html/search/pages_c.js index 35a213a0..588c3ac9 100644 --- a/docs/html/search/pages_c.js +++ b/docs/html/search/pages_c.js @@ -1,5 +1,8 @@ var searchData= [ - ['patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], - ['pools_1',['Custom memory pools',['../custom_memory_pools.html',1,'index']]] + ['names_0',['Allocation names',['../allocation_annotation.html#allocation_names',1,'']]], + ['names_20and_20user_20data_1',['Allocation names and user data',['../allocation_annotation.html',1,'index']]], + ['not_20supported_2',['Features not supported',['../general_considerations.html#general_considerations_features_not_supported',1,'']]], + ['not_20to_20use_20custom_20pools_3',['When not to use custom pools',['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'']]], + ['numeric_20statistics_4',['Numeric statistics',['../statistics.html#statistics_numeric_statistics',1,'']]] ]; diff --git a/docs/html/search/pages_d.js b/docs/html/search/pages_d.js index c9afe7b5..88e415e8 100644 --- a/docs/html/search/pages_d.js +++ b/docs/html/search/pages_d.js @@ -1,5 +1,10 @@ var searchData= [ - ['questions_0',['Frequently asked questions',['../faq.html',1,'index']]], - ['quick_20start_1',['Quick start',['../quick_start.html',1,'index']]] + ['once_0',['Free-at-once',['../custom_memory_pools.html#linear_algorithm_free_at_once',1,'']]], + ['only_20resource_1',['GPU-only resource',['../usage_patterns.html#usage_patterns_gpu_only',1,'']]], + ['options_2',['Other configuration options',['../quick_start.html#quick_start_initialization_other_config',1,'']]], + ['other_20configuration_20options_3',['Other configuration options',['../quick_start.html#quick_start_initialization_other_config',1,'']]], + ['other_20graphics_20apis_4',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], + ['other_20use_20cases_5',['Other use cases',['../usage_patterns.html#usage_patterns_other_use_cases',1,'']]], + ['overlap_6',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]] ]; diff --git a/docs/html/search/pages_e.js b/docs/html/search/pages_e.js index 5b06079f..f9f4dadf 100644 --- a/docs/html/search/pages_e.js +++ b/docs/html/search/pages_e.js @@ -1,5 +1,11 @@ var searchData= [ - ['recommended_20usage_20patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], - ['resource_20aliasing_20overlap_1',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]] + ['parameters_0',['Allocation parameters',['../virtual_allocator.html#virtual_allocator_allocation_parameters',1,'']]], + ['patterns_1',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], + ['persistently_20mapped_20memory_2',['Persistently mapped memory',['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'']]], + ['pointers_20to_20vulkan_20functions_3',['Pointers to Vulkan functions',['../configuration.html#config_Vulkan_functions',1,'']]], + ['pools_4',['pools',['../custom_memory_pools.html',1,'Custom memory pools'],['../choosing_memory_type.html#choosing_memory_type_custom_memory_pools',1,'Custom memory pools'],['../custom_memory_pools.html#custom_memory_pools_when_not_use',1,'When not to use custom pools']]], + ['preferred_20flags_5',['Required and preferred flags',['../choosing_memory_type.html#choosing_memory_type_required_preferred_flags',1,'']]], + ['preparations_6',['Preparations',['../other_api_interop.html#other_api_interop_exporting_preparations',1,'']]], + ['project_20setup_7',['Project setup',['../quick_start.html#quick_start_project_setup',1,'']]] ]; diff --git a/docs/html/search/pages_f.js b/docs/html/search/pages_f.js index 8a10d684..4c43fee8 100644 --- a/docs/html/search/pages_f.js +++ b/docs/html/search/pages_f.js @@ -1,6 +1,6 @@ var searchData= [ - ['start_0',['Quick start',['../quick_start.html',1,'index']]], - ['statistics_1',['Statistics',['../statistics.html',1,'index']]], - ['staying_20within_20budget_2',['Staying within budget',['../staying_within_budget.html',1,'index']]] + ['querying_20for_20budget_0',['Querying for budget',['../staying_within_budget.html#staying_within_budget_querying_for_budget',1,'']]], + ['questions_1',['Frequently asked questions',['../faq.html',1,'index']]], + ['quick_20start_2',['Quick start',['../quick_start.html',1,'index']]] ]; diff --git a/docs/html/search/search.css b/docs/html/search/search.css index 19f76f9d..956f31f9 100644 --- a/docs/html/search/search.css +++ b/docs/html/search/search.css @@ -5,8 +5,8 @@ display: flex; justify-content: center; align-items: center; - height: 36px; - margin-right: 1em; + height: 43px; + margin-right: 0; } /*---------------- Search box styling */ @@ -27,43 +27,23 @@ dark-mode-toggle { white-space : nowrap; background: var(--search-background-color); border-radius: 0.65em; - box-shadow: var(--search-box-shadow); + border: 1px solid var(--search-box-border-color); z-index: 102; + margin-right: 4px; } #MSearchBox .left { display: inline-block; vertical-align: middle; - height: 1.4em; -} - -#MSearchSelect { - display: inline-block; - vertical-align: middle; - width: 20px; - height: 19px; - background-image: var(--search-magnification-select-image); - margin: 0 0 0 0.3em; - padding: 0; + height: 1.6em; } -#MSearchSelectExt { - display: inline-block; - vertical-align: middle; - width: 10px; - height: 19px; - background-image: var(--search-magnification-image); - margin: 0 0 0 0.5em; - padding: 0; -} - - #MSearchField { display: inline-block; - vertical-align: middle; + vertical-align: top; width: 7.5em; - height: 19px; - margin: 0 0.15em; + height: 22px; + margin: 0 0 0 0.15em; padding: 0; line-height: 1em; border:none; @@ -86,7 +66,7 @@ dark-mode-toggle { display: inline-block; vertical-align: middle; width: 1.4em; - height: 1.4em; + height: 1.6em; } #MSearchClose { @@ -101,14 +81,100 @@ dark-mode-toggle { } #MSearchCloseImg { - padding: 0.3em; - margin: 0; + margin: 6px 0 0 4px; +} + +.close-icon { + width: 11px; + height: 11px; + background-color: var(--search-close-icon-bg-color); + border-radius: 50%; + position: relative; + display: flex; + justify-content: center; + align-items: center; + box-sizing: content-box; +} + +.close-icon:before, +.close-icon:after { + content: ''; + position: absolute; + width: 7px; + height: 1px; + background-color: var(--search-close-icon-fg-color); +} + +.close-icon:before { + transform: rotate(45deg); } +.close-icon:after { + transform: rotate(-45deg); +} + + .MSearchBoxActive #MSearchField { color: var(--search-active-color); } +.search-icon { + width: 20px; + height: 20px; + display: inline-block; + position: relative; + margin-left: 3px; +} + +#MSearchSelectExt.search-icon { + width: 10px; +} + +#MSearchSelectExt + input { + margin-left: 5px; +} + +.search-icon::before, .search-icon::after { + content: ''; + position: absolute; + border: 1.5px solid var(--search-foreground-color); + box-sizing: content-box; +} + +.search-icon::before { + width: 6px; + height: 6px; + border-radius: 50%; + top: 7px; + left: 2px; + background: var(--search-background-color); +} + +.search-icon::after { + border: 1px solid var(--search-foreground-color); + width: 0px; + height: 3px; + border-radius: 2px; + top: 15px; + left: 8px; + transform: rotate(-45deg); + transform-origin: top left; +} + +.search-icon-dropdown { + content: ''; + width: 0; + height: 0; + border-left: 3px solid transparent; + border-right: 3px solid transparent; + border-top: 3px solid var(--search-foreground-color); + top: 8px; + left: 15px; + transform: translateX(-50%); + position: absolute; +} + + /*---------------- Search filter selection */ @@ -119,15 +185,12 @@ dark-mode-toggle { left: 0; top: 0; border: 1px solid var(--search-filter-border-color); background-color: var(--search-filter-background-color); + backdrop-filter: var(--search-filter-backdrop-filter); + -webkit-backdrop-filter: var(--search-filter-backdrop-filter); z-index: 10001; padding-top: 4px; padding-bottom: 4px; - -moz-border-radius: 4px; - -webkit-border-top-left-radius: 4px; - -webkit-border-top-right-radius: 4px; - -webkit-border-bottom-left-radius: 4px; - -webkit-border-bottom-right-radius: 4px; - -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-radius: 4px; } .SelectItem { @@ -176,18 +239,39 @@ iframe#MSearchResults { height: 15em; } +@keyframes slideInSearchResults { + from { + opacity: 0; + transform: translate(0, 15px); + } + + to { + opacity: 1; + transform: translate(0, 20px); + } +} + #MSearchResultsWindow { display: none; position: absolute; - left: 0; top: 0; + left: auto; + right: 4px; + top: 0; border: 1px solid var(--search-results-border-color); background-color: var(--search-results-background-color); + backdrop-filter: var(--search-results-backdrop-filter); + -webkit-backdrop-filter: var(--search-results-backdrop-filter); z-index:10000; width: 300px; height: 400px; overflow: auto; + border-radius: 8px; + transform: translate(0, 20px); + animation: ease-out 280ms slideInSearchResults; + box-shadow: 0 2px 8px 0 rgba(0,0,0,.075); } + /* ----------------------------------- */ @@ -201,13 +285,13 @@ iframe#MSearchResults { } .SRPage .SREntry { - font-size: 8pt; - padding: 1px 5px; + font-size: 10pt; + padding: 2px 5px; } div.SRPage { margin: 5px 2px; - background-color: var(--search-results-background-color); + /*background-color: var(--search-results-background-color);*/ } .SRChildren { @@ -261,14 +345,17 @@ div.searchresults { margin-right: 10px; } +#searchBoxPos1 dark-mode-toggle { + margin-top: 4px; +} + /*---------------- External search page results */ .pages b { - color: white; + color: var(--nav-foreground-color); padding: 5px 5px 3px 5px; - background-image: var(--nav-gradient-active-image-parent); - background-repeat: repeat-x; - text-shadow: 0 1px 1px #000000; + background-color: var(--nav-menu-active-bg); + border-radius: 4px; } .pages { diff --git a/docs/html/search/search.js b/docs/html/search/search.js index 666af01e..dc14410f 100644 --- a/docs/html/search/search.js +++ b/docs/html/search/search.js @@ -607,6 +607,12 @@ function createResults(resultsPath) { elem.setAttribute('className',attr); } + const decodeHtml = (html) => { + const txt = document.createElement("textarea"); + txt.innerHTML = html; + return txt.value; + }; + const results = document.getElementById("SRResults"); results.innerHTML = ''; searchData.forEach((elem,index) => { @@ -620,10 +626,14 @@ function createResults(resultsPath) { srLink.setAttribute('id','Item'+index); setKeyActions(srLink,'return searchResults.Nav(event,'+index+')'); setClassAttr(srLink,'SRSymbol'); - srLink.innerHTML = elem[1][0]; + srLink.innerHTML = decodeHtml(elem[1][0]); srEntry.appendChild(srLink); if (elem[1].length==2) { // single result - srLink.setAttribute('href',resultsPath+elem[1][1][0]); + if (elem[1][1][0].startsWith('http://') || elem[1][1][0].startsWith('https://')) { // absolute path + srLink.setAttribute('href',elem[1][1][0]); + } else { // relative path + srLink.setAttribute('href',resultsPath+elem[1][1][0]); + } srLink.setAttribute('onclick','searchBox.CloseResultsWindow()'); if (elem[1][1][1]) { srLink.setAttribute('target','_parent'); @@ -632,7 +642,7 @@ function createResults(resultsPath) { } const srScope = document.createElement('span'); setClassAttr(srScope,'SRScope'); - srScope.innerHTML = elem[1][1][2]; + srScope.innerHTML = decodeHtml(elem[1][1][2]); srEntry.appendChild(srScope); } else { // multiple results srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")'); @@ -643,14 +653,18 @@ function createResults(resultsPath) { srChild.setAttribute('id','Item'+index+'_c'+c); setKeyActions(srChild,'return searchResults.NavChild(event,'+index+','+c+')'); setClassAttr(srChild,'SRScope'); - srChild.setAttribute('href',resultsPath+elem[1][c+1][0]); + if (elem[1][c+1][0].startsWith('http://') || elem[1][c+1][0].startsWith('https://')) { // absolute path + srChild.setAttribute('href',elem[1][c+1][0]); + } else { // relative path + srChild.setAttribute('href',resultsPath+elem[1][c+1][0]); + } srChild.setAttribute('onclick','searchBox.CloseResultsWindow()'); if (elem[1][c+1][1]) { srChild.setAttribute('target','_parent'); } else { srChild.setAttribute('target','_blank'); } - srChild.innerHTML = elem[1][c+1][2]; + srChild.innerHTML = decodeHtml(elem[1][c+1][2]); srChildren.appendChild(srChild); } srEntry.appendChild(srChildren); diff --git a/docs/html/search/searchdata.js b/docs/html/search/searchdata.js index 91f4369b..f6c6ff00 100644 --- a/docs/html/search/searchdata.js +++ b/docs/html/search/searchdata.js @@ -9,7 +9,7 @@ var indexSectionsWithContent = 6: "v", 7: "v", 8: "ailmsv", - 9: "abcdefgilmnopqrstuvw" + 9: "abcdefghijlmnopqrstuvw" }; var indexSectionNames = diff --git a/docs/html/statistics.html b/docs/html/statistics.html index 836f9343..14547b78 100644 --- a/docs/html/statistics.html +++ b/docs/html/statistics.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Statistics - - @@ -33,33 +31,22 @@ - + -
    -
    Statistics
    +
    Statistics

    This library contains several functions that return information about its internal state, especially the amount of memory allocated from Vulkan.

    -

    +

    Numeric statistics

    If you need to obtain basic statistics about memory usage per heap, together with current budget, you can call function vmaGetHeapBudgets() and inspect structure VmaBudget. This is useful to keep track of memory usage and stay within budget (see also Staying within budget). Example:

    uint32_t heapIndex = ...
    @@ -113,7 +100,7 @@

    You can query for more detailed statistics per memory heap, type, and totals, including minimum and maximum allocation size and unused range size, by calling function vmaCalculateStatistics() and inspecting structure VmaTotalStatistics. This function is slower though, as it has to traverse all the internal data structures, so it should be used only for debugging purposes.

    You can query for statistics of a custom pool using function vmaGetPoolStatistics() or vmaCalculatePoolStatistics().

    You can query for information about a specific allocation using function vmaGetAllocationInfo(). It fill structure VmaAllocationInfo.

    -

    +

    JSON dump

    You can dump internal state of the allocator to a string in JSON format using function vmaBuildStatsString(). The result is guaranteed to be correct JSON. It uses ANSI encoding. Any strings provided by user (see Allocation names) are copied as-is and properly escaped for JSON, so if they use UTF-8, ISO-8859-2 or any other encoding, this JSON string can be treated as using this encoding. It must be freed using function vmaFreeStatsString().

    The format of this JSON string is not part of official documentation of the library, but it will not change in backward-incompatible way without increasing library major version number and appropriate mention in changelog.

    @@ -122,7 +109,7 @@

    diff --git a/docs/html/staying_within_budget.html b/docs/html/staying_within_budget.html index 2b5443d7..03b5b3ec 100644 --- a/docs/html/staying_within_budget.html +++ b/docs/html/staying_within_budget.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Staying within budget - - @@ -33,33 +31,22 @@
    - + -
    -
    Staying within budget
    +
    Staying within budget

    When developing a graphics-intensive game or program, it is important to avoid allocating more GPU memory than it is physically available. When the memory is over-committed, various bad things can happen, depending on the specific GPU, graphics driver, and operating system:

    @@ -96,10 +83,10 @@
  • It may just work without any problems.
  • The application may slow down because some memory blocks are moved to system RAM and the GPU has to access them through PCI Express bus.
  • A new allocation may take very long time to complete, even few seconds, and possibly freeze entire system.
  • -
  • The new allocation may fail with VK_ERROR_OUT_OF_DEVICE_MEMORY.
  • -
  • It may even result in GPU crash (TDR), observed as VK_ERROR_DEVICE_LOST returned somewhere later.
  • +
  • The new allocation may fail with VK_ERROR_OUT_OF_DEVICE_MEMORY.
  • +
  • It may even result in GPU crash (TDR), observed as VK_ERROR_DEVICE_LOST returned somewhere later.
  • -

    +

    Querying for budget

    To query for current memory usage and available budget, use function vmaGetHeapBudgets(). Returned structure VmaBudget contains quantities expressed in bytes, per Vulkan memory heap.

    Please note that this function returns different information and works faster than vmaCalculateStatistics(). vmaGetHeapBudgets() can be called every frame or even before every allocation, while vmaCalculateStatistics() is intended to be used rarely, only to obtain statistical information, e.g. for debugging purposes.

    @@ -109,19 +96,19 @@

  • Use flag VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT when creating VmaAllocator object.
  • Make sure to call vmaSetCurrentFrameIndex() every frame. Budget is queried from Vulkan inside of it to avoid overhead of querying it with every allocation.
  • -

    +

    Controlling memory usage

    There are many ways in which you can try to stay within the budget.

    First, when making new allocation requires allocating a new memory block, the library tries not to exceed the budget automatically. If a block with default recommended size (e.g. 256 MB) would go over budget, a smaller block is allocated, possibly even dedicated memory for just this resource.

    -

    If the size of the requested resource plus current memory usage is more than the budget, by default the library still tries to create it, leaving it to the Vulkan implementation whether the allocation succeeds or fails. You can change this behavior by using VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT flag. With it, the allocation is not made if it would exceed the budget or if the budget is already exceeded. VMA then tries to make the allocation from the next eligible Vulkan memory type. If all of them fail, the call then fails with VK_ERROR_OUT_OF_DEVICE_MEMORY. Example usage pattern may be to pass the VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT flag when creating resources that are not essential for the application (e.g. the texture of a specific object) and not to pass it when creating critically important resources (e.g. render targets).

    +

    If the size of the requested resource plus current memory usage is more than the budget, by default the library still tries to create it, leaving it to the Vulkan implementation whether the allocation succeeds or fails. You can change this behavior by using VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT flag. With it, the allocation is not made if it would exceed the budget or if the budget is already exceeded. VMA then tries to make the allocation from the next eligible Vulkan memory type. If all of them fail, the call then fails with VK_ERROR_OUT_OF_DEVICE_MEMORY. Example usage pattern may be to pass the VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT flag when creating resources that are not essential for the application (e.g. the texture of a specific object) and not to pass it when creating critically important resources (e.g. render targets).

    On AMD graphics cards there is a custom vendor extension available: VK_AMD_memory_overallocation_behavior that allows to control the behavior of the Vulkan implementation in out-of-memory cases - whether it should fail with an error code or still allow the allocation. Usage of this extension involves only passing extra structure on Vulkan device creation, so it is out of scope of this library.

    -

    Finally, you can also use VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT flag to make sure a new allocation is created only when it fits inside one of the existing memory blocks. If it would require to allocate a new block, if fails instead with VK_ERROR_OUT_OF_DEVICE_MEMORY. This also ensures that the function call is very fast because it never goes to Vulkan to obtain a new block.

    +

    Finally, you can also use VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT flag to make sure a new allocation is created only when it fits inside one of the existing memory blocks. If it would require to allocate a new block, if fails instead with VK_ERROR_OUT_OF_DEVICE_MEMORY. This also ensures that the function call is very fast because it never goes to Vulkan to obtain a new block.

    Note
    Creating Custom memory pools with VmaPoolCreateInfo::minBlockCount set to more than 0 will currently try to allocate memory blocks without checking whether they fit within budget.
    diff --git a/docs/html/struct_vma_allocation.html b/docs/html/struct_vma_allocation.html index 11e18b11..19298f14 100644 --- a/docs/html/struct_vma_allocation.html +++ b/docs/html/struct_vma_allocation.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaAllocation Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Represents single memory allocation. More...

    - -

    #include <vk_mem_alloc.h>

    -

    Detailed Description

    +

    Detailed Description

    Represents single memory allocation.

    -

    It may be either dedicated block of VkDeviceMemory or a specific region of a bigger block of this type plus unique offset.

    +

    It may be either dedicated block of VkDeviceMemory or a specific region of a bigger block of this type plus unique offset.

    There are multiple ways to create such object. You need to fill structure VmaAllocationCreateInfo. For more information see Choosing memory type.

    Although the library provides convenience functions that create Vulkan buffer or image, allocate memory for it and bind them together, binding of the allocation to a buffer or an image is out of scope of the allocation itself. Allocation object can exist without buffer/image bound, binding can be done manually by the user, and destruction of it can be done independently of destruction of the allocation.

    The object also remembers its size and some other information. To retrieve this information, use function vmaGetAllocationInfo() and inspect returned structure VmaAllocationInfo.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_allocation_create_info-members.html b/docs/html/struct_vma_allocation_create_info-members.html index c775f4aa..36a9f29d 100644 --- a/docs/html/struct_vma_allocation_create_info-members.html +++ b/docs/html/struct_vma_allocation_create_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_allocation_create_info.html b/docs/html/struct_vma_allocation_create_info.html index a850853e..583239d5 100644 --- a/docs/html/struct_vma_allocation_create_info.html +++ b/docs/html/struct_vma_allocation_create_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaAllocationCreateInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Parameters of new VmaAllocation. More...

    - -

    #include <vk_mem_alloc.h>

    - - - - - - - - -

    +

    Public Attributes

    VmaAllocationCreateFlags flags
     Use VmaAllocationCreateFlagBits enum.
     
    VmaMemoryUsage usage
     Intended usage of memory.
     
    VkMemoryPropertyFlags requiredFlags
     Flags that must be set in a Memory Type chosen for an allocation.
     
    VkMemoryPropertyFlags preferredFlags
     Flags that preferably should be set in a memory type chosen for an allocation.
     
    uint32_t memoryTypeBits
     Bitmask containing one bit set for every memory type acceptable for this allocation.
     
    VmaPool pool
     Pool that this allocation should be created in.
     
    void * pUserData
     Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo::pUserData and changed using vmaSetAllocationUserData().
     
    float priority
     A floating-point value between 0 and 1, indicating the priority of the allocation relative to other memory allocations.
     
    -

    Detailed Description

    +

    Detailed Description

    Parameters of new VmaAllocation.

    To be used with functions like vmaCreateBuffer(), vmaCreateImage(), and many others.

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ flags

    @@ -156,8 +133,8 @@

    Bitmask containing one bit set for every memory type acceptable for this allocation.

    -

    Value 0 is equivalent to UINT32_MAX - it means any memory type is accepted if it meets other requirements specified by this structure, with no further restrictions on memory type index.
    -If pool is not null, this member is ignored.

    +

    Value 0 is equivalent to UINT32_MAX - it means any memory type is accepted if it meets other requirements specified by this structure, with no further restrictions on memory type index.
    +If pool is not null, this member is ignored.

    @@ -174,7 +151,7 @@

    Pool that this allocation should be created in.

    -

    Leave VK_NULL_HANDLE to allocate from default pool. If not null, members: usage, requiredFlags, preferredFlags, memoryTypeBits are ignored.

    +

    Leave VK_NULL_HANDLE to allocate from default pool. If not null, members: usage, requiredFlags, preferredFlags, memoryTypeBits are ignored.

    @@ -192,7 +169,7 @@

    pool is not null, this member is ignored.

    @@ -244,7 +221,7 @@

    pool is not null, this member is ignored.

    @@ -262,17 +239,17 @@

    VMA_MEMORY_USAGE_UNKNOWN if you specify memory requirements in other way.
    -If pool is not null, this member is ignored.

    +If pool is not null, this member is ignored.


    The documentation for this struct was generated from the following file: diff --git a/docs/html/struct_vma_allocation_info-members.html b/docs/html/struct_vma_allocation_info-members.html index eb2eb065..544bb41b 100644 --- a/docs/html/struct_vma_allocation_info-members.html +++ b/docs/html/struct_vma_allocation_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_allocation_info.html b/docs/html/struct_vma_allocation_info.html index 7227778f..b1026d6c 100644 --- a/docs/html/struct_vma_allocation_info.html +++ b/docs/html/struct_vma_allocation_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaAllocationInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    VmaAllocationInfo Struct Reference
    - -

    #include <vk_mem_alloc.h>

    - - - - - + - - - -

    +

    Public Attributes

    uint32_t memoryType
     Memory type index that this allocation was allocated from.
     
    VkDeviceMemory deviceMemory
     Handle to Vulkan memory object.
     
    VkDeviceSize offset
     Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.
     
     Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.
    VkDeviceSize size
     Size of this allocation, in bytes.
     
    void * pMappedData
     Pointer to the beginning of this allocation as mapped data.
     
    void * pUserData
     Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vmaSetAllocationUserData().
     
    const char * pName
     Custom allocation name that was set with vmaSetAllocationName().
     
    -

    Detailed Description

    +

    Detailed Description

    Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().

    There is also an extended version of this structure that carries additional parameters: VmaAllocationInfo2.

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ deviceMemory

    @@ -168,7 +146,7 @@

    -

    Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.

    +

    Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.

    You usually don't need to use this offset. If you create a buffer or an image together with the allocation using e.g. function vmaCreateBuffer(), vmaCreateImage(), functions that operate on these resources refer to the beginning of the buffer or image, not entire device memory block. Functions like vmaMapMemory(), vmaBindBufferMemory() also refer to the beginning of the allocation and apply this offset automatically.

    It can change after the allocation is moved during Defragmentation.

    @@ -241,17 +219,17 @@

    Note
    Allocation size returned in this variable may be greater than the size requested for the resource e.g. as VkBufferCreateInfo::size. Whole size of the allocation is accessible for operations on memory e.g. using a pointer after mapping with vmaMapMemory(), but operations on the resource e.g. using vkCmdCopyBuffer must be limited to the size of the resource.

    +
    Note
    Allocation size returned in this variable may be greater than the size requested for the resource e.g. as VkBufferCreateInfo::size. Whole size of the allocation is accessible for operations on memory e.g. using a pointer after mapping with vmaMapMemory(), but operations on the resource e.g. using vkCmdCopyBuffer must be limited to the size of the resource.

    The documentation for this struct was generated from the following file: diff --git a/docs/html/struct_vma_allocation_info2-members.html b/docs/html/struct_vma_allocation_info2-members.html index 671da34c..5254b53d 100644 --- a/docs/html/struct_vma_allocation_info2-members.html +++ b/docs/html/struct_vma_allocation_info2-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_allocation_info2.html b/docs/html/struct_vma_allocation_info2.html index f2d3304d..220b2d8c 100644 --- a/docs/html/struct_vma_allocation_info2.html +++ b/docs/html/struct_vma_allocation_info2.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaAllocationInfo2 Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2(). More...

    - -

    #include <vk_mem_alloc.h>

    - - - - + - - +

    +

    Public Attributes

    VmaAllocationInfo allocationInfo
     Basic parameters of the allocation.
     
    VkDeviceSize blockSize
     Size of the VkDeviceMemory block that the allocation belongs to.
     
     Size of the VkDeviceMemory block that the allocation belongs to.
    VkBool32 dedicatedMemory
     VK_TRUE if the allocation has dedicated memory, VK_FALSE if it was placed as part of a larger memory block.
     
     VK_TRUE if the allocation has dedicated memory, VK_FALSE if it was placed as part of a larger memory block.
    -

    Detailed Description

    +

    Detailed Description

    Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ allocationInfo

    @@ -140,8 +122,8 @@

    -

    Size of the VkDeviceMemory block that the allocation belongs to.

    -

    In case of an allocation with dedicated memory, it will be equal to allocationInfo.size.

    +

    Size of the VkDeviceMemory block that the allocation belongs to.

    +

    In case of an allocation with dedicated memory, it will be equal to allocationInfo.size.

    @@ -157,18 +139,18 @@

    -

    VK_TRUE if the allocation has dedicated memory, VK_FALSE if it was placed as part of a larger memory block.

    -

    When VK_TRUE, it also means VkMemoryDedicatedAllocateInfo was used when creating the allocation (if VK_KHR_dedicated_allocation extension or Vulkan version >= 1.1 is enabled).

    +

    VK_TRUE if the allocation has dedicated memory, VK_FALSE if it was placed as part of a larger memory block.

    +

    When VK_TRUE, it also means VkMemoryDedicatedAllocateInfo was used when creating the allocation (if VK_KHR_dedicated_allocation extension or Vulkan version >= 1.1 is enabled).


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_allocator.html b/docs/html/struct_vma_allocator.html index 64d6d269..679de7ea 100644 --- a/docs/html/struct_vma_allocator.html +++ b/docs/html/struct_vma_allocator.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaAllocator Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Represents main object of this library initialized. More...

    - -

    #include <vk_mem_alloc.h>

    -

    Detailed Description

    +

    Detailed Description

    Represents main object of this library initialized.

    Fill structure VmaAllocatorCreateInfo and call function vmaCreateAllocator() to create it. Call function vmaDestroyAllocator() to destroy it.

    -

    It is recommended to create just one object of this type per VkDevice object, right after Vulkan is initialized and keep it alive until before Vulkan device is destroyed.

    +

    It is recommended to create just one object of this type per VkDevice object, right after Vulkan is initialized and keep it alive until before Vulkan device is destroyed.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_allocator_create_info-members.html b/docs/html/struct_vma_allocator_create_info-members.html index e7758bb5..f613e41b 100644 --- a/docs/html/struct_vma_allocator_create_info-members.html +++ b/docs/html/struct_vma_allocator_create_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_allocator_create_info.html b/docs/html/struct_vma_allocator_create_info.html index fc9651ec..fe71cbec 100644 --- a/docs/html/struct_vma_allocator_create_info.html +++ b/docs/html/struct_vma_allocator_create_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaAllocatorCreateInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Description of a Allocator to be created. More...

    - -

    #include <vk_mem_alloc.h>

    - - - - - - + - - - + - - - - -

    +

    Public Attributes

    VmaAllocatorCreateFlags flags
     Flags for created allocator. Use VmaAllocatorCreateFlagBits enum.
     
    VkPhysicalDevice physicalDevice
     Vulkan physical device.
     
    VkDevice device
     Vulkan device.
     
    VkDeviceSize preferredLargeHeapBlockSize
     Preferred size of a single VkDeviceMemory block to be allocated from large heaps > 1 GiB. Optional.
     
     Preferred size of a single VkDeviceMemory block to be allocated from large heaps > 1 GiB. Optional.
    const VkAllocationCallbacks * pAllocationCallbacks
     Custom CPU memory allocation callbacks. Optional.
     
    const VmaDeviceMemoryCallbackspDeviceMemoryCallbacks
     Informative callbacks for vkAllocateMemory, vkFreeMemory. Optional.
     
     Informative callbacks for vkAllocateMemory, vkFreeMemory. Optional.
    const VkDeviceSize * pHeapSizeLimit
     Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap.
     
    const VmaVulkanFunctionspVulkanFunctions
     Pointers to Vulkan functions. Can be null.
     
    VkInstance instance
     Handle to Vulkan instance object.
     
    uint32_t vulkanApiVersion
     Optional. Vulkan version that the application uses.
     
    const VkExternalMemoryHandleTypeFlagsKHR * pTypeExternalMemoryHandleTypes
     Either null or a pointer to an array of external memory handle types for each Vulkan memory type.
     
    -

    Detailed Description

    +

    Detailed Description

    Description of a Allocator to be created.

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ device

    @@ -214,7 +188,7 @@

    -

    Informative callbacks for vkAllocateMemory, vkFreeMemory. Optional.

    +

    Informative callbacks for vkAllocateMemory, vkFreeMemory. Optional.

    Optional, can be null.

    @@ -232,14 +206,14 @@

    Either null or a pointer to an array of limits on maximum number of bytes that can be allocated out of particular Vulkan memory heap.

    -

    If not NULL, it must be a pointer to an array of VkPhysicalDeviceMemoryProperties::memoryHeapCount elements, defining limit on maximum number of bytes that can be allocated out of particular Vulkan memory heap.

    -

    Any of the elements may be equal to VK_WHOLE_SIZE, which means no limit on that heap. This is also the default in case of pHeapSizeLimit = NULL.

    +

    If not NULL, it must be a pointer to an array of VkPhysicalDeviceMemoryProperties::memoryHeapCount elements, defining limit on maximum number of bytes that can be allocated out of particular Vulkan memory heap.

    +

    Any of the elements may be equal to VK_WHOLE_SIZE, which means no limit on that heap. This is also the default in case of pHeapSizeLimit = NULL.

    If there is a limit defined for a heap:

    -

    Warning! Using this feature may not be equivalent to installing a GPU with smaller amount of memory, because graphics driver doesn't necessary fail new allocations with VK_ERROR_OUT_OF_DEVICE_MEMORY result when memory capacity is exceeded. It may return success and just silently migrate some device memory blocks to system RAM. This driver behavior can also be controlled using VK_AMD_memory_overallocation_behavior extension.

    +

    Warning! Using this feature may not be equivalent to installing a GPU with smaller amount of memory, because graphics driver doesn't necessary fail new allocations with VK_ERROR_OUT_OF_DEVICE_MEMORY result when memory capacity is exceeded. It may return success and just silently migrate some device memory blocks to system RAM. This driver behavior can also be controlled using VK_AMD_memory_overallocation_behavior extension.

    @@ -272,7 +246,7 @@

    -

    Preferred size of a single VkDeviceMemory block to be allocated from large heaps > 1 GiB. Optional.

    +

    Preferred size of a single VkDeviceMemory block to be allocated from large heaps > 1 GiB. Optional.

    Set to 0 to use default, which is currently 256 MiB.

    @@ -290,8 +264,8 @@

    Either null or a pointer to an array of external memory handle types for each Vulkan memory type.

    -

    If not NULL, it must be a pointer to an array of VkPhysicalDeviceMemoryProperties::memoryTypeCount elements, defining external memory handle types of particular Vulkan memory type, to be passed using VkExportMemoryAllocateInfoKHR.

    -

    Any of the elements may be equal to 0, which means not to use VkExportMemoryAllocateInfoKHR on this memory type. This is also the default in case of pTypeExternalMemoryHandleTypes = NULL.

    +

    If not NULL, it must be a pointer to an array of VkPhysicalDeviceMemoryProperties::memoryTypeCount elements, defining external memory handle types of particular Vulkan memory type, to be passed using VkExportMemoryAllocateInfoKHR.

    +

    Any of the elements may be equal to 0, which means not to use VkExportMemoryAllocateInfoKHR on this memory type. This is also the default in case of pTypeExternalMemoryHandleTypes = NULL.

    @@ -325,17 +299,17 @@

    Optional. Vulkan version that the application uses.

    -

    It must be a value in the format as created by macro VK_MAKE_VERSION or a constant like: VK_API_VERSION_1_1, VK_API_VERSION_1_0. The patch version number specified is ignored. Only the major and minor versions are considered. Only versions 1.0...1.4 are supported by the current implementation. Leaving it initialized to zero is equivalent to VK_API_VERSION_1_0. It must match the Vulkan version used by the application and supported on the selected physical device, so it must be no higher than VkApplicationInfo::apiVersion passed to vkCreateInstance and no higher than VkPhysicalDeviceProperties::apiVersion found on the physical device used.

    +

    It must be a value in the format as created by macro VK_MAKE_VERSION or a constant like: VK_API_VERSION_1_1, VK_API_VERSION_1_0. The patch version number specified is ignored. Only the major and minor versions are considered. Only versions 1.0...1.4 are supported by the current implementation. Leaving it initialized to zero is equivalent to VK_API_VERSION_1_0. It must match the Vulkan version used by the application and supported on the selected physical device, so it must be no higher than VkApplicationInfo::apiVersion passed to vkCreateInstance and no higher than VkPhysicalDeviceProperties::apiVersion found on the physical device used.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_allocator_info-members.html b/docs/html/struct_vma_allocator_info-members.html index b1609705..3045a2ce 100644 --- a/docs/html/struct_vma_allocator_info-members.html +++ b/docs/html/struct_vma_allocator_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_allocator_info.html b/docs/html/struct_vma_allocator_info.html index c548851f..152c1a97 100644 --- a/docs/html/struct_vma_allocator_info.html +++ b/docs/html/struct_vma_allocator_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaAllocatorInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Information about existing VmaAllocator object. More...

    - -

    #include <vk_mem_alloc.h>

    - - - -

    +

    Public Attributes

    VkInstance instance
     Handle to Vulkan instance object.
     
    VkPhysicalDevice physicalDevice
     Handle to Vulkan physical device object.
     
    VkDevice device
     Handle to Vulkan device object.
     
    -

    Detailed Description

    +

    Detailed Description

    Information about existing VmaAllocator object.

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ device

    @@ -163,12 +145,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_budget-members.html b/docs/html/struct_vma_budget-members.html index 83106c32..e47b0626 100644 --- a/docs/html/struct_vma_budget-members.html +++ b/docs/html/struct_vma_budget-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_budget.html b/docs/html/struct_vma_budget.html index 34a68da3..61fd1157 100644 --- a/docs/html/struct_vma_budget.html +++ b/docs/html/struct_vma_budget.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaBudget Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Statistics of current memory usage and available budget for a specific memory heap. More...

    - -

    #include <vk_mem_alloc.h>

    - - - -

    +

    Public Attributes

    VmaStatistics statistics
     Statistics fetched from the library.
     
    VkDeviceSize usage
     Estimated current memory usage of the program, in bytes.
     
    VkDeviceSize budget
     Estimated amount of memory available to the program, in bytes.
     
    -

    Detailed Description

    +

    Detailed Description

    Statistics of current memory usage and available budget for a specific memory heap.

    These are fast to calculate. See function vmaGetHeapBudgets().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ budget

    @@ -126,7 +108,7 @@

    VkMemoryHeap::size[heapIndex] due to factors external to the program, decided by the operating system. Difference budget - usage is the amount of additional memory that can probably be allocated without problems. Exceeding the budget may result in various problems.

    @@ -160,17 +142,17 @@

    statistics.blockBytes (usually higher) due to additional implicit objects also occupying the memory, like swapchain, pipelines, descriptor heaps, command buffers, or VkDeviceMemory blocks allocated outside of this library, if any.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_defragmentation_context.html b/docs/html/struct_vma_defragmentation_context.html index 1605e3e4..005a0fd1 100644 --- a/docs/html/struct_vma_defragmentation_context.html +++ b/docs/html/struct_vma_defragmentation_context.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaDefragmentationContext Struct Reference - - @@ -33,33 +31,22 @@ - + -
    An opaque object that represents started defragmentation process. More...

    - -

    #include <vk_mem_alloc.h>

    -

    Detailed Description

    +

    Detailed Description

    An opaque object that represents started defragmentation process.

    Fill structure VmaDefragmentationInfo and call function vmaBeginDefragmentation() to create it. Call function vmaEndDefragmentation() to destroy it.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_defragmentation_info-members.html b/docs/html/struct_vma_defragmentation_info-members.html index 5902c95a..29ab3e87 100644 --- a/docs/html/struct_vma_defragmentation_info-members.html +++ b/docs/html/struct_vma_defragmentation_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_defragmentation_info.html b/docs/html/struct_vma_defragmentation_info.html index 6c423fa1..64b7eac1 100644 --- a/docs/html/struct_vma_defragmentation_info.html +++ b/docs/html/struct_vma_defragmentation_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaDefragmentationInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Parameters for defragmentation. More...

    - -

    #include <vk_mem_alloc.h>

    - - - - - - -

    +

    Public Attributes

    VmaDefragmentationFlags flags
     Use combination of VmaDefragmentationFlagBits.
     
    VmaPool pool
     Custom pool to be defragmented.
     
    VkDeviceSize maxBytesPerPass
     Maximum numbers of bytes that can be copied during single pass, while moving allocations to different places.
     
    uint32_t maxAllocationsPerPass
     Maximum number of allocations that can be moved during single pass to a different place.
     
    PFN_vmaCheckDefragmentationBreakFunction pfnBreakCallback
     Optional custom callback for stopping vmaBeginDefragmentation().
     
    void * pBreakCallbackUserData
     Optional data to pass to custom callback for stopping pass of defragmentation.
     
    -

    Detailed Description

    +

    Detailed Description

    Parameters for defragmentation.

    To be used with function vmaBeginDefragmentation().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ flags

    @@ -150,7 +129,7 @@

    Maximum number of allocations that can be moved during single pass to a different place.

    -

    0 means no limit.

    +

    0 means no limit.

    @@ -167,7 +146,7 @@

    Maximum numbers of bytes that can be copied during single pass, while moving allocations to different places.

    -

    0 means no limit.

    +

    0 means no limit.

    @@ -222,12 +201,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_defragmentation_move-members.html b/docs/html/struct_vma_defragmentation_move-members.html index 97b280f4..96a75e24 100644 --- a/docs/html/struct_vma_defragmentation_move-members.html +++ b/docs/html/struct_vma_defragmentation_move-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_defragmentation_move.html b/docs/html/struct_vma_defragmentation_move.html index 6de1f115..2618863b 100644 --- a/docs/html/struct_vma_defragmentation_move.html +++ b/docs/html/struct_vma_defragmentation_move.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaDefragmentationMove Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Single move of an allocation to be done for defragmentation. More...

    - -

    #include <vk_mem_alloc.h>

    - - - - - +

    +

    Public Attributes

    VmaDefragmentationMoveOperation operation
     Operation to be performed on the allocation by vmaEndDefragmentationPass(). Default value is VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY. You can modify it.
     
    VmaAllocation srcAllocation
     Allocation that should be moved.
     
    VmaAllocation dstTmpAllocation
     Temporary allocation pointing to destination memory that will replace srcAllocation.
     
     Temporary allocation pointing to destination memory that will replace srcAllocation.
    -

    Detailed Description

    +

    Detailed Description

    Single move of an allocation to be done for defragmentation.

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ dstTmpAllocation

    @@ -123,8 +105,8 @@

    -

    Temporary allocation pointing to destination memory that will replace srcAllocation.

    -
    Warning
    Do not store this allocation in your data structures! It exists only temporarily, for the duration of the defragmentation pass, to be used for binding new buffer/image to the destination memory using e.g. vmaBindBufferMemory(). vmaEndDefragmentationPass() will destroy it and make srcAllocation point to this memory.
    +

    Temporary allocation pointing to destination memory that will replace srcAllocation.

    +
    Warning
    Do not store this allocation in your data structures! It exists only temporarily, for the duration of the defragmentation pass, to be used for binding new buffer/image to the destination memory using e.g. vmaBindBufferMemory(). vmaEndDefragmentationPass() will destroy it and make srcAllocation point to this memory.
    @@ -161,12 +143,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_defragmentation_pass_move_info-members.html b/docs/html/struct_vma_defragmentation_pass_move_info-members.html index c21f6b1c..78ba975c 100644 --- a/docs/html/struct_vma_defragmentation_pass_move_info-members.html +++ b/docs/html/struct_vma_defragmentation_pass_move_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_defragmentation_pass_move_info.html b/docs/html/struct_vma_defragmentation_pass_move_info.html index bbe0ea7f..c1eece48 100644 --- a/docs/html/struct_vma_defragmentation_pass_move_info.html +++ b/docs/html/struct_vma_defragmentation_pass_move_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaDefragmentationPassMoveInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Parameters for incremental defragmentation steps. More...

    - -

    #include <vk_mem_alloc.h>

    - - - + -

    +

    Public Attributes

    uint32_t moveCount
     Number of elements in the pMoves array.
     
     Number of elements in the pMoves array.
    VmaDefragmentationMovepMoves
     Array of moves to be performed by the user in the current defragmentation pass.
     
    -

    Detailed Description

    +

    Detailed Description

    Parameters for incremental defragmentation steps.

    To be used with function vmaBeginDefragmentationPass().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ moveCount

    @@ -121,7 +104,7 @@

    -

    Number of elements in the pMoves array.

    +

    Number of elements in the pMoves array.

    @@ -138,11 +121,11 @@

    Array of moves to be performed by the user in the current defragmentation pass.

    -

    Pointer to an array of moveCount elements, owned by VMA, created in vmaBeginDefragmentationPass(), destroyed in vmaEndDefragmentationPass().

    +

    Pointer to an array of moveCount elements, owned by VMA, created in vmaBeginDefragmentationPass(), destroyed in vmaEndDefragmentationPass().

    For each element, you should:

    1. Create a new buffer/image in the place pointed by VmaDefragmentationMove::dstMemory + VmaDefragmentationMove::dstOffset.
    2. -
    3. Copy data from the VmaDefragmentationMove::srcAllocation e.g. using vkCmdCopyBuffer, vkCmdCopyImage.
    4. +
    5. Copy data from the VmaDefragmentationMove::srcAllocation e.g. using vkCmdCopyBuffer, vkCmdCopyImage.
    6. Make sure these commands finished executing on the GPU.
    7. Destroy the old buffer/image.
    @@ -158,12 +141,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_defragmentation_stats-members.html b/docs/html/struct_vma_defragmentation_stats-members.html index f00234ce..432d1ea1 100644 --- a/docs/html/struct_vma_defragmentation_stats-members.html +++ b/docs/html/struct_vma_defragmentation_stats-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_defragmentation_stats.html b/docs/html/struct_vma_defragmentation_stats.html index 83a7b36f..9a7cff55 100644 --- a/docs/html/struct_vma_defragmentation_stats.html +++ b/docs/html/struct_vma_defragmentation_stats.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaDefragmentationStats Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Statistics returned for defragmentation process in function vmaEndDefragmentation(). More...

    - -

    #include <vk_mem_alloc.h>

    - - - - + - - - +

    +

    Public Attributes

    VkDeviceSize bytesMoved
     Total number of bytes that have been copied while moving allocations to different places.
     
    VkDeviceSize bytesFreed
     Total number of bytes that have been released to the system by freeing empty VkDeviceMemory objects.
     
     Total number of bytes that have been released to the system by freeing empty VkDeviceMemory objects.
    uint32_t allocationsMoved
     Number of allocations that have been moved to different places.
     
    uint32_t deviceMemoryBlocksFreed
     Number of empty VkDeviceMemory objects that have been released to the system.
     
     Number of empty VkDeviceMemory objects that have been released to the system.
    -

    Detailed Description

    +

    Detailed Description

    Statistics returned for defragmentation process in function vmaEndDefragmentation().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ allocationsMoved

    @@ -142,7 +123,7 @@

    -

    Total number of bytes that have been released to the system by freeing empty VkDeviceMemory objects.

    +

    Total number of bytes that have been released to the system by freeing empty VkDeviceMemory objects.

    @@ -174,17 +155,17 @@

    -

    Number of empty VkDeviceMemory objects that have been released to the system.

    +

    Number of empty VkDeviceMemory objects that have been released to the system.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_detailed_statistics-members.html b/docs/html/struct_vma_detailed_statistics-members.html index 592e3887..4bec0965 100644 --- a/docs/html/struct_vma_detailed_statistics-members.html +++ b/docs/html/struct_vma_detailed_statistics-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_detailed_statistics.html b/docs/html/struct_vma_detailed_statistics.html index 982ddfb9..d0d1ab86 100644 --- a/docs/html/struct_vma_detailed_statistics.html +++ b/docs/html/struct_vma_detailed_statistics.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaDetailedStatistics Struct Reference - - @@ -33,33 +31,22 @@ - + -
    More detailed statistics than VmaStatistics. More...

    - -

    #include <vk_mem_alloc.h>

    - - - - - + - - - + -

    +

    Public Attributes

    VmaStatistics statistics
     Basic statistics.
     
    uint32_t unusedRangeCount
     Number of free ranges of memory between allocations.
     
    VkDeviceSize allocationSizeMin
     Smallest allocation size. VK_WHOLE_SIZE if there are 0 allocations.
     
     Smallest allocation size. VK_WHOLE_SIZE if there are 0 allocations.
    VkDeviceSize allocationSizeMax
     Largest allocation size. 0 if there are 0 allocations.
     
    VkDeviceSize unusedRangeSizeMin
     Smallest empty range size. VK_WHOLE_SIZE if there are 0 empty ranges.
     
     Smallest empty range size. VK_WHOLE_SIZE if there are 0 empty ranges.
    VkDeviceSize unusedRangeSizeMax
     Largest empty range size. 0 if there are 0 empty ranges.
     
    -

    Detailed Description

    +

    Detailed Description

    More detailed statistics than VmaStatistics.

    These are slower to calculate. Use for debugging purposes. See functions: vmaCalculateStatistics(), vmaCalculatePoolStatistics().

    Previous version of the statistics API provided averages, but they have been removed because they can be easily calculated as:

    VkDeviceSize allocationSizeAvg = detailedStats.statistics.allocationBytes / detailedStats.statistics.allocationCount;
    VkDeviceSize unusedBytes = detailedStats.statistics.blockBytes - detailedStats.statistics.allocationBytes;
    VkDeviceSize unusedRangeSizeAvg = unusedBytes / detailedStats.unusedRangeCount;
    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ allocationSizeMax

    @@ -153,7 +132,7 @@

    -

    Smallest allocation size. VK_WHOLE_SIZE if there are 0 allocations.

    +

    Smallest allocation size. VK_WHOLE_SIZE if there are 0 allocations.

    @@ -217,17 +196,17 @@

    -

    Smallest empty range size. VK_WHOLE_SIZE if there are 0 empty ranges.

    +

    Smallest empty range size. VK_WHOLE_SIZE if there are 0 empty ranges.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_device_memory_callbacks-members.html b/docs/html/struct_vma_device_memory_callbacks-members.html index 45b16845..12598604 100644 --- a/docs/html/struct_vma_device_memory_callbacks-members.html +++ b/docs/html/struct_vma_device_memory_callbacks-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_device_memory_callbacks.html b/docs/html/struct_vma_device_memory_callbacks.html index 0dcdb3be..b6786526 100644 --- a/docs/html/struct_vma_device_memory_callbacks.html +++ b/docs/html/struct_vma_device_memory_callbacks.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaDeviceMemoryCallbacks Struct Reference - - @@ -33,33 +31,22 @@ - + -
    -

    Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. +

    Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More...

    - -

    #include <vk_mem_alloc.h>

    - - - -

    +

    Public Attributes

    PFN_vmaAllocateDeviceMemoryFunction pfnAllocate
     Optional, can be null.
     
    PFN_vmaFreeDeviceMemoryFunction pfnFree
     Optional, can be null.
     
    void * pUserData
     Optional, can be null.
     
    -

    Detailed Description

    -

    Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.

    +

    Detailed Description

    +

    Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.

    Provided for informative purpose, e.g. to gather statistics about number of allocations or total amount of memory allocated in Vulkan.

    Used in VmaAllocatorCreateInfo::pDeviceMemoryCallbacks.

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ pfnAllocate

    @@ -162,12 +144,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_pool.html b/docs/html/struct_vma_pool.html index 5ec52cd8..b2136205 100644 --- a/docs/html/struct_vma_pool.html +++ b/docs/html/struct_vma_pool.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaPool Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Represents custom memory pool. More...

    - -

    #include <vk_mem_alloc.h>

    -

    Detailed Description

    +

    Detailed Description

    Represents custom memory pool.

    Fill structure VmaPoolCreateInfo and call function vmaCreatePool() to create it. Call function vmaDestroyPool() to destroy it.

    For more information see Custom memory pools.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_pool_create_info-members.html b/docs/html/struct_vma_pool_create_info-members.html index 6e8ec6d1..7c8f047d 100644 --- a/docs/html/struct_vma_pool_create_info-members.html +++ b/docs/html/struct_vma_pool_create_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_pool_create_info.html b/docs/html/struct_vma_pool_create_info.html index cc0d55de..44788657 100644 --- a/docs/html/struct_vma_pool_create_info.html +++ b/docs/html/struct_vma_pool_create_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaPoolCreateInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Describes parameter of created VmaPool. More...

    - -

    #include <vk_mem_alloc.h>

    - - - - - + - - - - - - +

    +

    Public Attributes

    uint32_t memoryTypeIndex
     Vulkan memory type index to allocate this pool from.
     
    VmaPoolCreateFlags flags
     Use combination of VmaPoolCreateFlagBits.
     
    VkDeviceSize blockSize
     Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes. Optional.
     
     Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes. Optional.
    size_t minBlockCount
     Minimum number of blocks to be always allocated in this pool, even if they stay empty.
     
    size_t maxBlockCount
     Maximum number of blocks that can be allocated in this pool. Optional.
     
    float priority
     A floating-point value between 0 and 1, indicating the priority of the allocations in this pool relative to other memory allocations.
     
    VkDeviceSize minAllocationAlignment
     Additional minimum alignment to be used for all allocations created from this pool. Can be 0.
     
    void *VkMemoryAllocateInfo pMemoryAllocateNext
     Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this pool. Optional.
     
     Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this pool. Optional.
    -

    Detailed Description

    +

    Detailed Description

    Describes parameter of created VmaPool.

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ blockSize

    @@ -138,7 +115,7 @@

    -

    Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes. Optional.

    +

    Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes. Optional.

    Specify nonzero to set explicit, constant size of memory blocks used by this pool.

    Leave 0 to use default and let the library manage block sizes automatically. Sizes of particular blocks may vary. In this case, the pool will also support dedicated allocations.

    @@ -173,7 +150,7 @@

    Maximum number of blocks that can be allocated in this pool. Optional.

    -

    Set to 0 to use default, which is SIZE_MAX, which means no limit.

    +

    Set to 0 to use default, which is SIZE_MAX, which means no limit.

    Set to same value as VmaPoolCreateInfo::minBlockCount to have fixed amount of memory allocated throughout whole lifetime of this pool.

    @@ -207,7 +184,7 @@

    Additional minimum alignment to be used for all allocations created from this pool. Can be 0.

    -

    Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two. It can be useful in cases where alignment returned by Vulkan by functions like vkGetBufferMemoryRequirements is not enough, e.g. when doing interop with OpenGL.

    +

    Leave 0 (default) not to impose any additional alignment. If not 0, it must be a power of two. It can be useful in cases where alignment returned by Vulkan by functions like vkGetBufferMemoryRequirements is not enough, e.g. when doing interop with OpenGL.

    @@ -240,9 +217,9 @@

    -

    Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this pool. Optional.

    -

    Optional, can be null. If not null, it must point to a pNext chain of structures that can be attached to VkMemoryAllocateInfo. It can be useful for special needs such as adding VkExportMemoryAllocateInfoKHR. Structures pointed by this member must remain alive and unchanged for the whole lifetime of the custom pool.

    -

    Please note that some structures, e.g. VkMemoryPriorityAllocateInfoEXT, VkMemoryDedicatedAllocateInfoKHR, can be attached automatically by this library when using other, more convenient of its features.

    +

    Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this pool. Optional.

    +

    Optional, can be null. If not null, it must point to a pNext chain of structures that can be attached to VkMemoryAllocateInfo. It can be useful for special needs such as adding VkExportMemoryAllocateInfoKHR. Structures pointed by this member must remain alive and unchanged for the whole lifetime of the custom pool.

    +

    Please note that some structures, e.g. VkMemoryPriorityAllocateInfoEXT, VkMemoryDedicatedAllocateInfoKHR, can be attached automatically by this library when using other, more convenient of its features.

    @@ -264,12 +241,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_statistics-members.html b/docs/html/struct_vma_statistics-members.html index 94be09ab..c645f9c0 100644 --- a/docs/html/struct_vma_statistics-members.html +++ b/docs/html/struct_vma_statistics-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_statistics.html b/docs/html/struct_vma_statistics.html index 245ab012..6175f27f 100644 --- a/docs/html/struct_vma_statistics.html +++ b/docs/html/struct_vma_statistics.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaStatistics Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total. More...

    - -

    #include <vk_mem_alloc.h>

    - - - + - - - + -

    +

    Public Attributes

    uint32_t blockCount
     Number of VkDeviceMemory objects - Vulkan memory blocks allocated.
     
     Number of VkDeviceMemory objects - Vulkan memory blocks allocated.
    uint32_t allocationCount
     Number of VmaAllocation objects allocated.
     
    VkDeviceSize blockBytes
     Number of bytes allocated in VkDeviceMemory blocks.
     
     Number of bytes allocated in VkDeviceMemory blocks.
    VkDeviceSize allocationBytes
     Total number of bytes occupied by all VmaAllocation objects.
     
    -

    Detailed Description

    +

    Detailed Description

    Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total.

    These are fast to calculate. See functions: vmaGetHeapBudgets(), vmaGetPoolStatistics().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ allocationBytes

    @@ -128,7 +109,7 @@

    Total number of bytes occupied by all VmaAllocation objects.

    -

    Always less or equal than blockBytes. Difference (blockBytes - allocationBytes) is the amount of memory allocated from Vulkan but unused by any VmaAllocation.

    +

    Always less or equal than blockBytes. Difference (blockBytes - allocationBytes) is the amount of memory allocated from Vulkan but unused by any VmaAllocation.

    @@ -145,7 +126,7 @@

    Number of VmaAllocation objects allocated.

    -

    Dedicated allocations have their own blocks, so each one adds 1 to allocationCount as well as blockCount.

    +

    Dedicated allocations have their own blocks, so each one adds 1 to allocationCount as well as blockCount.

    @@ -161,8 +142,8 @@

    -

    Number of bytes allocated in VkDeviceMemory blocks.

    -
    Note
    To avoid confusion, please be aware that what Vulkan calls an "allocation" - a whole VkDeviceMemory object (e.g. as in VkPhysicalDeviceLimits::maxMemoryAllocationCount) is called a "block" in VMA, while VMA calls "allocation" a VmaAllocation object that represents a memory region sub-allocated from such block, usually for a single buffer or image.
    +

    Number of bytes allocated in VkDeviceMemory blocks.

    +
    Note
    To avoid confusion, please be aware that what Vulkan calls an "allocation" - a whole VkDeviceMemory object (e.g. as in VkPhysicalDeviceLimits::maxMemoryAllocationCount) is called a "block" in VMA, while VMA calls "allocation" a VmaAllocation object that represents a memory region sub-allocated from such block, usually for a single buffer or image.
    @@ -178,17 +159,17 @@

    -

    Number of VkDeviceMemory objects - Vulkan memory blocks allocated.

    +

    Number of VkDeviceMemory objects - Vulkan memory blocks allocated.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_total_statistics-members.html b/docs/html/struct_vma_total_statistics-members.html index aa344d1a..aa335a85 100644 --- a/docs/html/struct_vma_total_statistics-members.html +++ b/docs/html/struct_vma_total_statistics-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_total_statistics.html b/docs/html/struct_vma_total_statistics.html index 935cea3d..5004f63f 100644 --- a/docs/html/struct_vma_total_statistics.html +++ b/docs/html/struct_vma_total_statistics.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaTotalStatistics Struct Reference - - @@ -33,33 +31,22 @@ - + -
    General statistics from current state of the Allocator - total memory usage across all memory heaps and types. More...

    - -

    #include <vk_mem_alloc.h>

    - - - -

    +

    Public Attributes

    VmaDetailedStatistics memoryType [VK_MAX_MEMORY_TYPES]
     
    VmaDetailedStatistics memoryHeap [VK_MAX_MEMORY_HEAPS]
     
    VmaDetailedStatistics total
     
    -

    Detailed Description

    +

    Detailed Description

    General statistics from current state of the Allocator - total memory usage across all memory heaps and types.

    These are slower to calculate. Use for debugging purposes. See function vmaCalculateStatistics().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ memoryHeap

    @@ -152,12 +134,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_virtual_allocation.html b/docs/html/struct_vma_virtual_allocation.html index 83b9b508..3ce6d553 100644 --- a/docs/html/struct_vma_virtual_allocation.html +++ b/docs/html/struct_vma_virtual_allocation.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaVirtualAllocation Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Represents single memory allocation done inside VmaVirtualBlock. More...

    - -

    #include <vk_mem_alloc.h>

    -

    Detailed Description

    +

    Detailed Description

    Represents single memory allocation done inside VmaVirtualBlock.

    Use it as a unique identifier to virtual allocation within the single block.

    -

    Use value VK_NULL_HANDLE to represent a null/invalid allocation.

    +

    Use value VK_NULL_HANDLE to represent a null/invalid allocation.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_virtual_allocation_create_info-members.html b/docs/html/struct_vma_virtual_allocation_create_info-members.html index 3641493d..98466cab 100644 --- a/docs/html/struct_vma_virtual_allocation_create_info-members.html +++ b/docs/html/struct_vma_virtual_allocation_create_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_virtual_allocation_create_info.html b/docs/html/struct_vma_virtual_allocation_create_info.html index 54d8da72..6a94e755 100644 --- a/docs/html/struct_vma_virtual_allocation_create_info.html +++ b/docs/html/struct_vma_virtual_allocation_create_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaVirtualAllocationCreateInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). More...

    - -

    #include <vk_mem_alloc.h>

    - - - - -

    +

    Public Attributes

    VkDeviceSize size
     Size of the allocation.
     
    VkDeviceSize alignment
     Required alignment of the allocation. Optional.
     
    VmaVirtualAllocationCreateFlags flags
     Use combination of VmaVirtualAllocationCreateFlagBits.
     
    void * pUserData
     Custom pointer to be associated with the allocation. Optional.
     
    -

    Detailed Description

    +

    Detailed Description

    Parameters of created virtual allocation to be passed to vmaVirtualAllocate().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ alignment

    @@ -182,12 +163,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_virtual_allocation_info-members.html b/docs/html/struct_vma_virtual_allocation_info-members.html index a3854f36..37c3308b 100644 --- a/docs/html/struct_vma_virtual_allocation_info-members.html +++ b/docs/html/struct_vma_virtual_allocation_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_virtual_allocation_info.html b/docs/html/struct_vma_virtual_allocation_info.html index 5be6a92f..652d7c9d 100644 --- a/docs/html/struct_vma_virtual_allocation_info.html +++ b/docs/html/struct_vma_virtual_allocation_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaVirtualAllocationInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo(). More...

    - -

    #include <vk_mem_alloc.h>

    - - - -

    +

    Public Attributes

    VkDeviceSize offset
     Offset of the allocation.
     
    VkDeviceSize size
     Size of the allocation.
     
    void * pUserData
     Custom pointer associated with the allocation.
     
    -

    Detailed Description

    +

    Detailed Description

    Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ offset

    @@ -163,12 +145,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_virtual_block.html b/docs/html/struct_vma_virtual_block.html index 0de41c56..37141ef2 100644 --- a/docs/html/struct_vma_virtual_block.html +++ b/docs/html/struct_vma_virtual_block.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaVirtualBlock Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Handle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory. More...

    - -

    #include <vk_mem_alloc.h>

    -

    Detailed Description

    +

    Detailed Description

    Handle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory.

    Fill in VmaVirtualBlockCreateInfo structure and use vmaCreateVirtualBlock() to create it. Use vmaDestroyVirtualBlock() to destroy it. For more information, see documentation chapter Virtual allocator.

    This object is not thread-safe - should not be used from multiple threads simultaneously, must be synchronized externally.


    The documentation for this struct was generated from the following file:
    diff --git a/docs/html/struct_vma_virtual_block_create_info-members.html b/docs/html/struct_vma_virtual_block_create_info-members.html index e45aa085..7e2e65b1 100644 --- a/docs/html/struct_vma_virtual_block_create_info-members.html +++ b/docs/html/struct_vma_virtual_block_create_info-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_virtual_block_create_info.html b/docs/html/struct_vma_virtual_block_create_info.html index 2907208b..a8c3e7bd 100644 --- a/docs/html/struct_vma_virtual_block_create_info.html +++ b/docs/html/struct_vma_virtual_block_create_info.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaVirtualBlockCreateInfo Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). More...

    - -

    #include <vk_mem_alloc.h>

    - - - -

    +

    Public Attributes

    VkDeviceSize size
     Total size of the virtual block.
     
    VmaVirtualBlockCreateFlags flags
     Use combination of VmaVirtualBlockCreateFlagBits.
     
    const VkAllocationCallbacks * pAllocationCallbacks
     Custom CPU memory allocation callbacks. Optional.
     
    -

    Detailed Description

    +

    Detailed Description

    Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ flags

    @@ -162,12 +144,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/struct_vma_vulkan_functions-members.html b/docs/html/struct_vma_vulkan_functions-members.html index 3e9f2f59..049d89b4 100644 --- a/docs/html/struct_vma_vulkan_functions-members.html +++ b/docs/html/struct_vma_vulkan_functions-members.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Member List - - @@ -33,33 +31,22 @@ - + -
    diff --git a/docs/html/struct_vma_vulkan_functions.html b/docs/html/struct_vma_vulkan_functions.html index 0aa95322..973b727f 100644 --- a/docs/html/struct_vma_vulkan_functions.html +++ b/docs/html/struct_vma_vulkan_functions.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VmaVulkanFunctions Struct Reference - - @@ -33,33 +31,22 @@ - + -
    Pointers to some Vulkan functions - a subset used by the library. More...

    - -

    #include <vk_mem_alloc.h>

    - - - - - - - - - - - - - - - - - - - - - - - - - - - -

    +

    Public Attributes

    PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr
     Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS.
     
    PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr
     Required when using VMA_DYNAMIC_VULKAN_FUNCTIONS.
     
    PFN_vkGetPhysicalDeviceProperties vkGetPhysicalDeviceProperties
     
    PFN_vkGetPhysicalDeviceMemoryProperties vkGetPhysicalDeviceMemoryProperties
     
    PFN_vkAllocateMemory vkAllocateMemory
     
    PFN_vkFreeMemory vkFreeMemory
     
    PFN_vkMapMemory vkMapMemory
     
    PFN_vkUnmapMemory vkUnmapMemory
     
    PFN_vkFlushMappedMemoryRanges vkFlushMappedMemoryRanges
     
    PFN_vkInvalidateMappedMemoryRanges vkInvalidateMappedMemoryRanges
     
    PFN_vkBindBufferMemory vkBindBufferMemory
     
    PFN_vkBindImageMemory vkBindImageMemory
     
    PFN_vkGetBufferMemoryRequirements vkGetBufferMemoryRequirements
     
    PFN_vkGetImageMemoryRequirements vkGetImageMemoryRequirements
     
    PFN_vkCreateBuffer vkCreateBuffer
     
    PFN_vkDestroyBuffer vkDestroyBuffer
     
    PFN_vkCreateImage vkCreateImage
     
    PFN_vkDestroyImage vkDestroyImage
     
    PFN_vkCmdCopyBuffer vkCmdCopyBuffer
     
    PFN_vkGetBufferMemoryRequirements2KHR vkGetBufferMemoryRequirements2KHR
     Fetch "vkGetBufferMemoryRequirements2" on Vulkan >= 1.1, fetch "vkGetBufferMemoryRequirements2KHR" when using VK_KHR_dedicated_allocation extension.
     
    PFN_vkGetImageMemoryRequirements2KHR vkGetImageMemoryRequirements2KHR
     Fetch "vkGetImageMemoryRequirements2" on Vulkan >= 1.1, fetch "vkGetImageMemoryRequirements2KHR" when using VK_KHR_dedicated_allocation extension.
     
    PFN_vkBindBufferMemory2KHR vkBindBufferMemory2KHR
     Fetch "vkBindBufferMemory2" on Vulkan >= 1.1, fetch "vkBindBufferMemory2KHR" when using VK_KHR_bind_memory2 extension.
     
    PFN_vkBindImageMemory2KHR vkBindImageMemory2KHR
     Fetch "vkBindImageMemory2" on Vulkan >= 1.1, fetch "vkBindImageMemory2KHR" when using VK_KHR_bind_memory2 extension.
     
    PFN_vkGetPhysicalDeviceMemoryProperties2KHR vkGetPhysicalDeviceMemoryProperties2KHR
     Fetch from "vkGetPhysicalDeviceMemoryProperties2" on Vulkan >= 1.1, but you can also fetch it from "vkGetPhysicalDeviceMemoryProperties2KHR" if you enabled extension VK_KHR_get_physical_device_properties2.
     
    PFN_vkGetDeviceBufferMemoryRequirementsKHR vkGetDeviceBufferMemoryRequirements
     Fetch from "vkGetDeviceBufferMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceBufferMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4.
     
    PFN_vkGetDeviceImageMemoryRequirementsKHR vkGetDeviceImageMemoryRequirements
     Fetch from "vkGetDeviceImageMemoryRequirements" on Vulkan >= 1.3, but you can also fetch it from "vkGetDeviceImageMemoryRequirementsKHR" if you enabled extension VK_KHR_maintenance4.
     
    PFN_vkGetMemoryWin32HandleKHR vkGetMemoryWin32HandleKHR
     
    -

    Detailed Description

    +

    Detailed Description

    Pointers to some Vulkan functions - a subset used by the library.

    Used in VmaAllocatorCreateInfo::pVulkanFunctions.

    -

    Member Data Documentation

    +

    Member Data Documentation

    ◆ vkAllocateMemory

    @@ -563,12 +521,12 @@

    vk_mem_alloc.h +
  • C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h
  • diff --git a/docs/html/tabs.css b/docs/html/tabs.css index 7fa4268a..84f33ae7 100644 --- a/docs/html/tabs.css +++ b/docs/html/tabs.css @@ -1 +1 @@ -.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:var(--nav-gradient-image)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:var(--nav-text-normal-shadow);color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:var(--nav-menu-toggle-color);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:var(--nav-gradient-image);line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:var(--nav-text-normal-color) transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:var(--nav-separator-image);background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox a:hover span.sub-arrow{border-color:var(--nav-text-hover-color) transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent var(--nav-menu-foreground-color);border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important}.sm-dox ul a:hover{background-image:var(--nav-gradient-active-image);background-repeat:repeat-x;color:var(--nav-text-hover-color);text-shadow:var(--nav-text-hover-shadow)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent var(--nav-text-hover-color)}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:var(--nav-gradient-image)}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:var(--nav-menu-button-color);-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-color:var(--nav-menu-background-color)}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:var(--font-family-nav);font-size:13px;line-height:36px;text-decoration:none;color:var(--nav-text-normal-color);outline:0}.sm-dox a:hover{background-color:var(--nav-menu-active-bg);border-radius:5px}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:var(--nav-menu-background-color)}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:var(--nav-menu-background-color);background-image:none}.sm-dox ul a:hover{background-color:var(--nav-menu-active-bg);border-radius:5px}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-color:var(--nav-menu-background-color);line-height:36px}.sm-dox a span.sub-arrow{top:15px;right:10px;box-sizing:content-box;padding:0;margin:0;display:inline-block;width:5px;height:5px;background-color:var(--nav-menu-background-color);border-right:2px solid var(--nav-arrow-color);border-bottom:2px solid var(--nav-arrow-color);transform:rotate(45deg);-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 6px}.sm-dox a:hover{background-color:var(--nav-menu-active-bg);border-radius:5px !important}.sm-dox a:hover span.sub-arrow{background-color:var(--nav-menu-active-bg);border-right:2px solid var(--nav-arrow-selected-color);border-bottom:2px solid var(--nav-arrow-selected-color)}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0;padding:3px}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent var(--nav-menu-background-color) transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:var(--nav-menu-background-color);-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{transform:rotate(-45deg)}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:var(--nav-menu-foreground-color);background-image:none;border:0 !important}.sm-dox ul a:hover{background-color:var(--nav-menu-active-bg);border-radius:5px}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:var(--nav-menu-background-color);height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent var(--nav-menu-foreground-color) transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:var(--nav-menu-foreground-color) transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:6px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:6px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:var(--nav-menu-background-color)}} diff --git a/docs/html/topics.html b/docs/html/topics.html index 814aa1bf..455533a9 100644 --- a/docs/html/topics.html +++ b/docs/html/topics.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Topics - - @@ -33,35 +31,24 @@ - +
    -
    diff --git a/docs/html/usage_patterns.html b/docs/html/usage_patterns.html index 97ff999c..f0ae1e7c 100644 --- a/docs/html/usage_patterns.html +++ b/docs/html/usage_patterns.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Recommended usage patterns - - @@ -33,33 +31,22 @@
    - + -
    -
    Recommended usage patterns
    +
    Recommended usage patterns

    Vulkan gives great flexibility in memory allocation. This chapter shows the most common patterns.

    See also slides from talk: Sawicki, Adam. Advanced Graphics Techniques Tutorial: Memory management in Vulkan and DX12. Game Developers Conference, 2018

    -

    +

    GPU-only resource

    When: Any resources that you frequently write and read on GPU, e.g. images used as color attachments (aka "render targets"), depth-stencil attachments, images/buffers used as storage image/buffer (aka "Unordered Access View (UAV)").

    -

    What to do: Let the library select the optimal memory type, which will likely have VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.

    +

    What to do: Let the library select the optimal memory type, which will likely have VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT.

    VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
    imgCreateInfo.imageType = VK_IMAGE_TYPE_2D;
    imgCreateInfo.extent.width = 3840;
    @@ -127,10 +114,10 @@

    VmaAllocationCreateFlags flags
    Use VmaAllocationCreateFlagBits enum.
    Definition vk_mem_alloc.h:1293
    Represents single memory allocation.

    Also consider: Consider creating them as dedicated allocations using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT, especially if they are large or if you plan to destroy and recreate them with different sizes e.g. when display resolution changes. Prefer to create such resources first and all other GPU resources (like textures and vertex buffers) later. When VK_EXT_memory_priority extension is enabled, it is also worth setting high priority to such allocation to decrease chances to be evicted to system memory by the operating system.

    -

    +

    Staging copy for upload

    When: A "staging" buffer than you want to map and fill from CPU code, then use as a source of transfer to some GPU resource.

    -

    What to do: Use flag VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT. Let the library select the optimal memory type, which will always have VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT.

    +

    What to do: Use flag VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT. Let the library select the optimal memory type, which will always have VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT.

    VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    bufCreateInfo.size = 65536;
    bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
    @@ -154,10 +141,10 @@

    Definition vk_mem_alloc.h:1410
    void * pMappedData
    Pointer to the beginning of this allocation as mapped data.
    Definition vk_mem_alloc.h:1452

    Also consider: You can map the allocation using vmaMapMemory() or you can create it as persistenly mapped using VMA_ALLOCATION_CREATE_MAPPED_BIT, as in the example above.

    -

    +

    Readback

    When: Buffers for data written by or transferred from the GPU that you want to read back on the CPU, e.g. results of some computations.

    -

    What to do: Use flag VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. Let the library select the optimal memory type, which will always have VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_CACHED_BIT.

    +

    What to do: Use flag VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. Let the library select the optimal memory type, which will always have VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT and VK_MEMORY_PROPERTY_HOST_CACHED_BIT.

    VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    bufCreateInfo.size = 65536;
    bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_DST_BIT;
    @@ -176,22 +163,22 @@

    const float* downloadedData = (const float*)allocInfo.pMappedData;
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
    Definition vk_mem_alloc.h:671
    -

    +

    Advanced data uploading

    For resources that you frequently write on CPU via mapped pointer and frequently read on GPU e.g. as a uniform buffer (also called "dynamic"), multiple options are possible:

      -
    1. Easiest solution is to have one copy of the resource in HOST_VISIBLE memory, even if it means system RAM (not DEVICE_LOCAL) on systems with a discrete graphics card, and make the device reach out to that resource directly.
        +
      • Easiest solution is to have one copy of the resource in HOST_VISIBLE memory, even if it means system RAM (not DEVICE_LOCAL) on systems with a discrete graphics card, and make the device reach out to that resource directly.
        • Reads performed by the device will then go through PCI Express bus. The performance of this access may be limited, but it may be fine depending on the size of this resource (whether it is small enough to quickly end up in GPU cache) and the sparsity of access.
      • -
      • On systems with unified memory (e.g. AMD APU or Intel integrated graphics, mobile chips), a memory type may be available that is both HOST_VISIBLE (available for mapping) and DEVICE_LOCAL (fast to access from the GPU). Then, it is likely the best choice for such type of resource.
      • -
      • Systems with a discrete graphics card and separate video memory may or may not expose a memory type that is both HOST_VISIBLE and DEVICE_LOCAL, also known as Base Address Register (BAR). If they do, it represents a piece of VRAM (or entire VRAM, if ReBAR is enabled in the motherboard BIOS) that is available to CPU for mapping.
          +
        • On systems with unified memory (e.g. AMD APU or Intel integrated graphics, mobile chips), a memory type may be available that is both HOST_VISIBLE (available for mapping) and DEVICE_LOCAL (fast to access from the GPU). Then, it is likely the best choice for such type of resource.
        • +
        • Systems with a discrete graphics card and separate video memory may or may not expose a memory type that is both HOST_VISIBLE and DEVICE_LOCAL, also known as Base Address Register (BAR). If they do, it represents a piece of VRAM (or entire VRAM, if ReBAR is enabled in the motherboard BIOS) that is available to CPU for mapping.
          • Writes performed by the host to that memory go through PCI Express bus. The performance of these writes may be limited, but it may be fine, especially on PCIe 4.0, as long as rules of using uncached and write-combined memory are followed - only sequential writes and no reads.
        • -
        • Finally, you may need or prefer to create a separate copy of the resource in DEVICE_LOCAL memory, a separate "staging" copy in HOST_VISIBLE memory and perform an explicit transfer command between them.
        • +
        • Finally, you may need or prefer to create a separate copy of the resource in DEVICE_LOCAL memory, a separate "staging" copy in HOST_VISIBLE memory and perform an explicit transfer command between them.
    -

    Thankfully, VMA offers an aid to create and use such resources in the the way optimal for the current Vulkan device. To help the library make the best choice, use flag VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT together with VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT. It will then prefer a memory type that is both DEVICE_LOCAL and HOST_VISIBLE (integrated memory or BAR), but if no such memory type is available or allocation from it fails (PC graphics cards have only 256 MB of BAR by default, unless ReBAR is supported and enabled in BIOS), it will fall back to DEVICE_LOCAL memory for fast GPU access. It is then up to you to detect that the allocation ended up in a memory type that is not HOST_VISIBLE, so you need to create another "staging" allocation and perform explicit transfers.

    +

    Thankfully, VMA offers an aid to create and use such resources in the the way optimal for the current Vulkan device. To help the library make the best choice, use flag VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT together with VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT. It will then prefer a memory type that is both DEVICE_LOCAL and HOST_VISIBLE (integrated memory or BAR), but if no such memory type is available or allocation from it fails (PC graphics cards have only 256 MB of BAR by default, unless ReBAR is supported and enabled in BIOS), it will fall back to DEVICE_LOCAL memory for fast GPU access. It is then up to you to detect that the allocation ended up in a memory type that is not HOST_VISIBLE, so you need to create another "staging" allocation and perform explicit transfers.

    VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    bufCreateInfo.size = 65536;
    bufCreateInfo.usage = VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT;
    @@ -291,22 +278,22 @@

    VkResult vmaCopyMemoryToAllocation(VmaAllocator allocator, const void *pSrcHostPointer, VmaAllocation dstAllocation, VkDeviceSize dstAllocationLocalOffset, VkDeviceSize size)
    Maps the allocation temporarily if needed, copies data from specified host pointer to it,...
    void vmaGetAllocationMemoryProperties(VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags)
    Given an allocation, returns Property Flags of its memory type.
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT
    Definition vk_mem_alloc.h:683
    -

    +

    Other use cases

    Here are some other, less obvious use cases and their recommended settings:

    • An image that is used only as transfer source and destination, but it should stay on the device, as it is used to temporarily store a copy of some texture, e.g. from the current to the next frame, for temporal antialiasing or other temporal effects.
        -
      • Use VkImageCreateInfo::usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT
      • +
      • Use VkImageCreateInfo::usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT
      • Use VmaAllocationCreateInfo::usage = VMA_MEMORY_USAGE_AUTO
    • An image that is used only as transfer source and destination, but it should be placed in the system RAM despite it doesn't need to be mapped, because it serves as a "swap" copy to evict least recently used textures from VRAM.
        -
      • Use VkImageCreateInfo::usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT
      • +
      • Use VkImageCreateInfo::usage = VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT
      • Use VmaAllocationCreateInfo::usage = VMA_MEMORY_USAGE_AUTO_PREFER_HOST, as VMA needs a hint here to differentiate from the previous case.
    • A buffer that you want to map and write from the CPU, directly read from the GPU (e.g. as a uniform or vertex buffer), but you have a clear preference to place it in device or host memory due to its large size. @@ -316,7 +303,7 @@

    diff --git a/docs/html/virtual_allocator.html b/docs/html/virtual_allocator.html index bc7a7a93..2b9e88bd 100644 --- a/docs/html/virtual_allocator.html +++ b/docs/html/virtual_allocator.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: Virtual allocator - - @@ -33,33 +31,22 @@ - + -
    -
    Virtual allocator
    +
    Virtual allocator

    As an extra feature, the core allocation algorithm of the library is exposed through a simple and convenient API of "virtual allocator". It doesn't allocate any real GPU memory. It just keeps track of used and free regions of a "virtual block". You can use it to allocate your own memory or other objects, even completely unrelated to Vulkan. A common use case is sub-allocation of pieces of one large GPU buffer.

    -

    +

    Creating virtual block

    To use this functionality, there is no main "allocator" object. You don't need to have VmaAllocator object created. All you need to do is to create a separate VmaVirtualBlock object for each block of memory you want to be managed by the allocator:

      @@ -109,13 +96,13 @@

      Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
      Definition vk_mem_alloc.h:1599
      VkDeviceSize size
      Total size of the virtual block.
      Definition vk_mem_alloc.h:1605
      Handle to a virtual block object that allows to use core allocation algorithm without allocating any ...
      -

    +

    Making virtual allocations

    VmaVirtualBlock object contains internal data structure that keeps track of free and occupied regions using the same code as the main Vulkan memory allocator. Similarly to VmaAllocation for standard GPU allocations, there is VmaVirtualAllocation type that represents an opaque handle to an allocation within the virtual block.

    In order to make such allocation:

    1. Fill in VmaVirtualAllocationCreateInfo structure.
    2. -
    3. Call vmaVirtualAllocate(). Get new VmaVirtualAllocation object that represents the allocation. You can also receive VkDeviceSize offset that was assigned to the allocation.
    4. +
    5. Call vmaVirtualAllocate(). Get new VmaVirtualAllocation object that represents the allocation. You can also receive VkDeviceSize offset that was assigned to the allocation.

    Example:

    VmaVirtualAllocationCreateInfo allocCreateInfo = {};
    @@ -136,7 +123,7 @@

    Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
    Definition vk_mem_alloc.h:1620
    VkDeviceSize size
    Size of the allocation.
    Definition vk_mem_alloc.h:1625
    Represents single memory allocation done inside VmaVirtualBlock.
    -

    +

    Deallocation

    When no longer needed, an allocation can be freed by calling vmaVirtualFree(). You can only pass to this function an allocation that was previously returned by vmaVirtualAllocate() called for the same VmaVirtualBlock.

    When whole block is no longer needed, the block object can be released by calling vmaDestroyVirtualBlock(). All allocations must be freed before the block is destroyed, which is checked internally by an assert. However, if you don't want to call vmaVirtualFree() for each allocation, you can use vmaClearVirtualBlock() to free them all at once - a feature not available in normal Vulkan memory allocator. Example:

    @@ -144,7 +131,7 @@

    void vmaVirtualFree(VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation)
    Frees virtual allocation inside given VmaVirtualBlock.
    void vmaDestroyVirtualBlock(VmaVirtualBlock virtualBlock)
    Destroys VmaVirtualBlock object.
    -

    +

    Allocation parameters

    You can attach a custom pointer to each allocation by using vmaSetVirtualAllocationUserData(). Its default value is null. It can be used to store any data that needs to be associated with that allocation - e.g. an index, a handle, or a pointer to some larger data structure containing more information. Example:

    struct CustomAllocData
    @@ -164,7 +151,7 @@

    void vmaGetVirtualAllocationInfo(VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, VmaVirtualAllocationInfo *pVirtualAllocInfo)
    Returns information about a specific virtual allocation within a virtual block, like its size and pUs...
    Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
    Definition vk_mem_alloc.h:1643
    void * pUserData
    Custom pointer associated with the allocation.
    Definition vk_mem_alloc.h:1658
    -

    +

    Alignment and units

    It feels natural to express sizes and offsets in bytes. If an offset of an allocation needs to be aligned to a multiply of some number (e.g. 4 bytes), you can fill optional member VmaVirtualAllocationCreateInfo::alignment to request it. Example:

    VmaVirtualAllocationCreateInfo allocCreateInfo = {};
    @@ -174,13 +161,13 @@

    res = vmaVirtualAllocate(block, &allocCreateInfo, &alloc, nullptr);
    VkDeviceSize alignment
    Required alignment of the allocation. Optional.
    Definition vk_mem_alloc.h:1630
    -

    Alignments of different allocations made from one block may vary. However, if all alignments and sizes are always multiply of some size e.g. 4 B or sizeof(MyDataStruct), you can express all sizes, alignments, and offsets in multiples of that size instead of individual bytes. It might be more convenient, but you need to make sure to use this new unit consistently in all the places:

    +

    Alignments of different allocations made from one block may vary. However, if all alignments and sizes are always multiply of some size e.g. 4 B or sizeof(MyDataStruct), you can express all sizes, alignments, and offsets in multiples of that size instead of individual bytes. It might be more convenient, but you need to make sure to use this new unit consistently in all the places:

    -

    +

    Statistics

    You can obtain statistics of a virtual block using vmaGetVirtualBlockStatistics() (to get brief statistics that are fast to calculate) or vmaCalculateVirtualBlockStatistics() (to get more detailed statistics, slower to calculate). The functions fill structures VmaStatistics, VmaDetailedStatistics respectively - same as used by the normal Vulkan memory allocator. Example:

    @@ -192,16 +179,16 @@

    VkDeviceSize allocationBytes
    Total number of bytes occupied by all VmaAllocation objects.
    Definition vk_mem_alloc.h:1202
    uint32_t allocationCount
    Number of VmaAllocation objects allocated.
    Definition vk_mem_alloc.h:1188

    You can also request a full list of allocations and free regions as a string in JSON format by calling vmaBuildVirtualBlockStatsString(). Returned string must be later freed using vmaFreeVirtualBlockStatsString(). The format of this string differs from the one returned by the main Vulkan allocator, but it is similar.

    -

    +

    Additional considerations

    The "virtual allocator" functionality is implemented on a level of individual memory blocks. Keeping track of a whole collection of blocks, allocating new ones when out of free space, deleting empty ones, and deciding which one to try first for a new allocation must be implemented by the user.

    Alternative allocation algorithms are supported, just like in custom pools of the real GPU memory. See enum VmaVirtualBlockCreateFlagBits to learn how to specify them (e.g. VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT). You can find their description in chapter Custom memory pools. Allocation strategies are also supported. See enum VmaVirtualAllocationCreateFlagBits to learn how to specify them (e.g. VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT).

    -

    Following features are supported only by the allocator of the real GPU memory and not by virtual allocations: buffer-image granularity, VMA_DEBUG_MARGIN, VMA_MIN_ALIGNMENT.

    +

    Following features are supported only by the allocator of the real GPU memory and not by virtual allocations: buffer-image granularity, VMA_DEBUG_MARGIN, VMA_MIN_ALIGNMENT.

    diff --git a/docs/html/vk__mem__alloc_8h.html b/docs/html/vk__mem__alloc_8h.html index 0af1f4fa..15776838 100644 --- a/docs/html/vk__mem__alloc_8h.html +++ b/docs/html/vk__mem__alloc_8h.html @@ -3,15 +3,13 @@ - + -Vulkan Memory Allocator: D:/PROJECTS/Vulkan Memory Allocator/REPO/include/vk_mem_alloc.h File Reference +Vulkan Memory Allocator: C:/Code/VulkanMemoryAllocator/REPO/include/vk_mem_alloc.h File Reference - - @@ -33,33 +31,22 @@ - + -
    @@ -98,175 +85,120 @@
    #include <vulkan/vulkan.h>
    - - - - - + + + - - + - - + - - + - - + - - + - - + - - + - - + - - - - + + - - + - - + - - + - - + - - + - - + - - + -

    +

    Classes

    struct  VmaDeviceMemoryCallbacks
     Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More...
     
    struct  VmaVulkanFunctions
    struct  VmaDeviceMemoryCallbacks
     Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory. More...
    struct  VmaVulkanFunctions
     Pointers to some Vulkan functions - a subset used by the library. More...
     
    struct  VmaAllocatorCreateInfo
    struct  VmaAllocatorCreateInfo
     Description of a Allocator to be created. More...
     
    struct  VmaAllocatorInfo
    struct  VmaAllocatorInfo
     Information about existing VmaAllocator object. More...
     
    struct  VmaStatistics
    struct  VmaStatistics
     Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total. More...
     
    struct  VmaDetailedStatistics
    struct  VmaDetailedStatistics
     More detailed statistics than VmaStatistics. More...
     
    struct  VmaTotalStatistics
    struct  VmaTotalStatistics
     General statistics from current state of the Allocator - total memory usage across all memory heaps and types. More...
     
    struct  VmaBudget
    struct  VmaBudget
     Statistics of current memory usage and available budget for a specific memory heap. More...
     
    struct  VmaAllocationCreateInfo
    struct  VmaAllocationCreateInfo
     Parameters of new VmaAllocation. More...
     
    struct  VmaPoolCreateInfo
    struct  VmaPoolCreateInfo
     Describes parameter of created VmaPool. More...
     
    struct  VmaAllocationInfo
     
    struct  VmaAllocationInfo2
    struct  VmaAllocationInfo
    struct  VmaAllocationInfo2
     Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2(). More...
     
    struct  VmaDefragmentationInfo
    struct  VmaDefragmentationInfo
     Parameters for defragmentation. More...
     
    struct  VmaDefragmentationMove
    struct  VmaDefragmentationMove
     Single move of an allocation to be done for defragmentation. More...
     
    struct  VmaDefragmentationPassMoveInfo
    struct  VmaDefragmentationPassMoveInfo
     Parameters for incremental defragmentation steps. More...
     
    struct  VmaDefragmentationStats
    struct  VmaDefragmentationStats
     Statistics returned for defragmentation process in function vmaEndDefragmentation(). More...
     
    struct  VmaVirtualBlockCreateInfo
    struct  VmaVirtualBlockCreateInfo
     Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock(). More...
     
    struct  VmaVirtualAllocationCreateInfo
    struct  VmaVirtualAllocationCreateInfo
     Parameters of created virtual allocation to be passed to vmaVirtualAllocate(). More...
     
    struct  VmaVirtualAllocationInfo
    struct  VmaVirtualAllocationInfo
     Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo(). More...
     
    - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - -

    +

    Typedefs

    typedef enum VmaAllocatorCreateFlagBits VmaAllocatorCreateFlagBits
     Flags for created VmaAllocator.
     
    typedef VkFlags VmaAllocatorCreateFlags
     See VmaAllocatorCreateFlagBits.
     
    typedef enum VmaMemoryUsage VmaMemoryUsage
     Intended usage of the allocated memory.
     
    typedef enum VmaAllocationCreateFlagBits VmaAllocationCreateFlagBits
     Flags to be passed as VmaAllocationCreateInfo::flags.
     
    typedef VkFlags VmaAllocationCreateFlags
     See VmaAllocationCreateFlagBits.
     
    typedef enum VmaPoolCreateFlagBits VmaPoolCreateFlagBits
     Flags to be passed as VmaPoolCreateInfo::flags.
     
    typedef VkFlags VmaPoolCreateFlags
     Flags to be passed as VmaPoolCreateInfo::flags. See VmaPoolCreateFlagBits.
     
    typedef enum VmaDefragmentationFlagBits VmaDefragmentationFlagBits
     Flags to be passed as VmaDefragmentationInfo::flags.
     
    typedef VkFlags VmaDefragmentationFlags
     See VmaDefragmentationFlagBits.
     
    typedef enum VmaDefragmentationMoveOperation VmaDefragmentationMoveOperation
     Operation performed on single defragmentation move. See structure VmaDefragmentationMove.
     
    typedef enum VmaVirtualBlockCreateFlagBits VmaVirtualBlockCreateFlagBits
     Flags to be passed as VmaVirtualBlockCreateInfo::flags.
     
    typedef VkFlags VmaVirtualBlockCreateFlags
     Flags to be passed as VmaVirtualBlockCreateInfo::flags. See VmaVirtualBlockCreateFlagBits.
     
    typedef enum VmaVirtualAllocationCreateFlagBits VmaVirtualAllocationCreateFlagBits
     Flags to be passed as VmaVirtualAllocationCreateInfo::flags.
     
    typedef VkFlags VmaVirtualAllocationCreateFlags
     Flags to be passed as VmaVirtualAllocationCreateInfo::flags. See VmaVirtualAllocationCreateFlagBits.
     
    typedef void(VKAPI_PTR * PFN_vmaAllocateDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData)
     Callback function called after successful vkAllocateMemory.
     
    typedef void(VKAPI_PTR * PFN_vmaFreeDeviceMemoryFunction) (VmaAllocator allocator, uint32_t memoryType, VkDeviceMemory memory, VkDeviceSize size, void *pUserData)
     Callback function called before vkFreeMemory.
     
    typedef struct VmaDeviceMemoryCallbacks VmaDeviceMemoryCallbacks
     Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.
     
     Set of callbacks that the library will call for vkAllocateMemory and vkFreeMemory.
    typedef struct VmaVulkanFunctions VmaVulkanFunctions
     Pointers to some Vulkan functions - a subset used by the library.
     
    typedef struct VmaAllocatorCreateInfo VmaAllocatorCreateInfo
     Description of a Allocator to be created.
     
    typedef struct VmaAllocatorInfo VmaAllocatorInfo
     Information about existing VmaAllocator object.
     
    typedef struct VmaStatistics VmaStatistics
     Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total.
     
    typedef struct VmaDetailedStatistics VmaDetailedStatistics
     More detailed statistics than VmaStatistics.
     
    typedef struct VmaTotalStatistics VmaTotalStatistics
     General statistics from current state of the Allocator - total memory usage across all memory heaps and types.
     
    typedef struct VmaBudget VmaBudget
     Statistics of current memory usage and available budget for a specific memory heap.
     
    typedef struct VmaAllocationCreateInfo VmaAllocationCreateInfo
     Parameters of new VmaAllocation.
     
    typedef struct VmaPoolCreateInfo VmaPoolCreateInfo
     Describes parameter of created VmaPool.
     
    typedef struct VmaAllocationInfo VmaAllocationInfo
     
    typedef struct VmaAllocationInfo2 VmaAllocationInfo2
     Extended parameters of a VmaAllocation object that can be retrieved using function vmaGetAllocationInfo2().
     
    typedef VkBool32(VKAPI_PTR * PFN_vmaCheckDefragmentationBreakFunction) (void *pUserData)
     
    typedef struct VmaDefragmentationInfo VmaDefragmentationInfo
     Parameters for defragmentation.
     
    typedef struct VmaDefragmentationMove VmaDefragmentationMove
     Single move of an allocation to be done for defragmentation.
     
    typedef struct VmaDefragmentationPassMoveInfo VmaDefragmentationPassMoveInfo
     Parameters for incremental defragmentation steps.
     
    typedef struct VmaDefragmentationStats VmaDefragmentationStats
     Statistics returned for defragmentation process in function vmaEndDefragmentation().
     
    typedef struct VmaVirtualBlockCreateInfo VmaVirtualBlockCreateInfo
     Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
     
    typedef struct VmaVirtualAllocationCreateInfo VmaVirtualAllocationCreateInfo
     Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
     
    typedef struct VmaVirtualAllocationInfo VmaVirtualAllocationInfo
     Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
     
    - - - - - - - - -

    +

    Enumerations

    enum  VmaAllocatorCreateFlagBits {
      VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT = 0x00000001 @@ -285,7 +217,6 @@
    }
     Flags for created VmaAllocator. More...
     
    enum  VmaMemoryUsage {
      VMA_MEMORY_USAGE_UNKNOWN = 0 , VMA_MEMORY_USAGE_GPU_ONLY = 1 @@ -303,7 +234,6 @@
    }
     Intended usage of the allocated memory. More...
     
    enum  VmaAllocationCreateFlagBits {
      VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT = 0x00000001 , VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT = 0x00000002 @@ -330,14 +260,12 @@
    }
     Flags to be passed as VmaAllocationCreateInfo::flags. More...
     
    enum  VmaPoolCreateFlagBits { VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT = 0x00000002 , VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT = 0x00000004 , VMA_POOL_CREATE_ALGORITHM_MASK , VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF }
     Flags to be passed as VmaPoolCreateInfo::flags. More...
     
    enum  VmaDefragmentationFlagBits {
      VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT = 0x1 , VMA_DEFRAGMENTATION_FLAG_ALGORITHM_BALANCED_BIT = 0x2 @@ -349,19 +277,16 @@
    }
     Flags to be passed as VmaDefragmentationInfo::flags. More...
     
    enum  VmaDefragmentationMoveOperation { VMA_DEFRAGMENTATION_MOVE_OPERATION_COPY = 0 , VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE = 1 , VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY = 2 }
     Operation performed on single defragmentation move. See structure VmaDefragmentationMove. More...
     
    enum  VmaVirtualBlockCreateFlagBits { VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT = 0x00000001 , VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK , VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF }
     Flags to be passed as VmaVirtualBlockCreateInfo::flags. More...
     
    enum  VmaVirtualAllocationCreateFlagBits {
      VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT = VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT , VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT = VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT @@ -373,228 +298,157 @@
    }
     Flags to be passed as VmaVirtualAllocationCreateInfo::flags. More...
     
    - - - + - - - - - - - - - - - + - - + - - + - - - - - - - - - - - + - - + - - - - - - - - + + - - - - - - - - - - - - - - - - - - - + - - - + - - + - - - - - - - - - - + - - - - - - - - - -

    +

    Functions

    VkResult vmaImportVulkanFunctionsFromVolk (const VmaAllocatorCreateInfo *pAllocatorCreateInfo, VmaVulkanFunctions *pDstVulkanFunctions)
     Fully initializes pDstVulkanFunctions structure with Vulkan functions needed by VMA using volk library.
     
     Fully initializes pDstVulkanFunctions structure with Vulkan functions needed by VMA using volk library.
    VkResult vmaCreateAllocator (const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator)
     Creates VmaAllocator object.
     
    void vmaDestroyAllocator (VmaAllocator allocator)
     Destroys allocator object.
     
    void vmaGetAllocatorInfo (VmaAllocator allocator, VmaAllocatorInfo *pAllocatorInfo)
     Returns information about existing VmaAllocator object - handle to Vulkan device etc.
     
    void vmaGetPhysicalDeviceProperties (VmaAllocator allocator, const VkPhysicalDeviceProperties **ppPhysicalDeviceProperties)
     
    void vmaGetMemoryProperties (VmaAllocator allocator, const VkPhysicalDeviceMemoryProperties **ppPhysicalDeviceMemoryProperties)
     
    void vmaGetMemoryTypeProperties (VmaAllocator allocator, uint32_t memoryTypeIndex, VkMemoryPropertyFlags *pFlags)
     Given Memory Type Index, returns Property Flags of this memory type.
     
    void vmaSetCurrentFrameIndex (VmaAllocator allocator, uint32_t frameIndex)
     Sets index of the current frame.
     
    void vmaCalculateStatistics (VmaAllocator allocator, VmaTotalStatistics *pStats)
     Retrieves statistics from current state of the Allocator.
     
    void vmaGetHeapBudgets (VmaAllocator allocator, VmaBudget *pBudgets)
     Retrieves information about current memory usage and budget for all memory heaps.
     
    VkResult vmaFindMemoryTypeIndex (VmaAllocator allocator, uint32_t memoryTypeBits, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
     Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.
     
     Helps to find memoryTypeIndex, given memoryTypeBits and VmaAllocationCreateInfo.
    VkResult vmaFindMemoryTypeIndexForBufferInfo (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
     Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
     
     Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
    VkResult vmaFindMemoryTypeIndexForImageInfo (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
     Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
     
     Helps to find memoryTypeIndex, given VkImageCreateInfo and VmaAllocationCreateInfo.
    VkResult vmaCreatePool (VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
     Allocates Vulkan device memory and creates VmaPool object.
     
    void vmaDestroyPool (VmaAllocator allocator, VmaPool pool)
     Destroys VmaPool object and frees Vulkan device memory.
     
    void vmaGetPoolStatistics (VmaAllocator allocator, VmaPool pool, VmaStatistics *pPoolStats)
     Retrieves statistics of existing VmaPool object.
     
    void vmaCalculatePoolStatistics (VmaAllocator allocator, VmaPool pool, VmaDetailedStatistics *pPoolStats)
     Retrieves detailed statistics of existing VmaPool object.
     
    VkResult vmaCheckPoolCorruption (VmaAllocator allocator, VmaPool pool)
     Checks magic number in margins around all allocations in given memory pool in search for corruptions.
     
    void vmaGetPoolName (VmaAllocator allocator, VmaPool pool, const char **ppName)
     Retrieves name of a custom pool.
     
    void vmaSetPoolName (VmaAllocator allocator, VmaPool pool, const char *pName)
     Sets name of a custom pool.
     
    VkResult vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     General purpose memory allocation.
     
    VkResult vmaAllocateMemoryPages (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, size_t allocationCount, VmaAllocation *pAllocations, VmaAllocationInfo *pAllocationInfo)
     General purpose memory allocation for multiple allocation objects at once.
     
    VkResult vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Allocates memory suitable for given VkBuffer.
     
     Allocates memory suitable for given VkBuffer.
    VkResult vmaAllocateMemoryForImage (VmaAllocator allocator, VkImage image, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Allocates memory suitable for given VkImage.
     
     Allocates memory suitable for given VkImage.
    void vmaFreeMemory (VmaAllocator allocator, VmaAllocation allocation)
     Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(), or vmaAllocateMemoryForImage().
     
    void vmaFreeMemoryPages (VmaAllocator allocator, size_t allocationCount, const VmaAllocation *pAllocations)
     Frees memory and destroys multiple allocations.
     
    void vmaGetAllocationInfo (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
     Returns current information about specified allocation.
     
    void vmaGetAllocationInfo2 (VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo2 *pAllocationInfo)
     Returns extended information about specified allocation.
     
    void vmaSetAllocationUserData (VmaAllocator allocator, VmaAllocation allocation, void *pUserData)
     Sets pUserData in given allocation to new value.
     
    void vmaSetAllocationName (VmaAllocator allocator, VmaAllocation allocation, const char *pName)
     Sets pName in given allocation to new value.
     
    void vmaGetAllocationMemoryProperties (VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags)
     Given an allocation, returns Property Flags of its memory type.
     
    VkResult vmaGetMemoryWin32Handle (VmaAllocator allocator, VmaAllocation allocation, HANDLE hTargetProcess, HANDLE *pHandle)
     Given an allocation, returns Win32 handle that may be imported by other processes or APIs.
     
    VkResult vmaGetMemoryWin32Handle2 (VmaAllocator allocator, VmaAllocation allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE *pHandle)
     Given an allocation, returns Win32 handle that may be imported by other processes or APIs.
    VkResult vmaMapMemory (VmaAllocator allocator, VmaAllocation allocation, void **ppData)
     Maps memory represented by given allocation and returns pointer to it.
     
    void vmaUnmapMemory (VmaAllocator allocator, VmaAllocation allocation)
     Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().
     
    VkResult vmaFlushAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
     Flushes memory of given allocation.
     
    VkResult vmaInvalidateAllocation (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size)
     Invalidates memory of given allocation.
     
    VkResult vmaFlushAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes)
     Flushes memory of given set of allocations.
     
    VkResult vmaInvalidateAllocations (VmaAllocator allocator, uint32_t allocationCount, const VmaAllocation *allocations, const VkDeviceSize *offsets, const VkDeviceSize *sizes)
     Invalidates memory of given set of allocations.
     
    VkResult vmaCopyMemoryToAllocation (VmaAllocator allocator, const void *pSrcHostPointer, VmaAllocation dstAllocation, VkDeviceSize dstAllocationLocalOffset, VkDeviceSize size)
     Maps the allocation temporarily if needed, copies data from specified host pointer to it, and flushes the memory from the host caches if needed.
     
    VkResult vmaCopyAllocationToMemory (VmaAllocator allocator, VmaAllocation srcAllocation, VkDeviceSize srcAllocationLocalOffset, void *pDstHostPointer, VkDeviceSize size)
     Invalidates memory in the host caches if needed, maps the allocation temporarily if needed, and copies data from it to a specified host pointer.
     
    VkResult vmaCheckCorruption (VmaAllocator allocator, uint32_t memoryTypeBits)
     Checks magic number in margins around all allocations in given memory types (in both default and custom pools) in search for corruptions.
     
    VkResult vmaBeginDefragmentation (VmaAllocator allocator, const VmaDefragmentationInfo *pInfo, VmaDefragmentationContext *pContext)
     Begins defragmentation process.
     
    void vmaEndDefragmentation (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationStats *pStats)
     Ends defragmentation process.
     
    VkResult vmaBeginDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo)
     Starts single defragmentation pass.
     
    VkResult vmaEndDefragmentationPass (VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo)
     Ends single defragmentation pass.
     
    VkResult vmaBindBufferMemory (VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer)
     Binds buffer to allocation.
     
    VkResult vmaBindBufferMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkBuffer buffer, const void *(VkBindBufferMemoryInfoKHR) pNext)
     Binds buffer to allocation with additional parameters.
     
    VkResult vmaBindImageMemory (VmaAllocator allocator, VmaAllocation allocation, VkImage image)
     Binds image to allocation.
     
    VkResult vmaBindImageMemory2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, VkImage image, const void *(VkBindImageMemoryInfoKHR) pNext)
     Binds image to allocation with additional parameters.
     
    VkResult vmaCreateBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Creates a new VkBuffer, allocates and binds memory for it.
     
     Creates a new VkBuffer, allocates and binds memory for it.
    VkResult vmaCreateBufferWithAlignment (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkDeviceSize minAlignment, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Creates a buffer with additional minimum alignment.
     
    VkResult vmaCreateAliasingBuffer (VmaAllocator allocator, VmaAllocation allocation, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer)
     Creates a new VkBuffer, binds already created memory for it.
     
     Creates a new VkBuffer, binds already created memory for it.
    VkResult vmaCreateAliasingBuffer2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer)
     Creates a new VkBuffer, binds already created memory for it.
     
     Creates a new VkBuffer, binds already created memory for it.
    void vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)
     Destroys Vulkan buffer and frees allocated memory.
     
    VkResult vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
     Function similar to vmaCreateBuffer().
     
    VkResult vmaCreateAliasingImage (VmaAllocator allocator, VmaAllocation allocation, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage)
     Function similar to vmaCreateAliasingBuffer() but for images.
     
    VkResult vmaCreateAliasingImage2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage)
     Function similar to vmaCreateAliasingBuffer2() but for images.
     
    void vmaDestroyImage (VmaAllocator allocator, VkImage image, VmaAllocation allocation)
     Destroys Vulkan image and frees allocated memory.
     
    VkResult vmaCreateVirtualBlock (const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock)
     Creates new VmaVirtualBlock object.
     
    void vmaDestroyVirtualBlock (VmaVirtualBlock virtualBlock)
     Destroys VmaVirtualBlock object.
     
    VkBool32 vmaIsVirtualBlockEmpty (VmaVirtualBlock virtualBlock)
     Returns true of the VmaVirtualBlock is empty - contains 0 virtual allocations and has all its space available for new allocations.
     
    void vmaGetVirtualAllocationInfo (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, VmaVirtualAllocationInfo *pVirtualAllocInfo)
     Returns information about a specific virtual allocation within a virtual block, like its size and pUserData pointer.
     
     Returns information about a specific virtual allocation within a virtual block, like its size and pUserData pointer.
    VkResult vmaVirtualAllocate (VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VmaVirtualAllocation *pAllocation, VkDeviceSize *pOffset)
     Allocates new virtual allocation inside given VmaVirtualBlock.
     
    void vmaVirtualFree (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation)
     Frees virtual allocation inside given VmaVirtualBlock.
     
    void vmaClearVirtualBlock (VmaVirtualBlock virtualBlock)
     Frees all virtual allocations inside given VmaVirtualBlock.
     
    void vmaSetVirtualAllocationUserData (VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, void *pUserData)
     Changes custom pointer associated with given virtual allocation.
     
    void vmaGetVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaStatistics *pStats)
     Calculates and returns statistics about virtual allocations and memory usage in given VmaVirtualBlock.
     
    void vmaCalculateVirtualBlockStatistics (VmaVirtualBlock virtualBlock, VmaDetailedStatistics *pStats)
     Calculates and returns detailed statistics about virtual allocations and memory usage in given VmaVirtualBlock.
     
    void vmaBuildVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char **ppStatsString, VkBool32 detailedMap)
     Builds and returns a null-terminated string in JSON format with information about given VmaVirtualBlock.
     
    void vmaFreeVirtualBlockStatsString (VmaVirtualBlock virtualBlock, char *pStatsString)
     Frees a string returned by vmaBuildVirtualBlockStatsString().
     
    void vmaBuildStatsString (VmaAllocator allocator, char **ppStatsString, VkBool32 detailedMap)
     Builds and returns statistics as a null-terminated string in JSON format.
     
    void vmaFreeStatsString (VmaAllocator allocator, char *pStatsString)
     
    diff --git a/docs/html/vk_amd_device_coherent_memory.html b/docs/html/vk_amd_device_coherent_memory.html index 6323c9da..8a7cf4d6 100644 --- a/docs/html/vk_amd_device_coherent_memory.html +++ b/docs/html/vk_amd_device_coherent_memory.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VK_AMD_device_coherent_memory - - @@ -33,33 +31,22 @@ - + -
    -
    VK_AMD_device_coherent_memory
    +
    VK_AMD_device_coherent_memory
    -

    VK_AMD_device_coherent_memory is a device extension that enables access to additional memory types with VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD and VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD flag. It is useful mostly for allocation of buffers intended for writing "breadcrumb markers" in between passes or draw calls, which in turn are useful for debugging GPU crash/hang/TDR cases.

    -

    When the extension is available but has not been enabled, Vulkan physical device still exposes those memory types, but their usage is forbidden. VMA automatically takes care of that - it returns VK_ERROR_FEATURE_NOT_PRESENT when an attempt to allocate memory of such type is made.

    +

    VK_AMD_device_coherent_memory is a device extension that enables access to additional memory types with VK_MEMORY_PROPERTY_DEVICE_COHERENT_BIT_AMD and VK_MEMORY_PROPERTY_DEVICE_UNCACHED_BIT_AMD flag. It is useful mostly for allocation of buffers intended for writing "breadcrumb markers" in between passes or draw calls, which in turn are useful for debugging GPU crash/hang/TDR cases.

    +

    When the extension is available but has not been enabled, Vulkan physical device still exposes those memory types, but their usage is forbidden. VMA automatically takes care of that - it returns VK_ERROR_FEATURE_NOT_PRESENT when an attempt to allocate memory of such type is made.

    If you want to use this extension in connection with VMA, follow these steps:

    -

    +

    Initialization

    -

    1) Call vkEnumerateDeviceExtensionProperties for the physical device. Check if the extension is supported - if returned array of VkExtensionProperties contains "VK_AMD_device_coherent_memory".

    -

    2) Call vkGetPhysicalDeviceFeatures2 for the physical device instead of old vkGetPhysicalDeviceFeatures. Attach additional structure VkPhysicalDeviceCoherentMemoryFeaturesAMD to VkPhysicalDeviceFeatures2::pNext to be returned. Check if the device feature is really supported - check if VkPhysicalDeviceCoherentMemoryFeaturesAMD::deviceCoherentMemory is true.

    -

    3) While creating device with vkCreateDevice, enable this extension - add "VK_AMD_device_coherent_memory" to the list passed as VkDeviceCreateInfo::ppEnabledExtensionNames.

    -

    4) While creating the device, also don't set VkDeviceCreateInfo::pEnabledFeatures. Fill in VkPhysicalDeviceFeatures2 structure instead and pass it as VkDeviceCreateInfo::pNext. Enable this device feature - attach additional structure VkPhysicalDeviceCoherentMemoryFeaturesAMD to VkPhysicalDeviceFeatures2::pNext and set its member deviceCoherentMemory to VK_TRUE.

    +

    1) Call vkEnumerateDeviceExtensionProperties for the physical device. Check if the extension is supported - if returned array of VkExtensionProperties contains "VK_AMD_device_coherent_memory".

    +

    2) Call vkGetPhysicalDeviceFeatures2 for the physical device instead of old vkGetPhysicalDeviceFeatures. Attach additional structure VkPhysicalDeviceCoherentMemoryFeaturesAMD to VkPhysicalDeviceFeatures2::pNext to be returned. Check if the device feature is really supported - check if VkPhysicalDeviceCoherentMemoryFeaturesAMD::deviceCoherentMemory is true.

    +

    3) While creating device with vkCreateDevice, enable this extension - add "VK_AMD_device_coherent_memory" to the list passed as VkDeviceCreateInfo::ppEnabledExtensionNames.

    +

    4) While creating the device, also don't set VkDeviceCreateInfo::pEnabledFeatures. Fill in VkPhysicalDeviceFeatures2 structure instead and pass it as VkDeviceCreateInfo::pNext. Enable this device feature - attach additional structure VkPhysicalDeviceCoherentMemoryFeaturesAMD to VkPhysicalDeviceFeatures2::pNext and set its member deviceCoherentMemory to VK_TRUE.

    5) While creating VmaAllocator with vmaCreateAllocator() inform VMA that you have enabled this extension and feature - add VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT to VmaAllocatorCreateInfo::flags.

    -

    +

    Usage

    -

    After following steps described above, you can create VMA allocations and custom pools out of the special DEVICE_COHERENT and DEVICE_UNCACHED memory types on eligible devices. There are multiple ways to do it, for example:

    +

    After following steps described above, you can create VMA allocations and custom pools out of the special DEVICE_COHERENT and DEVICE_UNCACHED memory types on eligible devices. There are multiple ways to do it, for example:

    -

    +

    More information

    To learn more about this extension, see VK_AMD_device_coherent_memory in Vulkan specification

    Example use of this extension can be found in the code of the sample and test suite accompanying this library.

    @@ -116,7 +103,7 @@

    diff --git a/docs/html/vk_ext_memory_priority.html b/docs/html/vk_ext_memory_priority.html index c8155594..42d8239d 100644 --- a/docs/html/vk_ext_memory_priority.html +++ b/docs/html/vk_ext_memory_priority.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VK_EXT_memory_priority - - @@ -33,33 +31,22 @@
    - + -
    -
    VK_EXT_memory_priority
    +
    VK_EXT_memory_priority

    VK_EXT_memory_priority is a device extension that allows to pass additional "priority" value to Vulkan memory allocations that the implementation may use prefer certain buffers and images that are critical for performance to stay in device-local memory in cases when the memory is over-subscribed, while some others may be moved to the system memory.

    VMA offers convenient usage of this extension. If you enable it, you can pass "priority" parameter when creating allocations or custom pools and the library automatically passes the value to Vulkan using this extension.

    If you want to use this extension in connection with VMA, follow these steps:

    -

    +

    Initialization

    -

    1) Call vkEnumerateDeviceExtensionProperties for the physical device. Check if the extension is supported - if returned array of VkExtensionProperties contains "VK_EXT_memory_priority".

    -

    2) Call vkGetPhysicalDeviceFeatures2 for the physical device instead of old vkGetPhysicalDeviceFeatures. Attach additional structure VkPhysicalDeviceMemoryPriorityFeaturesEXT to VkPhysicalDeviceFeatures2::pNext to be returned. Check if the device feature is really supported - check if VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority is true.

    -

    3) While creating device with vkCreateDevice, enable this extension - add "VK_EXT_memory_priority" to the list passed as VkDeviceCreateInfo::ppEnabledExtensionNames.

    -

    4) While creating the device, also don't set VkDeviceCreateInfo::pEnabledFeatures. Fill in VkPhysicalDeviceFeatures2 structure instead and pass it as VkDeviceCreateInfo::pNext. Enable this device feature - attach additional structure VkPhysicalDeviceMemoryPriorityFeaturesEXT to VkPhysicalDeviceFeatures2::pNext chain and set its member memoryPriority to VK_TRUE.

    +

    1) Call vkEnumerateDeviceExtensionProperties for the physical device. Check if the extension is supported - if returned array of VkExtensionProperties contains "VK_EXT_memory_priority".

    +

    2) Call vkGetPhysicalDeviceFeatures2 for the physical device instead of old vkGetPhysicalDeviceFeatures. Attach additional structure VkPhysicalDeviceMemoryPriorityFeaturesEXT to VkPhysicalDeviceFeatures2::pNext to be returned. Check if the device feature is really supported - check if VkPhysicalDeviceMemoryPriorityFeaturesEXT::memoryPriority is true.

    +

    3) While creating device with vkCreateDevice, enable this extension - add "VK_EXT_memory_priority" to the list passed as VkDeviceCreateInfo::ppEnabledExtensionNames.

    +

    4) While creating the device, also don't set VkDeviceCreateInfo::pEnabledFeatures. Fill in VkPhysicalDeviceFeatures2 structure instead and pass it as VkDeviceCreateInfo::pNext. Enable this device feature - attach additional structure VkPhysicalDeviceMemoryPriorityFeaturesEXT to VkPhysicalDeviceFeatures2::pNext chain and set its member memoryPriority to VK_TRUE.

    5) While creating VmaAllocator with vmaCreateAllocator() inform VMA that you have enabled this extension and feature - add VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT to VmaAllocatorCreateInfo::flags.

    -

    +

    Usage

    When using this extension, you should initialize following member:

    -

    It should be a floating-point value between 0.0f and 1.0f, where recommended default is 0.5F. Memory allocated with higher value can be treated by the Vulkan implementation as higher priority and so it can have lower chances of being pushed out to system memory, experiencing degraded performance.

    +

    It should be a floating-point value between 0.0f and 1.0f, where recommended default is 0.5F. Memory allocated with higher value can be treated by the Vulkan implementation as higher priority and so it can have lower chances of being pushed out to system memory, experiencing degraded performance.

    It might be a good idea to create performance-critical resources like color-attachment or depth-stencil images as dedicated and set high priority to them. For example:

    VkImageCreateInfo imgCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO };
    imgCreateInfo.imageType = VK_IMAGE_TYPE_2D;
    @@ -139,16 +126,16 @@

    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1299
    VmaAllocationCreateFlags flags
    Use VmaAllocationCreateFlagBits enum.
    Definition vk_mem_alloc.h:1293
    Represents single memory allocation.
    -

    priority member is ignored in the following situations:

    +

    priority member is ignored in the following situations:

    • Allocations created in custom pools: They inherit the priority, along with all other allocation parameters from the parameters passed in VmaPoolCreateInfo when the pool was created.
    • -
    • Allocations created in default pools: They inherit the priority from the parameters VMA used when creating default pools, which means priority == 0.5F.
    • +
    • Allocations created in default pools: They inherit the priority from the parameters VMA used when creating default pools, which means priority == 0.5F.
    diff --git a/docs/html/vk_khr_dedicated_allocation.html b/docs/html/vk_khr_dedicated_allocation.html index d9c767a6..2fcf41f5 100644 --- a/docs/html/vk_khr_dedicated_allocation.html +++ b/docs/html/vk_khr_dedicated_allocation.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VK_KHR_dedicated_allocation - - @@ -33,33 +31,22 @@ - + -
    -
    VK_KHR_dedicated_allocation
    +
    VK_KHR_dedicated_allocation
    -

    VK_KHR_dedicated_allocation is a Vulkan extension which can be used to improve performance on some GPUs. It augments Vulkan API with possibility to query driver whether it prefers particular buffer or image to have its own, dedicated allocation (separate VkDeviceMemory block) for better efficiency - to be able to do some internal optimizations. The extension is supported by this library. It will be used automatically when enabled.

    +

    VK_KHR_dedicated_allocation is a Vulkan extension which can be used to improve performance on some GPUs. It augments Vulkan API with possibility to query driver whether it prefers particular buffer or image to have its own, dedicated allocation (separate VkDeviceMemory block) for better efficiency - to be able to do some internal optimizations. The extension is supported by this library. It will be used automatically when enabled.

    It has been promoted to core Vulkan 1.1, so if you use eligible Vulkan version and inform VMA about it by setting VmaAllocatorCreateInfo::vulkanApiVersion, you are all set.

    Otherwise, if you want to use it as an extension:

    -

    1 . When creating Vulkan device, check if following 2 device extensions are supported (call vkEnumerateDeviceExtensionProperties()). If yes, enable them (fill VkDeviceCreateInfo::ppEnabledExtensionNames).

    +

    1 . When creating Vulkan device, check if following 2 device extensions are supported (call vkEnumerateDeviceExtensionProperties()). If yes, enable them (fill VkDeviceCreateInfo::ppEnabledExtensionNames).

    • VK_KHR_get_memory_requirements2
    • VK_KHR_dedicated_allocation
    • @@ -109,7 +96,7 @@

    That is all. The extension will be automatically used whenever you create a buffer using vmaCreateBuffer() or image using vmaCreateImage().

    When using the extension together with Vulkan Validation Layer, you will receive warnings like this:

    vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer.

    -

    It is OK, you should just ignore it. It happens because you use function vkGetBufferMemoryRequirements2KHR() instead of standard vkGetBufferMemoryRequirements(), while the validation layer seems to be unaware of it.

    +

    It is OK, you should just ignore it. It happens because you use function vkGetBufferMemoryRequirements2KHR() instead of standard vkGetBufferMemoryRequirements(), while the validation layer seems to be unaware of it.

    To learn more about this extension, see:

    diff --git a/docs/html/vk_khr_external_memory_win32.html b/docs/html/vk_khr_external_memory_win32.html index cfbfe6cc..5b9e77d8 100644 --- a/docs/html/vk_khr_external_memory_win32.html +++ b/docs/html/vk_khr_external_memory_win32.html @@ -3,15 +3,13 @@ - + Vulkan Memory Allocator: VK_KHR_external_memory_win32 - - @@ -33,33 +31,22 @@
    - + -
    -
    VK_KHR_external_memory_win32
    +
    VK_KHR_external_memory_win32
    -

    On Windows, the VK_KHR_external_memory_win32 device extension allows exporting a Win32 HANDLE of a VkDeviceMemory block, to be able to reference the memory on other Vulkan logical devices or instances, in multiple processes, and/or in multiple APIs. VMA offers support for it.

    -

    +

    On Windows, the VK_KHR_external_memory_win32 device extension allows exporting a Win32 HANDLE of a VkDeviceMemory block, to be able to reference the memory on other Vulkan logical devices or instances, in multiple processes, and/or in multiple APIs. VMA offers support for it.

    +

    Initialization

    1) Make sure the extension is defined in the code by including following header before including VMA:

    #include <vulkan/vulkan_win32.h>
    -

    2) Check if "VK_KHR_external_memory_win32" is available among device extensions. Enable it when creating the VkDevice object.

    +

    2) Check if "VK_KHR_external_memory_win32" is available among device extensions. Enable it when creating the VkDevice object.

    3) Enable the usage of this extension in VMA by setting flag VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT when calling vmaCreateAllocator().

    -

    4) Make sure that VMA has access to the vkGetMemoryWin32HandleKHR function by either enabling VMA_DYNAMIC_VULKAN_FUNCTIONS macro or setting VmaVulkanFunctions::vkGetMemoryWin32HandleKHR explicitly. For more information, see Importing Vulkan functions.

    -

    -Preparations

    -

    You can find example usage among tests, in file "Tests.cpp", function TestWin32Handles().

    -

    To use the extenion, buffers need to be created with VkExternalMemoryBufferCreateInfoKHR attached to their pNext chain, and memory allocations need to be made with VkExportMemoryAllocateInfoKHR attached to their pNext chain. To make use of them, you need to use Custom memory pools. Example:

    -
    // Define an example buffer and allocation parameters.
    +

    4) Make sure that VMA has access to the vkGetMemoryWin32HandleKHR function by either enabling VMA_DYNAMIC_VULKAN_FUNCTIONS macro or setting VmaVulkanFunctions::vkGetMemoryWin32HandleKHR explicitly. For more information, see Importing Vulkan functions.

    +

    +Exporting memory

    +

    +Preparations

    +

    You can find example usage among tests, in file "Tests.cpp", function TestWin32Handles().

    +

    To use the extenion, buffers need to be created with VkExternalMemoryBufferCreateInfoKHR attached to their pNext chain, and memory allocations need to be made with VkExportMemoryAllocateInfoKHR attached to their pNext chain. To make use of them, you need to use Custom memory pools. Example:

    +
    const VkExternalMemoryHandleTypeFlagsKHR handleType =
    +
    VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR;
    +
    +
    // Define an example buffer and allocation parameters.
    VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = {
    VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR,
    nullptr,
    -
    VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT
    +
    handleType
    };
    VkBufferCreateInfo exampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    exampleBufCreateInfo.size = 0x10000; // Doesn't matter here.
    @@ -127,7 +119,7 @@

    constexpr static VkExportMemoryAllocateInfoKHR exportMemAllocInfo = {
    VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR,
    nullptr,
    -
    VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT
    +
    handleType
    };
    VmaPoolCreateInfo poolCreateInfo = {};
    poolCreateInfo.memoryTypeIndex = memTypeIndex;
    @@ -151,14 +143,14 @@

    uint32_t memoryTypeIndex
    Vulkan memory type index to allocate this pool from.
    Definition vk_mem_alloc.h:1345
    void *VkMemoryAllocateInfo pMemoryAllocateNext
    Additional pNext chain to be attached to VkMemoryAllocateInfo used for every allocation made by this ...
    Definition vk_mem_alloc.h:1394
    Represents custom memory pool.
    -

    Note that the structure passed as VmaPoolCreateInfo::pMemoryAllocateNext must remain alive and unchanged for the whole lifetime of the custom pool, because it will be used when the pool allocates a new device memory block. No copy is made internally. This is why variable exportMemAllocInfo is defined as static.

    -

    -Memory allocation

    -

    Finally, you can create a buffer with an allocation out of the custom pool. The buffer should use same flags as the sample buffer used to find the memory type. It should also specify VkExternalMemoryBufferCreateInfoKHR in its pNext chain.

    +

    Note that the structure passed as VmaPoolCreateInfo::pMemoryAllocateNext must remain alive and unchanged for the whole lifetime of the custom pool, because it will be used when the pool allocates a new device memory block. No copy is made internally. This is why variable exportMemAllocInfo is defined as static.

    +

    +Memory allocation

    +

    Finally, you can create a buffer with an allocation out of the custom pool. The buffer should use same flags as the sample buffer used to find the memory type. It should also specify VkExternalMemoryBufferCreateInfoKHR in its pNext chain.

    VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = {
    VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR,
    nullptr,
    -
    VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT
    +
    handleType
    };
    VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    bufCreateInfo.size = // Your desired buffer size.
    @@ -182,29 +174,29 @@

    VmaPool pool
    Pool that this allocation should be created in.
    Definition vk_mem_alloc.h:1323
    Represents single memory allocation.

    If you need each allocation to have its own device memory block and start at offset 0, you can still do by using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag. It works also with custom pools.

    -

    -Exporting Win32 handle

    -

    After the allocation is created, you can acquire a Win32 HANDLE to the VkDeviceMemory block it belongs to. VMA function vmaGetMemoryWin32Handle() is a replacement of the Vulkan function vkGetMemoryWin32HandleKHR.

    +

    +Exporting Win32 handle

    +

    After the allocation is created, you can acquire a Win32 HANDLE to the VkDeviceMemory block it belongs to. VMA function vmaGetMemoryWin32Handle2() is a replacement of the Vulkan function vkGetMemoryWin32HandleKHR.

    HANDLE handle;
    -
    res = vmaGetMemoryWin32Handle(g_Allocator, alloc, nullptr, &handle);
    +
    res = vmaGetMemoryWin32Handle2(g_Allocator, alloc, handleType, nullptr, &handle);
    // Check res...
    // YOUR OTHER CODE COMES HERE....
    // At the end, you must close the handle.
    CloseHandle(handle);
    -
    VkResult vmaGetMemoryWin32Handle(VmaAllocator allocator, VmaAllocation allocation, HANDLE hTargetProcess, HANDLE *pHandle)
    Given an allocation, returns Win32 handle that may be imported by other processes or APIs.
    +
    VkResult vmaGetMemoryWin32Handle2(VmaAllocator allocator, VmaAllocation allocation, VkExternalMemoryHandleTypeFlagBits handleType, HANDLE hTargetProcess, HANDLE *pHandle)
    Given an allocation, returns Win32 handle that may be imported by other processes or APIs.

    Documentation of the VK_KHR_external_memory_win32 extension states that:

    -

    ‍If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.

    +

    If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.

    -

    This is ensured automatically inside VMA. The library fetches the handle on first use, remembers it internally, and closes it when the memory block or dedicated allocation is destroyed. Every time you call vmaGetMemoryWin32Handle(), VMA calls DuplicateHandle and returns a new handle that you need to close.

    -

    For further information, please check documentation of the vmaGetMemoryWin32Handle() function.

    +

    This is ensured automatically inside VMA. If VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT was used as the handle type, the library fetches the handle on first use, remembers it internally, and closes it when the memory block or dedicated allocation is destroyed. Every time you call vmaGetMemoryWin32Handle2(), VMA calls DuplicateHandle and returns a new handle that you need to close.

    +

    For further information, please check documentation of the vmaGetMemoryWin32Handle2() function.

    diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index ebc673ab..1cab24de 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -25,7 +25,7 @@ /** \mainpage Vulkan Memory Allocator -Version 3.3.0 +Version 3.4.0-development Copyright (c) 2017-2025 Advanced Micro Devices, Inc. All rights reserved. \n License: MIT \n @@ -79,6 +79,7 @@ See also: [product page on GPUOpen](https://gpuopen.com/vulkan-memory-allocator/ - [Corruption detection](@ref debugging_memory_usage_corruption_detection) - [Leak detection features](@ref debugging_memory_usage_leak_detection) - \subpage other_api_interop + - [Exporting memory](@ref other_api_interop_exporting_memory) - \subpage usage_patterns - [GPU-only resource](@ref usage_patterns_gpu_only) - [Staging copy for upload](@ref usage_patterns_staging_copy_upload) @@ -95,7 +96,6 @@ See also: [product page on GPUOpen](https://gpuopen.com/vulkan-memory-allocator/ - \subpage enabling_buffer_device_address - \subpage vk_ext_memory_priority - \subpage vk_amd_device_coherent_memory - - \subpage vk_khr_external_memory_win32 - \subpage general_considerations - [Thread safety](@ref general_considerations_thread_safety) - [Versioning and compatibility](@ref general_considerations_versioning_and_compatibility) @@ -478,7 +478,7 @@ typedef enum VmaAllocatorCreateFlagBits You should set this flag if you found available and enabled this device extension, while creating Vulkan device passed as VmaAllocatorCreateInfo::device. - For more information, see \ref vk_khr_external_memory_win32. + For more information, see \ref other_api_interop. */ VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT = 0x00000200, @@ -2142,13 +2142,16 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationMemoryProperties( /** \brief Given an allocation, returns Win32 handle that may be imported by other processes or APIs. -\param hTargetProcess Must be a valid handle to target process or null. If it's null, the function returns +\param allocator The main allocator object. +\param allocation Allocation. +\param hTargetProcess A valid handle to target process or null. If it's null, the function returns handle for the current process. \param[out] pHandle Output parameter that returns the handle. The function fills `pHandle` with handle that can be used in target process. The handle is fetched using function `vkGetMemoryWin32HandleKHR`. -When no longer needed, you must close it using: + +Each call to this function creates a new handle that must be closed using: \code CloseHandle(handle); @@ -2161,11 +2164,19 @@ Note the handle is returned for the entire `VkDeviceMemory` block that the alloc If the allocation is sub-allocated from a larger block, you may need to consider the offset of the allocation (VmaAllocationInfo::offset). +This function always uses `VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT`. +An extended version of this function is available as vmaGetMemoryWin32Handle2() +that allows using other handle type. + +This function is available compile-time only when VK_KHR_external_memory_win32 extension is available. +It can be manually disabled by predefining `VMA_EXTERNAL_MEMORY_WIN32=0` macro. + If the function fails with `VK_ERROR_FEATURE_NOT_PRESENT` error code, please double-check -that VmaVulkanFunctions::vkGetMemoryWin32HandleKHR function pointer is set, e.g. either by using `VMA_DYNAMIC_VULKAN_FUNCTIONS` +that VmaVulkanFunctions::vkGetMemoryWin32HandleKHR function pointer is set, e.g. +either by using macro `VMA_DYNAMIC_VULKAN_FUNCTIONS` or by manually passing it through VmaAllocatorCreateInfo::pVulkanFunctions. -For more information, see chapter \ref vk_khr_external_memory_win32. +For more information, see chapter \ref other_api_interop. */ VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle( VmaAllocator VMA_NOT_NULL allocator, @@ -2173,6 +2184,49 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle( HANDLE hTargetProcess, HANDLE* VMA_NOT_NULL pHandle); +/** +\brief Given an allocation, returns Win32 handle that may be imported by other processes or APIs. + +\param allocator The main allocator object. +\param allocation Allocation. +\param handleType Type of handle to be exported. It should be one of: + - `VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR` + - `VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_KHR` + - `VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT_KHR` + - `VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_KMT_BIT_KHR` + - `VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT_KHR` + - `VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT_KHR` +\param hTargetProcess A valid handle to target process or null. If it's null, the function returns + handle for the current process. +\param[out] pHandle Output parameter that returns the handle. + +The function fills `pHandle` with handle that can be used in target process. +The handle is fetched using function `vkGetMemoryWin32HandleKHR`. + +if `handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR`, +each call to this function creates a new handle that must be closed using: + +\code +CloseHandle(handle); +\endcode + +You can close it any time, before or after destroying the allocation object. +It is reference-counted internally by Windows. + +Note the handle is returned for the entire `VkDeviceMemory` block that the allocation belongs to. +If the allocation is sub-allocated from a larger block, you may need to consider the offset of the allocation +(VmaAllocationInfo::offset). + +This function is available compile-time only when VK_KHR_external_memory_win32 extension is available. +It can be manually disabled by predefining `VMA_EXTERNAL_MEMORY_WIN32=0` macro. + +If the function fails with `VK_ERROR_FEATURE_NOT_PRESENT` error code, please double-check +that VmaVulkanFunctions::vkGetMemoryWin32HandleKHR function pointer is set, e.g. +either by using macro `VMA_DYNAMIC_VULKAN_FUNCTIONS` +or by manually passing it through VmaAllocatorCreateInfo::pVulkanFunctions. + +For more information, see chapter \ref other_api_interop. +*/ VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle2( VmaAllocator VMA_NOT_NULL allocator, VmaAllocation VMA_NOT_NULL allocation, @@ -17047,7 +17101,6 @@ Among many extensions available for Vulkan, only a few interact with memory mana VMA can automatically take advantage of them. Some of them are: VK_EXT_memory_budget, VK_EXT_memory_priority, VK_KHR_external_memory_win32, and VK_KHR_maintenance* extensions that are later promoted to the new versions of the core Vulkan API. - To use them, it is your responsibility to validate if they are available on the current system and if so, enable them while creating the Vulkan device object. You also need to pass appropriate #VmaAllocatorCreateFlagBits to inform VMA that they are enabled. @@ -17098,8 +17151,8 @@ You can access it in multiple ways: Is it a mature project? -Yes! The library is in development since June 2017, has over 1000 commits, over 400 issue tickets -and pull requests (most of them resolved), and over 70 contributors. +Yes! The library is in development since June 2017, has over 1000 commits, over 500 issue tickets +and pull requests (most of them resolved), and over 80 contributors. It is distributed together with Vulkan SDK. It is used by many software projects, including some large and popular ones like Qt or Blender, as well as some AAA games. @@ -18677,31 +18730,158 @@ individual names to allocations using vmaSetAllocationName(), can greatly aid in \page other_api_interop Interop with other graphics APIs -VMA provides some features that help with interoperability with other graphics APIs, e.g. OpenGL. +VMA provides some features that help with interoperability with other graphics APIs, e.g. OpenGL, Direct3D 11, Direct3D 12. -\section opengl_interop_exporting_memory Exporting memory +\section other_api_interop_exporting_memory Exporting memory -If you want to attach `VkExportMemoryAllocateInfoKHR` or other structure to `pNext` chain of memory allocations made by the library: +On Windows, the VK_KHR_external_memory_win32 device extension allows exporting a Win32 `HANDLE` +of a `VkDeviceMemory` block, to be able to reference the memory on other Vulkan logical devices or instances, +in multiple processes, and/or in multiple APIs. +VMA offers support for it. -You can create \ref custom_memory_pools for such allocations. -Define and fill in your `VkExportMemoryAllocateInfoKHR` structure and attach it to VmaPoolCreateInfo::pMemoryAllocateNext -while creating the custom pool. -Please note that the structure must remain alive and unchanged for the whole lifetime of the #VmaPool, -not only while creating it, as no copy of the structure is made, -but its original pointer is used for each allocation instead. +\subsection other_api_interop_exporting_initialization Initialization + +1) Make sure the extension is defined in the code by including following header before including VMA: + +\code +#include +\endcode + +2) Check if "VK_KHR_external_memory_win32" is available among device extensions. +Enable it when creating the `VkDevice` object. + +3) Enable the usage of this extension in VMA by setting flag #VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT +when calling vmaCreateAllocator(). + +4) Make sure that VMA has access to the `vkGetMemoryWin32HandleKHR` function by either enabling `VMA_DYNAMIC_VULKAN_FUNCTIONS` macro +or setting VmaVulkanFunctions::vkGetMemoryWin32HandleKHR explicitly. +For more information, see \ref quick_start_initialization_importing_vulkan_functions. + +\subsection other_api_interop_exporting_preparations Preparations + +You can find example usage among tests, in file "Tests.cpp", function `TestWin32Handles()`. + +To use the extenion, buffers need to be created with `VkExternalMemoryBufferCreateInfoKHR` attached to their `pNext` chain, +and memory allocations need to be made with `VkExportMemoryAllocateInfoKHR` attached to their `pNext` chain. +To make use of them, you need to use \ref custom_memory_pools. Example: + +\code +constexpr VkExternalMemoryHandleTypeFlagsKHR handleType = + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR; + +// Define an example buffer and allocation parameters. +VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = { + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR, + nullptr, + handleType +}; +VkBufferCreateInfo exampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +exampleBufCreateInfo.size = 0x10000; // Doesn't matter here. +exampleBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; +exampleBufCreateInfo.pNext = &externalMemBufCreateInfo; + +VmaAllocationCreateInfo exampleAllocCreateInfo = {}; +exampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + +// Find memory type index to use for the custom pool. +uint32_t memTypeIndex; +VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_Allocator, + &exampleBufCreateInfo, &exampleAllocCreateInfo, &memTypeIndex); +// Check res... + +// Create a custom pool. +constexpr static VkExportMemoryAllocateInfoKHR exportMemAllocInfo = { + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, + nullptr, + handleType +}; +VmaPoolCreateInfo poolCreateInfo = {}; +poolCreateInfo.memoryTypeIndex = memTypeIndex; +poolCreateInfo.pMemoryAllocateNext = (void*)&exportMemAllocInfo; + +VmaPool pool; +res = vmaCreatePool(g_Allocator, &poolCreateInfo, &pool); +// Check res... + +// YOUR OTHER CODE COMES HERE.... + +// At the end, don't forget to destroy it! +vmaDestroyPool(g_Allocator, pool); +\endcode + +Note that the structure passed as VmaPoolCreateInfo::pMemoryAllocateNext must remain alive and unchanged +for the whole lifetime of the custom pool, because it will be used when the pool allocates a new device memory block. +No copy is made internally. This is why variable `exportMemAllocInfo` is defined as static. If you want to export all memory allocated by VMA from certain memory types, also dedicated allocations or other allocations made from default pools, an alternative solution is to fill in VmaAllocatorCreateInfo::pTypeExternalMemoryHandleTypes. It should point to an array with `VkExternalMemoryHandleTypeFlagsKHR` to be automatically passed by the library through `VkExportMemoryAllocateInfoKHR` on each allocation made from a specific memory type. -Please note that new versions of the library also support dedicated allocations created in custom pools. - You should not mix these two methods in a way that allows to apply both to the same memory type. Otherwise, `VkExportMemoryAllocateInfoKHR` structure would be attached twice to the `pNext` chain of `VkMemoryAllocateInfo`. +\subsection other_api_interop_exporting_memory_allocation Memory allocation -\section opengl_interop_custom_alignment Custom alignment +Finally, you can create a buffer with an allocation out of the custom pool. +The buffer should use same flags as the sample buffer used to find the memory type. +It should also specify `VkExternalMemoryBufferCreateInfoKHR` in its `pNext` chain. + +\code +VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = { + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR, + nullptr, + handleType +}; +VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufCreateInfo.size = // Your desired buffer size. +bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; +bufCreateInfo.pNext = &externalMemBufCreateInfo; + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.pool = pool; // It is enough to set this one member. + +VkBuffer buf; +VmaAllocation alloc; +res = vmaCreateBuffer(g_Allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr); +// Check res... + +// YOUR OTHER CODE COMES HERE.... + +// At the end, don't forget to destroy it! +vmaDestroyBuffer(g_Allocator, buf, alloc); +\endcode + +If you need each allocation to have its own device memory block and start at offset 0, you can still do +by using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag. It works also with custom pools. + +\subsection other_api_interop_exporting_exporting_win32_handle Exporting Win32 handle + +After the allocation is created, you can acquire a Win32 `HANDLE` to the `VkDeviceMemory` block it belongs to. +VMA function vmaGetMemoryWin32Handle2() is a replacement of the Vulkan function `vkGetMemoryWin32HandleKHR`. + +\code +HANDLE handle; +res = vmaGetMemoryWin32Handle2(g_Allocator, alloc, handleType, nullptr, &handle); +// Check res... + +// YOUR OTHER CODE COMES HERE.... + +// At the end, you must close the handle. +CloseHandle(handle); +\endcode + +Documentation of the VK_KHR_external_memory_win32 extension states that: + +> If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType. + +This is ensured automatically inside VMA. +If `VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT` is used as the handle type, +the library fetches the handle on first use, remembers it internally, and closes it when the memory block or dedicated allocation is destroyed. +Every time you call vmaGetMemoryWin32Handle2(), VMA calls `DuplicateHandle` and returns a new handle that you need to close. +For further information, please check the documentation of this function. + +\subsection other_api_interop_exporting_custom_alignment Custom alignment Buffers or images exported to a different API like OpenGL may require a different alignment, higher than the one used by the library automatically, queried from functions like `vkGetBufferMemoryRequirements`. @@ -18714,19 +18894,20 @@ The alignment actually used will be the maximum of this member and the alignment from a function like `vkGetBufferMemoryRequirements`, which is called by VMA automatically. If you want to create a buffer with a specific minimum alignment out of default pools, -use special function vmaCreateBufferWithAlignment(), which takes additional parameter `minAlignment`. +you can use special function vmaCreateBufferWithAlignment(), which takes additional parameter `minAlignment`. Note the problem of alignment affects only resources placed inside bigger `VkDeviceMemory` blocks and not dedicated allocations, as these, by definition, always have alignment = 0 because the resource is bound to the beginning of its dedicated block. You can ensure that an allocation is created as dedicated by using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT. Contrary to Direct3D 12, Vulkan doesn't have a concept of alignment of the entire memory block passed on its allocation. -\section opengl_interop_extended_allocation_information Extended allocation information +\subsection other_api_interop_exporting_extended_allocation_information Extended allocation information If you want to rely on VMA to allocate your buffers and images inside larger memory blocks, but you need to know the size of the entire block and whether the allocation was made with its own dedicated memory, use function vmaGetAllocationInfo2() to retrieve -extended allocation information in structure #VmaAllocationInfo2. +extended allocation information in structure #VmaAllocationInfo2, which provides extra members: +`blockSize` and `dedicatedMemory`. @@ -19282,145 +19463,6 @@ Example use of this extension can be found in the code of the sample and test su accompanying this library. -\page vk_khr_external_memory_win32 VK_KHR_external_memory_win32 - -On Windows, the VK_KHR_external_memory_win32 device extension allows exporting a Win32 `HANDLE` -of a `VkDeviceMemory` block, to be able to reference the memory on other Vulkan logical devices or instances, -in multiple processes, and/or in multiple APIs. -VMA offers support for it. - -\section vk_khr_external_memory_win32_initialization Initialization - -1) Make sure the extension is defined in the code by including following header before including VMA: - -\code -#include -\endcode - -2) Check if "VK_KHR_external_memory_win32" is available among device extensions. -Enable it when creating the `VkDevice` object. - -3) Enable the usage of this extension in VMA by setting flag #VMA_ALLOCATOR_CREATE_KHR_EXTERNAL_MEMORY_WIN32_BIT -when calling vmaCreateAllocator(). - -4) Make sure that VMA has access to the `vkGetMemoryWin32HandleKHR` function by either enabling `VMA_DYNAMIC_VULKAN_FUNCTIONS` macro -or setting VmaVulkanFunctions::vkGetMemoryWin32HandleKHR explicitly. -For more information, see \ref quick_start_initialization_importing_vulkan_functions. - -\section vk_khr_external_memory_win32_preparations Preparations - -You can find example usage among tests, in file "Tests.cpp", function `TestWin32Handles()`. - -To use the extenion, buffers need to be created with `VkExternalMemoryBufferCreateInfoKHR` attached to their `pNext` chain, -and memory allocations need to be made with `VkExportMemoryAllocateInfoKHR` attached to their `pNext` chain. -To make use of them, you need to use \ref custom_memory_pools. Example: - -\code -// Define an example buffer and allocation parameters. -VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = { - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR, - nullptr, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT -}; -VkBufferCreateInfo exampleBufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; -exampleBufCreateInfo.size = 0x10000; // Doesn't matter here. -exampleBufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; -exampleBufCreateInfo.pNext = &externalMemBufCreateInfo; - -VmaAllocationCreateInfo exampleAllocCreateInfo = {}; -exampleAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; - -// Find memory type index to use for the custom pool. -uint32_t memTypeIndex; -VkResult res = vmaFindMemoryTypeIndexForBufferInfo(g_Allocator, - &exampleBufCreateInfo, &exampleAllocCreateInfo, &memTypeIndex); -// Check res... - -// Create a custom pool. -constexpr static VkExportMemoryAllocateInfoKHR exportMemAllocInfo = { - VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, - nullptr, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT -}; -VmaPoolCreateInfo poolCreateInfo = {}; -poolCreateInfo.memoryTypeIndex = memTypeIndex; -poolCreateInfo.pMemoryAllocateNext = (void*)&exportMemAllocInfo; - -VmaPool pool; -res = vmaCreatePool(g_Allocator, &poolCreateInfo, &pool); -// Check res... - -// YOUR OTHER CODE COMES HERE.... - -// At the end, don't forget to destroy it! -vmaDestroyPool(g_Allocator, pool); -\endcode - -Note that the structure passed as VmaPoolCreateInfo::pMemoryAllocateNext must remain alive and unchanged -for the whole lifetime of the custom pool, because it will be used when the pool allocates a new device memory block. -No copy is made internally. This is why variable `exportMemAllocInfo` is defined as `static`. - -\section vk_khr_external_memory_win32_memory_allocation Memory allocation - -Finally, you can create a buffer with an allocation out of the custom pool. -The buffer should use same flags as the sample buffer used to find the memory type. -It should also specify `VkExternalMemoryBufferCreateInfoKHR` in its `pNext` chain. - -\code -VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = { - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR, - nullptr, - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT -}; -VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; -bufCreateInfo.size = // Your desired buffer size. -bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; -bufCreateInfo.pNext = &externalMemBufCreateInfo; - -VmaAllocationCreateInfo allocCreateInfo = {}; -allocCreateInfo.pool = pool; // It is enough to set this one member. - -VkBuffer buf; -VmaAllocation alloc; -res = vmaCreateBuffer(g_Allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr); -// Check res... - -// YOUR OTHER CODE COMES HERE.... - -// At the end, don't forget to destroy it! -vmaDestroyBuffer(g_Allocator, buf, alloc); -\endcode - -If you need each allocation to have its own device memory block and start at offset 0, you can still do -by using #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT flag. It works also with custom pools. - -\section vk_khr_external_memory_win32_exporting_win32_handle Exporting Win32 handle - -After the allocation is created, you can acquire a Win32 `HANDLE` to the `VkDeviceMemory` block it belongs to. -VMA function vmaGetMemoryWin32Handle() is a replacement of the Vulkan function `vkGetMemoryWin32HandleKHR`. - -\code -HANDLE handle; -res = vmaGetMemoryWin32Handle(g_Allocator, alloc, nullptr, &handle); -// Check res... - -// YOUR OTHER CODE COMES HERE.... - -// At the end, you must close the handle. -CloseHandle(handle); -\endcode - -Documentation of the VK_KHR_external_memory_win32 extension states that: - -> If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType. - -This is ensured automatically inside VMA. -The library fetches the handle on first use, remembers it internally, and closes it when the memory block or dedicated allocation is destroyed. -Every time you call vmaGetMemoryWin32Handle(), VMA calls `DuplicateHandle` and returns a new handle that you need to close. - -For further information, please check documentation of the vmaGetMemoryWin32Handle() function. - - \page enabling_buffer_device_address Enabling buffer device address Device extension VK_KHR_buffer_device_address From dc32c0689c715daa157068c67e6aebafae9cc5bb Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 09:18:43 +0200 Subject: [PATCH 08/16] Improved documentation of function vmaCreateBuffer --- docs/html/group__group__alloc.html | 15 ++++++++------- include/vk_mem_alloc.h | 18 +++++++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/docs/html/group__group__alloc.html b/docs/html/group__group__alloc.html index 9712e0a9..680918e5 100644 --- a/docs/html/group__group__alloc.html +++ b/docs/html/group__group__alloc.html @@ -1631,12 +1631,12 @@

    VkBuffer, allocates and binds memory for it.

    Parameters
    - - - + + + - +
    allocator
    pBufferCreateInfo
    pAllocationCreateInfo
    allocatorThe main allocator object.
    pBufferCreateInfoBuffer creation parameters.
    pAllocationCreateInfoAllocation creation parameters.
    [out]pBufferBuffer that was created.
    [out]pAllocationAllocation that was created.
    [out]pAllocationInfoOptional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
    [out]pAllocationInfoOptional, can be null. Information about allocated memory. It can be also fetched later using vmaGetAllocationInfo().
    @@ -1646,10 +1646,11 @@

    *pBuffer and *pAllocation are null.

    +

    If any of these operations fail, buffer and allocation are not created, returned value is negative error code, *pBuffer and *pAllocation are returned as null.

    If the function succeeded, you must destroy both buffer and allocation when you no longer need them using either convenience function vmaDestroyBuffer() or separately, using vkDestroyBuffer() and vmaFreeMemory().

    -

    If VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag was used, VK_KHR_dedicated_allocation extension is used internally to query driver whether it requires or prefers the new buffer to have dedicated allocation. If yes, and if dedicated allocation is possible (VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated allocation for this buffer, just like when using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.

    -
    Note
    This function creates a new VkBuffer. Sub-allocation of parts of one large buffer, although recommended as a good practice, is out of scope of this library and could be implemented by the user as a higher-level logic on top of VMA.
    +

    If VK_KHR_dedicated_allocation extenion or Vulkan version >= 1.1 is used, the function queries the driver whether it requires or prefers the new buffer to have dedicated allocation. If yes, and if dedicated allocation is possible (VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated allocation for this buffer, just like when using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT.

    +
    Note
    This function creates a new VkBuffer. Sub-allocation of parts of one large buffer, although recommended as a good practice, is out of scope of this library and could be implemented by the user as a higher-level logic on top of VMA.
    +

    There is also an extended version of this function available with additional parameter minAlignment - see vmaCreateBufferWithAlignment().

    diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 1cab24de..ef84cdf0 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -2605,12 +2605,13 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaBindImageMemory2( /** \brief Creates a new `VkBuffer`, allocates and binds memory for it. -\param allocator -\param pBufferCreateInfo -\param pAllocationCreateInfo +\param allocator The main allocator object. +\param pBufferCreateInfo Buffer creation parameters. +\param pAllocationCreateInfo Allocation creation parameters. \param[out] pBuffer Buffer that was created. \param[out] pAllocation Allocation that was created. -\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo(). +\param[out] pAllocationInfo Optional, can be null. Information about allocated memory. + It can be also fetched later using vmaGetAllocationInfo(). This function automatically: @@ -2619,14 +2620,14 @@ This function automatically: -# Binds the buffer with the memory. If any of these operations fail, buffer and allocation are not created, -returned value is negative error code, `*pBuffer` and `*pAllocation` are null. +returned value is negative error code, `*pBuffer` and `*pAllocation` are returned as null. If the function succeeded, you must destroy both buffer and allocation when you no longer need them using either convenience function vmaDestroyBuffer() or separately, using `vkDestroyBuffer()` and vmaFreeMemory(). -If #VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT flag was used, -VK_KHR_dedicated_allocation extension is used internally to query driver whether +If VK_KHR_dedicated_allocation extenion or Vulkan version >= 1.1 is used, +the function queries the driver whether it requires or prefers the new buffer to have dedicated allocation. If yes, and if dedicated allocation is possible (#VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT is not used), it creates dedicated @@ -2636,6 +2637,9 @@ allocation for this buffer, just like when using \note This function creates a new `VkBuffer`. Sub-allocation of parts of one large buffer, although recommended as a good practice, is out of scope of this library and could be implemented by the user as a higher-level logic on top of VMA. + +There is also an extended version of this function available with additional parameter `minAlignment` - +see vmaCreateBufferWithAlignment(). */ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer( VmaAllocator VMA_NOT_NULL allocator, From 62ce8ac5bfe22b88ea60bf8c8d293f23440aad59 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 09:25:22 +0200 Subject: [PATCH 09/16] Updated documentation of vmaAllocateMemory function --- docs/html/group__group__alloc.html | 17 +++++++++++------ include/vk_mem_alloc.h | 21 ++++++++++++++------- 2 files changed, 25 insertions(+), 13 deletions(-) diff --git a/docs/html/group__group__alloc.html b/docs/html/group__group__alloc.html index 680918e5..8448604f 100644 --- a/docs/html/group__group__alloc.html +++ b/docs/html/group__group__alloc.html @@ -826,16 +826,21 @@

    Parameters
    - - - + + + - +
    allocator
    pVkMemoryRequirements
    pCreateInfo
    allocatorThe main allocator object.
    pVkMemoryRequirementsRequirements for the allocated memory.
    pCreateInfoAllocation creation parameters.
    [out]pAllocationHandle to allocated memory.
    [out]pAllocationInfoOptional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo().
    [out]pAllocationInfoOptional, can be null. Information about allocated memory. It can be also fetched later using vmaGetAllocationInfo().
    -

    You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages().

    -

    It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(), vmaCreateBuffer(), vmaCreateImage() instead whenever possible.

    +

    The function creates a VmaAllocation object without creating a buffer or an image together with it.

    + +

    You must free the returned allocation object using vmaFreeMemory() or vmaFreeMemoryPages().

    diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index ef84cdf0..889ef935 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -1962,16 +1962,23 @@ VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName( /** \brief General purpose memory allocation. -\param allocator -\param pVkMemoryRequirements -\param pCreateInfo +\param allocator The main allocator object. +\param pVkMemoryRequirements Requirements for the allocated memory. +\param pCreateInfo Allocation creation parameters. \param[out] pAllocation Handle to allocated memory. -\param[out] pAllocationInfo Optional. Information about allocated memory. It can be later fetched using function vmaGetAllocationInfo(). +\param[out] pAllocationInfo Optional, can be null. Information about allocated memory. It can be also fetched later using vmaGetAllocationInfo(). -You should free the memory using vmaFreeMemory() or vmaFreeMemoryPages(). +The function creates a #VmaAllocation object without creating a buffer or an image together with it. + +- It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(), + vmaCreateBuffer(), vmaCreateImage() instead whenever possible. +- You can also create a buffer or an image later in an existing allocation using + vmaCreateAliasingBuffer2(), vmaCreateAliasingImage2(). +- You can also create a buffer or an image on your own and bind it to an existing allocation + using vmaBindBufferMemory2(), vmaBindImageMemory2(). + +You must free the returned allocation object using vmaFreeMemory() or vmaFreeMemoryPages(). -It is recommended to use vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(), -vmaCreateBuffer(), vmaCreateImage() instead whenever possible. */ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory( VmaAllocator VMA_NOT_NULL allocator, From 061b8580bad829581e94dd363c1530d3bb066089 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 10:30:33 +0200 Subject: [PATCH 10/16] Added function vmaAllocateDedicatedMemory and a test for it The test uses CreateFileMapping to create WinAPI shared memory handle. --- include/vk_mem_alloc.h | 77 +++++++++++++++- src/Tests.cpp | 196 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 265 insertions(+), 8 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 889ef935..f7d738e7 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -1987,6 +1987,15 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory( VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation, VmaAllocationInfo* VMA_NULLABLE pAllocationInfo); +/** \bref TODO docs... */ +VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateDedicatedMemory( + VmaAllocator VMA_NOT_NULL allocator, + const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements, + const VmaAllocationCreateInfo* VMA_NOT_NULL pCreateInfo, + void* VMA_NULLABLE VMA_EXTENDS_VK_STRUCT(VkMemoryAllocateInfo) pMemoryAllocateNext, + VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation, + VmaAllocationInfo* VMA_NULLABLE pAllocationInfo); + /** \brief General purpose memory allocation for multiple allocation objects at once. \param allocator Allocator object. @@ -10482,6 +10491,7 @@ struct VmaAllocator_T VkBuffer dedicatedBuffer, VkImage dedicatedImage, VmaBufferImageUsage dedicatedBufferImageUsage, + void* pMemoryAllocateNext, // Optional pNext chain for VkMemoryAllocateInfo. const VmaAllocationCreateInfo& createInfo, VmaSuballocationType suballocType, size_t allocationCount, @@ -10627,6 +10637,7 @@ struct VmaAllocator_T VkBuffer dedicatedBuffer, VkImage dedicatedImage, VmaBufferImageUsage dedicatedBufferImageUsage, + void* pMemoryAllocateNext, // Optional pNext chain for VkMemoryAllocateInfo. const VmaAllocationCreateInfo& createInfo, uint32_t memTypeIndex, VmaSuballocationType suballocType, @@ -10666,7 +10677,7 @@ struct VmaAllocator_T VmaBufferImageUsage dedicatedBufferImageUsage, size_t allocationCount, VmaAllocation* pAllocations, - const void* pNextChain = VMA_NULL); + const void* pNextChain); void FreeDedicatedMemory(VmaAllocation allocation); @@ -13588,6 +13599,7 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( VkBuffer dedicatedBuffer, VkImage dedicatedImage, VmaBufferImageUsage dedicatedBufferImageUsage, + void* pMemoryAllocateNext, const VmaAllocationCreateInfo& createInfo, uint32_t memTypeIndex, VmaSuballocationType suballocType, @@ -13608,6 +13620,14 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( if(res != VK_SUCCESS) return res; + const void* allocateNextPtr = blockVector.GetAllocationNextPtr(); + if(pMemoryAllocateNext != VMA_NULL) + { + VMA_ASSERT(allocateNextPtr == VMA_NULL && + "You shouldn't create a dedicated allocation with a custom pMemoryAllocateNext if the pNext chain is already provided for this pool."); + allocateNextPtr = pMemoryAllocateNext; + } + if((finalCreateInfo.flags & VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT) != 0) { return AllocateDedicatedMemory( @@ -13628,7 +13648,7 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( dedicatedBufferImageUsage, allocationCount, pAllocations, - blockVector.GetAllocationNextPtr()); + allocateNextPtr); } const bool canAllocateDedicated = @@ -13671,7 +13691,7 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( dedicatedBufferImageUsage, allocationCount, pAllocations, - blockVector.GetAllocationNextPtr()); + allocateNextPtr); if(res == VK_SUCCESS) { // Succeeded: AllocateDedicatedMemory function already filled pMemory, nothing more to do here. @@ -13712,7 +13732,7 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( dedicatedBufferImageUsage, allocationCount, pAllocations, - blockVector.GetAllocationNextPtr()); + allocateNextPtr); if(res == VK_SUCCESS) { // Succeeded: AllocateDedicatedMemory function already filled pMemory, nothing more to do here. @@ -13720,6 +13740,7 @@ VkResult VmaAllocator_T::AllocateMemoryOfType( return VK_SUCCESS; } } + // Everything failed: Return error code. VMA_DEBUG_LOG(" vkAllocateMemory FAILED"); return res; @@ -14150,6 +14171,8 @@ VkResult VmaAllocator_T::AllocateMemory( VkBuffer dedicatedBuffer, VkImage dedicatedImage, VmaBufferImageUsage dedicatedBufferImageUsage, + // pNext chain for VkMemoryAllocateInfo. When used, must specify requiresDedicatedAllocation = true. + void* pMemoryAllocateNext, const VmaAllocationCreateInfo& createInfo, VmaSuballocationType suballocType, size_t allocationCount, @@ -14158,6 +14181,8 @@ VkResult VmaAllocator_T::AllocateMemory( memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount); VMA_ASSERT(VmaIsPow2(vkMemReq.alignment)); + // If using custom pNext chain for VkMemoryAllocateInfo, must require dedicated allocations. + VMA_ASSERT(pMemoryAllocateNext == VMA_NULL || requiresDedicatedAllocation); if(vkMemReq.size == 0) { @@ -14180,6 +14205,7 @@ VkResult VmaAllocator_T::AllocateMemory( dedicatedBuffer, dedicatedImage, dedicatedBufferImageUsage, + pMemoryAllocateNext, createInfoFinal, blockVector.GetMemoryTypeIndex(), suballocType, @@ -14209,6 +14235,7 @@ VkResult VmaAllocator_T::AllocateMemory( dedicatedBuffer, dedicatedImage, dedicatedBufferImageUsage, + pMemoryAllocateNext, createInfoFinal, memTypeIndex, suballocType, @@ -15841,6 +15868,42 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory( VK_NULL_HANDLE, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage + VMA_NULL, // pMemoryAllocateNext + *pCreateInfo, + VMA_SUBALLOCATION_TYPE_UNKNOWN, + 1, // allocationCount + pAllocation); + + if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS) + { + allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); + } + + return result; +} + +VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateDedicatedMemory( + VmaAllocator allocator, + const VkMemoryRequirements* pVkMemoryRequirements, + const VmaAllocationCreateInfo* pCreateInfo, + void* pMemoryAllocateNext, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) +{ + VMA_ASSERT(allocator && pVkMemoryRequirements && pCreateInfo && pAllocation); + + VMA_DEBUG_LOG("vmaAllocateDedicatedMemory"); + + VMA_DEBUG_GLOBAL_MUTEX_LOCK + + VkResult result = allocator->AllocateMemory( + *pVkMemoryRequirements, + true, // requiresDedicatedAllocation + false, // prefersDedicatedAllocation + VK_NULL_HANDLE, // dedicatedBuffer + VK_NULL_HANDLE, // dedicatedImage + VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage + pMemoryAllocateNext, *pCreateInfo, VMA_SUBALLOCATION_TYPE_UNKNOWN, 1, // allocationCount @@ -15880,6 +15943,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages( VK_NULL_HANDLE, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage + VMA_NULL, // pMemoryAllocateNext *pCreateInfo, VMA_SUBALLOCATION_TYPE_UNKNOWN, allocationCount, @@ -15923,6 +15987,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer( buffer, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage + VMA_NULL, // pMemoryAllocateNext *pCreateInfo, VMA_SUBALLOCATION_TYPE_BUFFER, 1, // allocationCount @@ -15962,6 +16027,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage( VK_NULL_HANDLE, // dedicatedBuffer image, // dedicatedImage VmaBufferImageUsage::UNKNOWN, // dedicatedBufferImageUsage + VMA_NULL, // pMemoryAllocateNext *pCreateInfo, VMA_SUBALLOCATION_TYPE_IMAGE_UNKNOWN, 1, // allocationCount @@ -16399,6 +16465,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer( *pBuffer, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage VmaBufferImageUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5), // dedicatedBufferImageUsage + VMA_NULL, // pMemoryAllocateNext *pAllocationCreateInfo, VMA_SUBALLOCATION_TYPE_BUFFER, 1, // allocationCount @@ -16494,6 +16561,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( *pBuffer, // dedicatedBuffer VK_NULL_HANDLE, // dedicatedImage VmaBufferImageUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5), // dedicatedBufferImageUsage + VMA_NULL, // pMemoryAllocateNext *pAllocationCreateInfo, VMA_SUBALLOCATION_TYPE_BUFFER, 1, // allocationCount @@ -16673,6 +16741,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage( VK_NULL_HANDLE, // dedicatedBuffer *pImage, // dedicatedImage VmaBufferImageUsage(*pImageCreateInfo), // dedicatedBufferImageUsage + VMA_NULL, // pMemoryAllocateNext *pAllocationCreateInfo, suballocType, 1, // allocationCount diff --git a/src/Tests.cpp b/src/Tests.cpp index 43767552..48e4784c 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -8485,13 +8485,13 @@ static void TestMappingHysteresis() } -static void TestWin32Handles() +static void TestWin32HandlesExport() { #if VMA_EXTERNAL_MEMORY_WIN32 if (!VK_KHR_external_memory_win32_enabled) return; - wprintf(L"Test Win32 handles\n"); + wprintf(L"Test Win32 handles export\n"); constexpr VkExternalMemoryHandleTypeFlagBits handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; @@ -8579,14 +8579,201 @@ static void TestWin32Handles() #endif } +static void TestWin32HandlesImport() +{ +#if VMA_EXTERNAL_MEMORY_WIN32 + if (!VK_KHR_external_memory_win32_enabled) + return; + + wprintf(L"Test Win32 handles import\n"); + + const uint32_t dataValue = 0x72158510; + + for(size_t testIndex = 0; testIndex < 2; ++testIndex) + { + const bool testImport = testIndex > 0; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 0x10000; // 64 KB + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + + HANDLE sharedHandle = NULL; + if(testImport) + { + const wchar_t* mappingName = L"MySharedVulkanMemory"; + sharedHandle = CreateFileMapping( + INVALID_HANDLE_VALUE, // hFile - only in memory, no file. + NULL, // lpFileMappingAttributes + PAGE_READWRITE, + 0, // dwMaximumSizeHigh + (DWORD)bufCreateInfo.size, // dwMaximumSizeLow + mappingName); + TEST(sharedHandle != NULL); + + // Map the memory temporarily and write the dataValue there. + void* sharedMemoryPtr = MapViewOfFile( + sharedHandle, + FILE_MAP_ALL_ACCESS, + 0, // dwFileOffsetHigh + 0, // dwFileOffsetLow + bufCreateInfo.size); + TEST(sharedMemoryPtr != NULL); + memcpy(sharedMemoryPtr, &dataValue, sizeof(dataValue)); + UnmapViewOfFile(sharedMemoryPtr); + } + + VkImportMemoryWin32HandleInfoKHR importInfo = { + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR }; + VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = { + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR }; + void* memoryAllocateNext = nullptr; + + if(testImport) + { + constexpr VkExternalMemoryHandleTypeFlagBits handleType = + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + + externalMemBufCreateInfo.handleTypes = handleType; + bufCreateInfo.pNext = &externalMemBufCreateInfo; + + importInfo.handleType = handleType; + importInfo.handle = sharedHandle; + memoryAllocateNext = &importInfo; + } + + VkBuffer buf = VK_NULL_HANDLE; + TEST(vkCreateBuffer(g_hDevice, &bufCreateInfo, g_Allocs, &buf) == VK_SUCCESS); + + VmaAllocationCreateInfo allocCreateInfo = {}; + // Will need to read the data. + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + + VkMemoryRequirements memReq = {}; + vkGetBufferMemoryRequirements(g_hDevice, buf, &memReq); + + VmaAllocation alloc = VK_NULL_HANDLE; + TEST(vmaAllocateDedicatedMemory(g_hAllocator, &memReq, + &allocCreateInfo, memoryAllocateNext, &alloc, nullptr) == VK_SUCCESS); + + VmaAllocationInfo2 allocInfo2 = {}; + vmaGetAllocationInfo2(g_hAllocator, alloc, &allocInfo2); + TEST(allocInfo2.dedicatedMemory); + + TEST(vmaBindBufferMemory(g_hAllocator, alloc, buf) == VK_SUCCESS); + + if(testImport) + { + uint32_t readValue = 0; + TEST(vmaCopyAllocationToMemory(g_hAllocator, alloc, 0, &readValue, sizeof readValue) == VK_SUCCESS); + TEST(readValue == dataValue); + } + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + + if(testImport) + { + CloseHandle(sharedHandle); + } + } + +#if 0 + constexpr VkExternalMemoryHandleTypeFlagBits handleType = + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + + constexpr static VkExportMemoryAllocateInfoKHR exportMemAllocInfo{ + VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR, + nullptr, + handleType + }; + + constexpr static VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo{ + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR, + nullptr, + handleType + }; + + VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; + bufCreateInfo.size = 0x10000; + bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; + bufCreateInfo.pNext = &externalMemBufCreateInfo; + + bool requiresDedicated = true; + { + VkPhysicalDeviceExternalBufferInfo externalBufferInfo = { + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO }; + externalBufferInfo.flags = bufCreateInfo.flags; + externalBufferInfo.usage = bufCreateInfo.usage; + externalBufferInfo.handleType = handleType; + + VkExternalBufferProperties externalBufferProperties = { + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES }; + + vkGetPhysicalDeviceExternalBufferProperties(g_hPhysicalDevice, + &externalBufferInfo, &externalBufferProperties); + if((externalBufferProperties.externalMemoryProperties.externalMemoryFeatures & + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT) == 0) + { + wprintf(L"WARNING: External memory not exportable, skipping test.\n"); + return; + } + requiresDedicated = (externalBufferProperties.externalMemoryProperties.externalMemoryFeatures & + VK_EXTERNAL_MEMORY_FEATURE_DEDICATED_ONLY_BIT) != 0; + } + + VmaAllocationCreateInfo allocCreateInfo = {}; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + uint32_t memTypeIndex = UINT32_MAX; + TEST(vmaFindMemoryTypeIndexForBufferInfo(g_hAllocator, + &bufCreateInfo, &allocCreateInfo, &memTypeIndex) == VK_SUCCESS); + + VmaPoolCreateInfo poolCreateInfo = {}; + poolCreateInfo.memoryTypeIndex = memTypeIndex; + poolCreateInfo.pMemoryAllocateNext = (void*)&exportMemAllocInfo; + + VmaPool pool = VK_NULL_HANDLE; + TEST(vmaCreatePool(g_hAllocator, &poolCreateInfo, &pool) == VK_SUCCESS); + + allocCreateInfo.pool = pool; + + for (size_t test = 0; test < 2; ++test) + { + if(test == 0 && requiresDedicated) + continue; // Skip this case because it would fail. + if (test == 1) + allocCreateInfo.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + VkBuffer buf = VK_NULL_HANDLE; + VmaAllocation alloc = VK_NULL_HANDLE; + TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr) == VK_SUCCESS); + HANDLE handle = NULL; + HANDLE handle2 = NULL; + TEST(vmaGetMemoryWin32Handle(g_hAllocator, alloc, nullptr, &handle) == VK_SUCCESS); + TEST(handle != nullptr); + TEST(vmaGetMemoryWin32Handle(g_hAllocator, alloc, nullptr, &handle2) == VK_SUCCESS); + TEST(handle2 != nullptr); + TEST(handle2 != handle); + + vmaDestroyBuffer(g_hAllocator, buf, alloc); + TEST(CloseHandle(handle)); + TEST(CloseHandle(handle2)); + } + + vmaDestroyPool(g_hAllocator, pool); +#endif // #if 0 + +#endif +} + void Test() { wprintf(L"TESTING:\n"); - if(false) + if(true) { //////////////////////////////////////////////////////////////////////////////// // Temporarily insert custom tests here: + TestWin32HandlesImport(); return; } @@ -8624,7 +8811,8 @@ void Test() TestMappingHysteresis(); TestDeviceLocalMapped(); TestMaintenance5(); - TestWin32Handles(); + TestWin32HandlesExport(); + TestWin32HandlesImport(); TestMappingMultithreaded(); TestLinearAllocator(); ManuallyTestLinearAllocator(); From b635a0fe4cc9ea5c5941d1c606fd5132a11f2160 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 10:49:30 +0200 Subject: [PATCH 11/16] Improvements in TestWin32HandlesImport - calling vkGetPhysicalDeviceExternalBufferProperties --- src/Tests.cpp | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) diff --git a/src/Tests.cpp b/src/Tests.cpp index 48e4784c..d28b2c6b 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -8587,7 +8587,14 @@ static void TestWin32HandlesImport() wprintf(L"Test Win32 handles import\n"); - const uint32_t dataValue = 0x72158510; + constexpr VkExternalMemoryHandleTypeFlagBits handleType = + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + constexpr uint32_t dataValue = 0x72158510; + + PFN_vkGetPhysicalDeviceExternalBufferProperties pfnGetPhysicalDeviceExternalBufferProperties = + (PFN_vkGetPhysicalDeviceExternalBufferProperties) + vkGetInstanceProcAddr(g_hVulkanInstance, "vkGetPhysicalDeviceExternalBufferProperties"); + TEST(pfnGetPhysicalDeviceExternalBufferProperties != nullptr); for(size_t testIndex = 0; testIndex < 2; ++testIndex) { @@ -8600,6 +8607,25 @@ static void TestWin32HandlesImport() HANDLE sharedHandle = NULL; if(testImport) { + VkPhysicalDeviceExternalBufferInfo externalBufInfo = { + VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO }; + externalBufInfo.flags = bufCreateInfo.flags; + externalBufInfo.usage = bufCreateInfo.usage; + externalBufInfo.handleType = handleType; + + VkExternalBufferProperties externalBufProps = { + VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES }; + + pfnGetPhysicalDeviceExternalBufferProperties(g_hPhysicalDevice, + &externalBufInfo, &externalBufProps); + + if((externalBufProps.externalMemoryProperties.externalMemoryFeatures & + VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT) == 0) + { + wprintf(L" WARNING: External memory not importable, skipping test.\n"); + continue; + } + const wchar_t* mappingName = L"MySharedVulkanMemory"; sharedHandle = CreateFileMapping( INVALID_HANDLE_VALUE, // hFile - only in memory, no file. @@ -8630,9 +8656,6 @@ static void TestWin32HandlesImport() if(testImport) { - constexpr VkExternalMemoryHandleTypeFlagBits handleType = - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; - externalMemBufCreateInfo.handleTypes = handleType; bufCreateInfo.pNext = &externalMemBufCreateInfo; @@ -8769,11 +8792,10 @@ void Test() { wprintf(L"TESTING:\n"); - if(true) + if(false) { //////////////////////////////////////////////////////////////////////////////// // Temporarily insert custom tests here: - TestWin32HandlesImport(); return; } From c1e6a311b6c6795f3b300bf97baf32af7de68817 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 11:01:58 +0200 Subject: [PATCH 12/16] Updated documentation of vmaGetMemoryWin32Handle2 and related places Based on discussion in https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/pull/503 - thanks @Agrael1 --- docs/html/group__group__alloc.html | 2 +- docs/html/other_api_interop.html | 2 +- include/vk_mem_alloc.h | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/html/group__group__alloc.html b/docs/html/group__group__alloc.html index 8448604f..056d85bf 100644 --- a/docs/html/group__group__alloc.html +++ b/docs/html/group__group__alloc.html @@ -2405,7 +2405,7 @@

    pHandle with handle that can be used in target process. The handle is fetched using function vkGetMemoryWin32HandleKHR.

    -

    if handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, each call to this function creates a new handle that must be closed using:

    +

    If handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR, or other NT handle types, each call to this function creates a new handle that must be closed using:

    CloseHandle(handle);

    You can close it any time, before or after destroying the allocation object. It is reference-counted internally by Windows.

    Note the handle is returned for the entire VkDeviceMemory block that the allocation belongs to. If the allocation is sub-allocated from a larger block, you may need to consider the offset of the allocation (VmaAllocationInfo::offset).

    diff --git a/docs/html/other_api_interop.html b/docs/html/other_api_interop.html index 3ff051fe..ffef6257 100644 --- a/docs/html/other_api_interop.html +++ b/docs/html/other_api_interop.html @@ -192,7 +192,7 @@

    If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.

    -

    This is ensured automatically inside VMA. If VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT is used as the handle type, the library fetches the handle on first use, remembers it internally, and closes it when the memory block or dedicated allocation is destroyed. Every time you call vmaGetMemoryWin32Handle2(), VMA calls DuplicateHandle and returns a new handle that you need to close. For further information, please check the documentation of this function.

    +

    This is ensured automatically inside VMA. If VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT is used as the handle type, or other NT handle types, the library fetches the handle on first use, remembers it internally, and closes it when the memory block or dedicated allocation is destroyed. Every time you call vmaGetMemoryWin32Handle2(), VMA calls DuplicateHandle and returns a new handle that you need to close. For further information, please check the documentation of this function.

    Custom alignment

    Buffers or images exported to a different API like OpenGL may require a different alignment, higher than the one used by the library automatically, queried from functions like vkGetBufferMemoryRequirements. To impose such alignment:

    diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 889ef935..8cc04e61 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -2210,7 +2210,8 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaGetMemoryWin32Handle( The function fills `pHandle` with handle that can be used in target process. The handle is fetched using function `vkGetMemoryWin32HandleKHR`. -if `handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR`, +If `handleType == VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR`, +or other NT handle types, each call to this function creates a new handle that must be closed using: \code @@ -18888,6 +18889,7 @@ Documentation of the VK_KHR_external_memory_win32 extension states that: This is ensured automatically inside VMA. If `VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT` is used as the handle type, +or other NT handle types, the library fetches the handle on first use, remembers it internally, and closes it when the memory block or dedicated allocation is destroyed. Every time you call vmaGetMemoryWin32Handle2(), VMA calls `DuplicateHandle` and returns a new handle that you need to close. For further information, please check the documentation of this function. From 9f097a6a4521cf8587976ac702f4a964060f10da Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 11:21:53 +0200 Subject: [PATCH 13/16] Added function vmaCreateDedicatedBuffer Refactored common code into function VmaAllocator_T::CreateBuffer. --- include/vk_mem_alloc.h | 292 +++++++++++++++++++---------------------- 1 file changed, 134 insertions(+), 158 deletions(-) diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index f7d738e7..11347295 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -2680,6 +2680,16 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation, VmaAllocationInfo* VMA_NULLABLE pAllocationInfo); +/** \brief TODO docs... */ +VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateDedicatedBuffer( + VmaAllocator VMA_NOT_NULL allocator, + const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo, + const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo, + void* VMA_NULLABLE VMA_EXTENDS_VK_STRUCT(VkMemoryAllocateInfo) pMemoryAllocateNext, + VkBuffer VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pBuffer, + VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation, + VmaAllocationInfo* VMA_NULLABLE pAllocationInfo); + /** \brief Creates a new `VkBuffer`, binds already created memory for it. \param allocator @@ -10483,6 +10493,16 @@ struct VmaAllocator_T VmaBufferImageUsage bufImgUsage, uint32_t* pMemoryTypeIndex) const; + // Common code for public functions vmaCreateBuffer, vmaCreateBufferWithAlignment, etc. + VkResult CreateBuffer( + const VkBufferCreateInfo* pBufferCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, + VkDeviceSize minAlignment, + void* pMemoryAllocateNext, // pNext chain for VkMemoryAllocateInfo. + VkBuffer* pBuffer, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo); + // Main allocation function. VkResult AllocateMemory( const VkMemoryRequirements& vkMemReq, @@ -14164,6 +14184,95 @@ VkResult VmaAllocator_T::CalcAllocationParams( return VK_SUCCESS; } +VkResult VmaAllocator_T::CreateBuffer( + const VkBufferCreateInfo* pBufferCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, + VkDeviceSize minAlignment, + void* pMemoryAllocateNext, + VkBuffer* pBuffer, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) +{ + *pBuffer = VK_NULL_HANDLE; + *pAllocation = VK_NULL_HANDLE; + + if (pBufferCreateInfo->size == 0) + { + return VK_ERROR_INITIALIZATION_FAILED; + } + if ((pBufferCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY) != 0 && + !m_UseKhrBufferDeviceAddress) + { + VMA_ASSERT(0 && "Creating a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is not valid if VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT was not used."); + return VK_ERROR_INITIALIZATION_FAILED; + } + + // 1. Create VkBuffer. + VkResult res = (*m_VulkanFunctions.vkCreateBuffer)(m_hDevice, pBufferCreateInfo, + GetAllocationCallbacks(), pBuffer); + if (res >= 0) + { + // 2. vkGetBufferMemoryRequirements. + VkMemoryRequirements vkMemReq = {}; + bool requiresDedicatedAllocation = false; + bool prefersDedicatedAllocation = false; + GetBufferMemoryRequirements(*pBuffer, vkMemReq, + requiresDedicatedAllocation, prefersDedicatedAllocation); + + if(pMemoryAllocateNext != VMA_NULL) + { + requiresDedicatedAllocation = true; + } + + // 2a. Include minAlignment + vkMemReq.alignment = VMA_MAX(vkMemReq.alignment, minAlignment); + + // 3. Allocate memory using allocator. + res = AllocateMemory( + vkMemReq, + requiresDedicatedAllocation, + prefersDedicatedAllocation, + *pBuffer, // dedicatedBuffer + VK_NULL_HANDLE, // dedicatedImage + VmaBufferImageUsage(*pBufferCreateInfo, m_UseKhrMaintenance5), // dedicatedBufferImageUsage + pMemoryAllocateNext, + *pAllocationCreateInfo, + VMA_SUBALLOCATION_TYPE_BUFFER, + 1, // allocationCount + pAllocation); + if (res >= 0) + { + // 3. Bind buffer with memory. + if ((pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_DONT_BIND_BIT) == 0) + { + res = BindBufferMemory(*pAllocation, 0, *pBuffer, VMA_NULL); + } + if (res >= 0) + { + // All steps succeeded. +#if VMA_STATS_STRING_ENABLED + (*pAllocation)->InitBufferUsage(*pBufferCreateInfo, m_UseKhrMaintenance5); +#endif + if (pAllocationInfo != VMA_NULL) + { + GetAllocationInfo(*pAllocation, pAllocationInfo); + } + + return VK_SUCCESS; + } + FreeMemory(1, pAllocation); + *pAllocation = VK_NULL_HANDLE; + (*m_VulkanFunctions.vkDestroyBuffer)(m_hDevice, *pBuffer, GetAllocationCallbacks()); + *pBuffer = VK_NULL_HANDLE; + return res; + } + (*m_VulkanFunctions.vkDestroyBuffer)(m_hDevice, *pBuffer, GetAllocationCallbacks()); + *pBuffer = VK_NULL_HANDLE; + return res; + } + return res; +} + VkResult VmaAllocator_T::AllocateMemory( const VkMemoryRequirements& vkMemReq, bool requiresDedicatedAllocation, @@ -16423,87 +16532,14 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer( VmaAllocationInfo* pAllocationInfo) { VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && pBuffer && pAllocation); - - if(pBufferCreateInfo->size == 0) - { - return VK_ERROR_INITIALIZATION_FAILED; - } - if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY) != 0 && - !allocator->m_UseKhrBufferDeviceAddress) - { - VMA_ASSERT(0 && "Creating a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is not valid if VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT was not used."); - return VK_ERROR_INITIALIZATION_FAILED; - } - VMA_DEBUG_LOG("vmaCreateBuffer"); + VMA_DEBUG_GLOBAL_MUTEX_LOCK; - VMA_DEBUG_GLOBAL_MUTEX_LOCK - - *pBuffer = VK_NULL_HANDLE; - *pAllocation = VK_NULL_HANDLE; - - // 1. Create VkBuffer. - VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)( - allocator->m_hDevice, - pBufferCreateInfo, - allocator->GetAllocationCallbacks(), - pBuffer); - if(res >= 0) - { - // 2. vkGetBufferMemoryRequirements. - VkMemoryRequirements vkMemReq = {}; - bool requiresDedicatedAllocation = false; - bool prefersDedicatedAllocation = false; - allocator->GetBufferMemoryRequirements(*pBuffer, vkMemReq, - requiresDedicatedAllocation, prefersDedicatedAllocation); - - // 3. Allocate memory using allocator. - res = allocator->AllocateMemory( - vkMemReq, - requiresDedicatedAllocation, - prefersDedicatedAllocation, - *pBuffer, // dedicatedBuffer - VK_NULL_HANDLE, // dedicatedImage - VmaBufferImageUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5), // dedicatedBufferImageUsage - VMA_NULL, // pMemoryAllocateNext - *pAllocationCreateInfo, - VMA_SUBALLOCATION_TYPE_BUFFER, - 1, // allocationCount - pAllocation); - - if(res >= 0) - { - // 3. Bind buffer with memory. - if((pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_DONT_BIND_BIT) == 0) - { - res = allocator->BindBufferMemory(*pAllocation, 0, *pBuffer, VMA_NULL); - } - if(res >= 0) - { - // All steps succeeded. - #if VMA_STATS_STRING_ENABLED - (*pAllocation)->InitBufferUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5); - #endif - if(pAllocationInfo != VMA_NULL) - { - allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); - } + return allocator->CreateBuffer(pBufferCreateInfo, pAllocationCreateInfo, + 1, // minAlignment + VMA_NULL, // pMemoryAllocateNext + pBuffer, pAllocation, pAllocationInfo); - return VK_SUCCESS; - } - allocator->FreeMemory( - 1, // allocationCount - pAllocation); - *pAllocation = VK_NULL_HANDLE; - (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks()); - *pBuffer = VK_NULL_HANDLE; - return res; - } - (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks()); - *pBuffer = VK_NULL_HANDLE; - return res; - } - return res; } VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( @@ -16516,90 +16552,30 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( VmaAllocationInfo* pAllocationInfo) { VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && VmaIsPow2(minAlignment) && pBuffer && pAllocation); - - if(pBufferCreateInfo->size == 0) - { - return VK_ERROR_INITIALIZATION_FAILED; - } - if((pBufferCreateInfo->usage & VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT_COPY) != 0 && - !allocator->m_UseKhrBufferDeviceAddress) - { - VMA_ASSERT(0 && "Creating a buffer with VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT is not valid if VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT was not used."); - return VK_ERROR_INITIALIZATION_FAILED; - } - VMA_DEBUG_LOG("vmaCreateBufferWithAlignment"); + VMA_DEBUG_GLOBAL_MUTEX_LOCK; - VMA_DEBUG_GLOBAL_MUTEX_LOCK - - *pBuffer = VK_NULL_HANDLE; - *pAllocation = VK_NULL_HANDLE; - - // 1. Create VkBuffer. - VkResult res = (*allocator->GetVulkanFunctions().vkCreateBuffer)( - allocator->m_hDevice, - pBufferCreateInfo, - allocator->GetAllocationCallbacks(), - pBuffer); - if(res >= 0) - { - // 2. vkGetBufferMemoryRequirements. - VkMemoryRequirements vkMemReq = {}; - bool requiresDedicatedAllocation = false; - bool prefersDedicatedAllocation = false; - allocator->GetBufferMemoryRequirements(*pBuffer, vkMemReq, - requiresDedicatedAllocation, prefersDedicatedAllocation); - - // 2a. Include minAlignment - vkMemReq.alignment = VMA_MAX(vkMemReq.alignment, minAlignment); - - // 3. Allocate memory using allocator. - res = allocator->AllocateMemory( - vkMemReq, - requiresDedicatedAllocation, - prefersDedicatedAllocation, - *pBuffer, // dedicatedBuffer - VK_NULL_HANDLE, // dedicatedImage - VmaBufferImageUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5), // dedicatedBufferImageUsage - VMA_NULL, // pMemoryAllocateNext - *pAllocationCreateInfo, - VMA_SUBALLOCATION_TYPE_BUFFER, - 1, // allocationCount - pAllocation); + return allocator->CreateBuffer(pBufferCreateInfo, pAllocationCreateInfo, minAlignment, + VMA_NULL, // pMemoryAllocateNext + pBuffer, pAllocation, pAllocationInfo); +} - if(res >= 0) - { - // 3. Bind buffer with memory. - if((pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_DONT_BIND_BIT) == 0) - { - res = allocator->BindBufferMemory(*pAllocation, 0, *pBuffer, VMA_NULL); - } - if(res >= 0) - { - // All steps succeeded. - #if VMA_STATS_STRING_ENABLED - (*pAllocation)->InitBufferUsage(*pBufferCreateInfo, allocator->m_UseKhrMaintenance5); - #endif - if(pAllocationInfo != VMA_NULL) - { - allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); - } +VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateDedicatedBuffer( + VmaAllocator allocator, + const VkBufferCreateInfo* pBufferCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, + void* pMemoryAllocateNext, + VkBuffer* pBuffer, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) +{ + VMA_ASSERT(allocator && pBufferCreateInfo && pAllocationCreateInfo && pBuffer && pAllocation); + VMA_DEBUG_LOG("vmaCreateDedicatedBuffer"); + VMA_DEBUG_GLOBAL_MUTEX_LOCK; - return VK_SUCCESS; - } - allocator->FreeMemory( - 1, // allocationCount - pAllocation); - *pAllocation = VK_NULL_HANDLE; - (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks()); - *pBuffer = VK_NULL_HANDLE; - return res; - } - (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, *pBuffer, allocator->GetAllocationCallbacks()); - *pBuffer = VK_NULL_HANDLE; - return res; - } - return res; + return allocator->CreateBuffer(pBufferCreateInfo, pAllocationCreateInfo, + 1, // minAlignment + pMemoryAllocateNext, pBuffer, pAllocation, pAllocationInfo); } VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingBuffer( From 989d405caaaaef556cc4f7cc51d97216f59736fc Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 12:09:59 +0200 Subject: [PATCH 14/16] Added function vmaCreateDedicatedImage Finished writing documentation for all of it. Rebuilt the docs. --- docs/html/allocation_annotation.html | 12 +- docs/html/choosing_memory_type.html | 24 +- docs/html/custom_memory_pools.html | 16 +- docs/html/defragmentation.html | 24 +- docs/html/doxygen_crawl.html | 4 + docs/html/faq.html | 2 +- docs/html/general_considerations.html | 2 +- docs/html/globals.html | 3 + docs/html/globals_func.html | 3 + docs/html/group__group__alloc.html | 185 ++++++++++- docs/html/group__group__init.html | 22 +- docs/html/index.html | 1 + docs/html/memory_mapping.html | 16 +- docs/html/other_api_interop.html | 48 ++- docs/html/quick_start.html | 24 +- docs/html/resource_aliasing.html | 4 +- docs/html/search/all_14.js | 235 +++++++------- docs/html/search/all_8.js | 19 +- docs/html/search/all_b.js | 2 +- docs/html/search/functions_0.js | 149 ++++----- docs/html/search/pages_8.js | 17 +- docs/html/search/pages_b.js | 2 +- .../struct_vma_allocation_create_info.html | 2 +- docs/html/struct_vma_allocation_info.html | 2 +- docs/html/topics.html | 2 +- docs/html/usage_patterns.html | 26 +- docs/html/virtual_allocator.html | 20 +- docs/html/vk__mem__alloc_8h.html | 8 +- docs/html/vk_ext_memory_priority.html | 14 +- docs/html/vk_khr_dedicated_allocation.html | 4 +- include/vk_mem_alloc.h | 300 ++++++++++++------ src/Tests.cpp | 36 ++- 32 files changed, 781 insertions(+), 447 deletions(-) diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html index aab7d3fd..67b42d56 100644 --- a/docs/html/allocation_annotation.html +++ b/docs/html/allocation_annotation.html @@ -93,18 +93,18 @@
    VmaAllocation allocation;
    vmaCreateBuffer(allocator, &bufCreateInfo, &allocCreateInfo, &buffer, &allocation, nullptr);
    VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    Creates a new VkBuffer, allocates and binds memory for it.
    -
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:550
    -
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1291
    -
    void * pUserData
    Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
    Definition vk_mem_alloc.h:1330
    -
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1299
    +
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:551
    +
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1292
    +
    void * pUserData
    Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...
    Definition vk_mem_alloc.h:1331
    +
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1300
    Represents single memory allocation.

    The pointer may be later retrieved as VmaAllocationInfo::pUserData:

    vmaGetAllocationInfo(allocator, allocation, &allocInfo);
    MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.pUserData;
    void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)
    Returns current information about specified allocation.
    -
    Definition vk_mem_alloc.h:1410
    -
    void * pUserData
    Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
    Definition vk_mem_alloc.h:1457
    +
    Definition vk_mem_alloc.h:1411
    +
    void * pUserData
    Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
    Definition vk_mem_alloc.h:1458

    It can also be changed using function vmaSetAllocationUserData().

    Values of (non-zero) allocations' pUserData are printed in JSON report created by vmaBuildStatsString() in hexadecimal form.

    diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html index cdcb3b9b..e924f704 100644 --- a/docs/html/choosing_memory_type.html +++ b/docs/html/choosing_memory_type.html @@ -83,7 +83,7 @@
  • If you just want to find memory type index that meets your requirements, you can use function: vmaFindMemoryTypeIndexForBufferInfo(), vmaFindMemoryTypeIndexForImageInfo(), vmaFindMemoryTypeIndex().
  • If you want to allocate a region of device memory without association with any specific image or buffer, you can use function vmaAllocateMemory(). Usage of this function is not recommended and usually not needed. vmaAllocateMemoryPages() function is also provided for creating multiple allocations at once, which may be useful for sparse binding.
  • If you already have a buffer or an image created, you want to allocate memory for it and then you will bind it yourself, you can use function vmaAllocateMemoryForBuffer(), vmaAllocateMemoryForImage(). For binding you should use functions: vmaBindBufferMemory(), vmaBindImageMemory() or their extended versions: vmaBindBufferMemory2(), vmaBindImageMemory2().
  • -
  • If you want to create a buffer or an image, allocate memory for it, and bind them together, all in one call, you can use function vmaCreateBuffer(), vmaCreateImage(). This is the easiest and recommended way to use this library!
  • +
  • If you want to create a buffer or an image, allocate memory for it, and bind them together, all in one call, you can use function vmaCreateBuffer(), vmaCreateImage(). This is the easiest and recommended way to use this library!
  • When using 3. or 4., the library internally queries Vulkan for memory types supported for that buffer or image (function vkGetBufferMemoryRequirements()) and uses only one of these types.

    If no memory type can be found that meets all the requirements, these functions return VK_ERROR_FEATURE_NOT_PRESENT.

    @@ -103,9 +103,9 @@

    VmaAllocation allocation;
    vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
    VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    Creates a new VkBuffer, allocates and binds memory for it.
    -
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:550
    -
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1291
    -
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1299
    +
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:551
    +
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1292
    +
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1300
    Represents single memory allocation.

    If you have a preference for putting the resource in GPU (device) memory or CPU (host) memory on systems with discrete graphics card that have the memories separate, you can use VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE or VMA_MEMORY_USAGE_AUTO_PREFER_HOST.

    When using VMA_MEMORY_USAGE_AUTO* while you want to map the allocated memory, you also need to specify one of the host access flags: VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT or VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT. This will help the library decide about preferred memory type to ensure it has VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT so you can map it.

    @@ -121,10 +121,10 @@

    VkBuffer stagingBuffer;
    VmaAllocation stagingAllocation;
    vmaCreateBuffer(allocator, &stagingBufferInfo, &stagingAllocInfo, &stagingBuffer, &stagingAllocation, nullptr);
    -
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
    Definition vk_mem_alloc.h:659
    -
    VmaAllocationCreateFlags flags
    Use VmaAllocationCreateFlagBits enum.
    Definition vk_mem_alloc.h:1293
    +
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
    Definition vk_mem_alloc.h:660
    +
    VmaAllocationCreateFlags flags
    Use VmaAllocationCreateFlagBits enum.
    Definition vk_mem_alloc.h:1294

    For more examples of creating different kinds of resources, see chapter Recommended usage patterns. See also: Memory mapping.

    -

    Usage values VMA_MEMORY_USAGE_AUTO* are legal to use only when the library knows about the resource being created by having VkBufferCreateInfo / VkImageCreateInfo passed, so they work with functions like: vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo() etc. If you allocate raw memory using function vmaAllocateMemory(), you have to use other means of selecting memory type, as described below.

    +

    Usage values VMA_MEMORY_USAGE_AUTO* are legal to use only when the library knows about the resource being created by having VkBufferCreateInfo / VkImageCreateInfo passed, so they work with functions like: vmaCreateBuffer(), vmaCreateImage(), vmaFindMemoryTypeIndexForBufferInfo() etc. If you allocate raw memory using function vmaAllocateMemory(), you have to use other means of selecting memory type, as described below.

    Note
    Old usage values (VMA_MEMORY_USAGE_GPU_ONLY, VMA_MEMORY_USAGE_CPU_ONLY, VMA_MEMORY_USAGE_CPU_TO_GPU, VMA_MEMORY_USAGE_GPU_TO_CPU, VMA_MEMORY_USAGE_CPU_COPY) are still available and work same way as in previous versions of the library for backward compatibility, but they are deprecated.

    Required and preferred flags

    @@ -137,10 +137,10 @@

    VkBuffer buffer;
    VmaAllocation allocation;
    vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
    -
    @ VMA_ALLOCATION_CREATE_MAPPED_BIT
    Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
    Definition vk_mem_alloc.h:610
    -
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
    Definition vk_mem_alloc.h:671
    -
    VkMemoryPropertyFlags preferredFlags
    Flags that preferably should be set in a memory type chosen for an allocation.
    Definition vk_mem_alloc.h:1309
    -
    VkMemoryPropertyFlags requiredFlags
    Flags that must be set in a Memory Type chosen for an allocation.
    Definition vk_mem_alloc.h:1304
    +
    @ VMA_ALLOCATION_CREATE_MAPPED_BIT
    Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
    Definition vk_mem_alloc.h:611
    +
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
    Definition vk_mem_alloc.h:672
    +
    VkMemoryPropertyFlags preferredFlags
    Flags that preferably should be set in a memory type chosen for an allocation.
    Definition vk_mem_alloc.h:1310
    +
    VkMemoryPropertyFlags requiredFlags
    Flags that must be set in a Memory Type chosen for an allocation.
    Definition vk_mem_alloc.h:1305

    A memory type is chosen that has all the required flags and as many preferred flags set as possible.

    Value passed in VmaAllocationCreateInfo::usage is internally converted to a set of required and preferred flags, plus some extra "magic" (heuristics).

    @@ -155,7 +155,7 @@

    VkBuffer buffer;
    VmaAllocation allocation;
    vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
    -
    uint32_t memoryTypeBits
    Bitmask containing one bit set for every memory type acceptable for this allocation.
    Definition vk_mem_alloc.h:1317
    +
    uint32_t memoryTypeBits
    Bitmask containing one bit set for every memory type acceptable for this allocation.
    Definition vk_mem_alloc.h:1318

    You can also use this parameter to exclude some memory types. If you inspect memory heaps and types available on the current physical device and you determine that for some reason you don't want to use a specific memory type for the allocation, you can enable automatic memory type selection but exclude certain memory type or types by setting all bits of memoryTypeBits to 1 except the ones you choose.

    // ...
    uint32_t excludedMemoryTypeIndex = 2;
    diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index 365abaf6..fb7855d5 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -133,15 +133,15 @@
    VkResult vmaCreatePool(VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)
    Allocates Vulkan device memory and creates VmaPool object.
    VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    Creates a new VkBuffer, allocates and binds memory for it.
    VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)
    Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.
    -
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:550
    -
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1291
    -
    VmaPool pool
    Pool that this allocation should be created in.
    Definition vk_mem_alloc.h:1323
    -
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1299
    +
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:551
    +
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1292
    +
    VmaPool pool
    Pool that this allocation should be created in.
    Definition vk_mem_alloc.h:1324
    +
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1300
    Represents single memory allocation.
    -
    Describes parameter of created VmaPool.
    Definition vk_mem_alloc.h:1342
    -
    uint32_t memoryTypeIndex
    Vulkan memory type index to allocate this pool from.
    Definition vk_mem_alloc.h:1345
    -
    VkDeviceSize blockSize
    Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....
    Definition vk_mem_alloc.h:1358
    -
    size_t maxBlockCount
    Maximum number of blocks that can be allocated in this pool. Optional.
    Definition vk_mem_alloc.h:1371
    +
    Describes parameter of created VmaPool.
    Definition vk_mem_alloc.h:1343
    +
    uint32_t memoryTypeIndex
    Vulkan memory type index to allocate this pool from.
    Definition vk_mem_alloc.h:1346
    +
    VkDeviceSize blockSize
    Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....
    Definition vk_mem_alloc.h:1359
    +
    size_t maxBlockCount
    Maximum number of blocks that can be allocated in this pool. Optional.
    Definition vk_mem_alloc.h:1372
    Represents custom memory pool.

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

    vmaDestroyBuffer(allocator, buf, alloc);
    diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html index 47e034fa..b4d9cb28 100644 --- a/docs/html/defragmentation.html +++ b/docs/html/defragmentation.html @@ -143,19 +143,19 @@
    VkResult vmaBeginDefragmentationPass(VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo)
    Starts single defragmentation pass.
    VkResult vmaBeginDefragmentation(VmaAllocator allocator, const VmaDefragmentationInfo *pInfo, VmaDefragmentationContext *pContext)
    Begins defragmentation process.
    VkResult vmaEndDefragmentationPass(VmaAllocator allocator, VmaDefragmentationContext context, VmaDefragmentationPassMoveInfo *pPassInfo)
    Ends single defragmentation pass.
    -
    @ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT
    Definition vk_mem_alloc.h:767
    -
    Definition vk_mem_alloc.h:1410
    -
    void * pUserData
    Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
    Definition vk_mem_alloc.h:1457
    +
    @ VMA_DEFRAGMENTATION_FLAG_ALGORITHM_FAST_BIT
    Definition vk_mem_alloc.h:768
    +
    Definition vk_mem_alloc.h:1411
    +
    void * pUserData
    Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...
    Definition vk_mem_alloc.h:1458
    An opaque object that represents started defragmentation process.
    -
    Parameters for defragmentation.
    Definition vk_mem_alloc.h:1500
    -
    VmaPool pool
    Custom pool to be defragmented.
    Definition vk_mem_alloc.h:1507
    -
    VmaDefragmentationFlags flags
    Use combination of VmaDefragmentationFlagBits.
    Definition vk_mem_alloc.h:1502
    -
    VmaAllocation srcAllocation
    Allocation that should be moved.
    Definition vk_mem_alloc.h:1533
    -
    VmaAllocation dstTmpAllocation
    Temporary allocation pointing to destination memory that will replace srcAllocation.
    Definition vk_mem_alloc.h:1540
    -
    Parameters for incremental defragmentation steps.
    Definition vk_mem_alloc.h:1548
    -
    uint32_t moveCount
    Number of elements in the pMoves array.
    Definition vk_mem_alloc.h:1550
    -
    VmaDefragmentationMove * pMoves
    Array of moves to be performed by the user in the current defragmentation pass.
    Definition vk_mem_alloc.h:1574
    -

    Although functions like vmaCreateBuffer(), vmaCreateImage(), vmaDestroyBuffer(), vmaDestroyImage() create/destroy an allocation and a buffer/image at once, these are just a shortcut for creating the resource, allocating memory, and binding them together. Defragmentation works on memory allocations only. You must handle the rest manually. Defragmentation is an iterative process that should repreat "passes" as long as related functions return VK_INCOMPLETE not VK_SUCCESS. In each pass:

    +
    Parameters for defragmentation.
    Definition vk_mem_alloc.h:1501
    +
    VmaPool pool
    Custom pool to be defragmented.
    Definition vk_mem_alloc.h:1508
    +
    VmaDefragmentationFlags flags
    Use combination of VmaDefragmentationFlagBits.
    Definition vk_mem_alloc.h:1503
    +
    VmaAllocation srcAllocation
    Allocation that should be moved.
    Definition vk_mem_alloc.h:1534
    +
    VmaAllocation dstTmpAllocation
    Temporary allocation pointing to destination memory that will replace srcAllocation.
    Definition vk_mem_alloc.h:1541
    +
    Parameters for incremental defragmentation steps.
    Definition vk_mem_alloc.h:1549
    +
    uint32_t moveCount
    Number of elements in the pMoves array.
    Definition vk_mem_alloc.h:1551
    +
    VmaDefragmentationMove * pMoves
    Array of moves to be performed by the user in the current defragmentation pass.
    Definition vk_mem_alloc.h:1575
    +

    Although functions like vmaCreateBuffer(), vmaCreateImage(), vmaDestroyBuffer(), vmaDestroyImage() create/destroy an allocation and a buffer/image at once, these are just a shortcut for creating the resource, allocating memory, and binding them together. Defragmentation works on memory allocations only. You must handle the rest manually. Defragmentation is an iterative process that should repreat "passes" as long as related functions return VK_INCOMPLETE not VK_SUCCESS. In each pass:

    1. vmaBeginDefragmentationPass() function call:
    VkBufferCreateInfo bufferInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };
    bufferInfo.size = 65536;
    @@ -220,9 +220,9 @@

    VmaAllocation allocation;

    vmaCreateBuffer(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, nullptr);
    VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    Creates a new VkBuffer, allocates and binds memory for it.
    -
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:550
    -
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1291
    -
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1299
    +
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:551
    +
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1292
    +
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1300
    Represents single memory allocation.

    Don't forget to destroy your buffer and allocation objects when no longer needed:

    vmaDestroyBuffer(allocator, buffer, allocation);
    diff --git a/docs/html/resource_aliasing.html b/docs/html/resource_aliasing.html index 126cf28f..2d295a5e 100644 --- a/docs/html/resource_aliasing.html +++ b/docs/html/resource_aliasing.html @@ -149,8 +149,8 @@
    void vmaFreeMemory(VmaAllocator allocator, VmaAllocation allocation)
    Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(),...
    VkResult vmaBindImageMemory(VmaAllocator allocator, VmaAllocation allocation, VkImage image)
    Binds image to allocation.
    VkResult vmaAllocateMemory(VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    General purpose memory allocation.
    -
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1291
    -
    VkMemoryPropertyFlags preferredFlags
    Flags that preferably should be set in a memory type chosen for an allocation.
    Definition vk_mem_alloc.h:1309
    +
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1292
    +
    VkMemoryPropertyFlags preferredFlags
    Flags that preferably should be set in a memory type chosen for an allocation.
    Definition vk_mem_alloc.h:1310
    Represents single memory allocation.

    VMA also provides convenience functions that create a buffer or image and bind it to memory represented by an existing VmaAllocation: vmaCreateAliasingBuffer(), vmaCreateAliasingBuffer2(), vmaCreateAliasingImage(), vmaCreateAliasingImage2(). Versions with "2" offer additional parameter allocationLocalOffset.

    Remember that using resources that alias in memory requires proper synchronization. You need to issue a memory barrier to make sure commands that use img1 and img2 don't overlap on GPU timeline. You also need to treat a resource after aliasing as uninitialized - containing garbage data. For example, if you use img1 and then want to use img2, you need to issue an image memory barrier for img2 with oldLayout = VK_IMAGE_LAYOUT_UNDEFINED.

    diff --git a/docs/html/search/all_14.js b/docs/html/search/all_14.js index 3248dcb9..b81674ed 100644 --- a/docs/html/search/all_14.js +++ b/docs/html/search/all_14.js @@ -99,120 +99,123 @@ var searchData= ['vma_5fvirtual_5fblock_5fcreate_5falgorithm_5fmask_96',['VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaaf9487467136e1a9e371894dc3a7c4844',1,'vk_mem_alloc.h']]], ['vma_5fvirtual_5fblock_5fcreate_5fflag_5fbits_5fmax_5fenum_97',['VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaa5fc0d333c3d5687a8bbf57df9b377a87',1,'vk_mem_alloc.h']]], ['vma_5fvirtual_5fblock_5fcreate_5flinear_5falgorithm_5fbit_98',['VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT',['../group__group__virtual.html#gga88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96',1,'vk_mem_alloc.h']]], - ['vmaallocatememory_99',['vmaAllocateMemory',['../group__group__alloc.html#gabf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]], - ['vmaallocatememoryforbuffer_100',['vmaAllocateMemoryForBuffer',['../group__group__alloc.html#ga7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]], - ['vmaallocatememoryforimage_101',['vmaAllocateMemoryForImage',['../group__group__alloc.html#ga0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]], - ['vmaallocatememorypages_102',['vmaAllocateMemoryPages',['../group__group__alloc.html#gad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]], - ['vmaallocation_103',['VmaAllocation',['../struct_vma_allocation.html',1,'']]], - ['vmaallocationcreateflagbits_104',['VmaAllocationCreateFlagBits',['../group__group__alloc.html#gad9889c10c798b040d59c92f257cae597',1,'VmaAllocationCreateFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga4fceecc301f4064dc808d3cd6c038941',1,'VmaAllocationCreateFlagBits: vk_mem_alloc.h']]], - ['vmaallocationcreateflags_105',['VmaAllocationCreateFlags',['../group__group__alloc.html#ga5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]], - ['vmaallocationcreateinfo_106',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../group__group__alloc.html#ga3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo: vk_mem_alloc.h']]], - ['vmaallocationinfo_107',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../group__group__alloc.html#ga1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo: vk_mem_alloc.h']]], - ['vmaallocationinfo2_108',['VmaAllocationInfo2',['../struct_vma_allocation_info2.html',1,'VmaAllocationInfo2'],['../group__group__alloc.html#ga25ede29f830f326b8572a18ce879bf64',1,'VmaAllocationInfo2: vk_mem_alloc.h']]], - ['vmaallocator_109',['VmaAllocator',['../struct_vma_allocator.html',1,'']]], - ['vmaallocatorcreateflagbits_110',['VmaAllocatorCreateFlagBits',['../group__group__init.html#ga4f87c9100d154a65a4ad495f7763cf7c',1,'VmaAllocatorCreateFlagBits: vk_mem_alloc.h'],['../group__group__init.html#gafd73b95e737ee7e76f827cb5472f559f',1,'VmaAllocatorCreateFlagBits: vk_mem_alloc.h']]], - ['vmaallocatorcreateflags_111',['VmaAllocatorCreateFlags',['../group__group__init.html#gacfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]], - ['vmaallocatorcreateinfo_112',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../group__group__init.html#gaad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo: vk_mem_alloc.h']]], - ['vmaallocatorinfo_113',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../group__group__init.html#ga1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo: vk_mem_alloc.h']]], - ['vmabegindefragmentation_114',['vmaBeginDefragmentation',['../group__group__alloc.html#gac3335566858b45541fa9c0d7a6bbb57e',1,'vk_mem_alloc.h']]], - ['vmabegindefragmentationpass_115',['vmaBeginDefragmentationPass',['../group__group__alloc.html#ga980d7da2ce3b1fd5c8b8476bc362cc00',1,'vk_mem_alloc.h']]], - ['vmabindbuffermemory_116',['vmaBindBufferMemory',['../group__group__alloc.html#ga6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]], - ['vmabindbuffermemory2_117',['vmaBindBufferMemory2',['../group__group__alloc.html#ga861f4f27189a7d11ab9d9eedc825cb6b',1,'vk_mem_alloc.h']]], - ['vmabindimagememory_118',['vmaBindImageMemory',['../group__group__alloc.html#ga3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]], - ['vmabindimagememory2_119',['vmaBindImageMemory2',['../group__group__alloc.html#ga5f3502dd7d38b53fb1533ea3921d038d',1,'vk_mem_alloc.h']]], - ['vmabudget_120',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../group__group__stats.html#gaa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget: vk_mem_alloc.h']]], - ['vmabuildstatsstring_121',['vmaBuildStatsString',['../group__group__stats.html#gaa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]], - ['vmabuildvirtualblockstatsstring_122',['vmaBuildVirtualBlockStatsString',['../group__group__stats.html#ga52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]], - ['vmacalculatepoolstatistics_123',['vmaCalculatePoolStatistics',['../group__group__stats.html#ga50ba0eb25d2b363b792be4645ca7a380',1,'vk_mem_alloc.h']]], - ['vmacalculatestatistics_124',['vmaCalculateStatistics',['../group__group__stats.html#ga36f3484de7aa6cd6edc4de9edfa0ff59',1,'vk_mem_alloc.h']]], - ['vmacalculatevirtualblockstatistics_125',['vmaCalculateVirtualBlockStatistics',['../group__group__virtual.html#ga93c5741bca44b43e5b849cacbd616098',1,'vk_mem_alloc.h']]], - ['vmacheckcorruption_126',['vmaCheckCorruption',['../group__group__alloc.html#ga49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]], - ['vmacheckpoolcorruption_127',['vmaCheckPoolCorruption',['../group__group__alloc.html#gad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]], - ['vmaclearvirtualblock_128',['vmaClearVirtualBlock',['../group__group__virtual.html#ga5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]], - ['vmacopyallocationtomemory_129',['vmaCopyAllocationToMemory',['../group__group__alloc.html#gaac883dd38863944335071213b9ae8477',1,'vk_mem_alloc.h']]], - ['vmacopymemorytoallocation_130',['vmaCopyMemoryToAllocation',['../group__group__alloc.html#ga11731ec58a3a43a22bb925e0780ef405',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingbuffer_131',['vmaCreateAliasingBuffer',['../group__group__alloc.html#ga60d5d4803e3c82505a2bfddb929adb03',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingbuffer2_132',['vmaCreateAliasingBuffer2',['../group__group__alloc.html#gaf0cf014344213e117bd9f9cf5f928122',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingimage_133',['vmaCreateAliasingImage',['../group__group__alloc.html#gaebc4db1f94b53dba2338b4c0fd80d0dc',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingimage2_134',['vmaCreateAliasingImage2',['../group__group__alloc.html#ga69ac829f5bb0737449fa92c2d971f1bb',1,'vk_mem_alloc.h']]], - ['vmacreateallocator_135',['vmaCreateAllocator',['../group__group__init.html#ga200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]], - ['vmacreatebuffer_136',['vmaCreateBuffer',['../group__group__alloc.html#gac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]], - ['vmacreatebufferwithalignment_137',['vmaCreateBufferWithAlignment',['../group__group__alloc.html#gaa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]], - ['vmacreateimage_138',['vmaCreateImage',['../group__group__alloc.html#ga02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]], - ['vmacreatepool_139',['vmaCreatePool',['../group__group__alloc.html#ga5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], - ['vmacreatevirtualblock_140',['vmaCreateVirtualBlock',['../group__group__virtual.html#gab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], - ['vmadefragmentationcontext_141',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]], - ['vmadefragmentationflagbits_142',['VmaDefragmentationFlagBits',['../group__group__alloc.html#ga6552a65b71d16f378c6994b3ceaef50c',1,'VmaDefragmentationFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga13415cc0b443353a7b5abda300b833fc',1,'VmaDefragmentationFlagBits: vk_mem_alloc.h']]], - ['vmadefragmentationflags_143',['VmaDefragmentationFlags',['../group__group__alloc.html#ga88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]], - ['vmadefragmentationinfo_144',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../group__group__alloc.html#ga2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo: vk_mem_alloc.h']]], - ['vmadefragmentationmove_145',['VmaDefragmentationMove',['../struct_vma_defragmentation_move.html',1,'VmaDefragmentationMove'],['../group__group__alloc.html#ga563f4b43d3e31ed603d80cacc9ba8589',1,'VmaDefragmentationMove: vk_mem_alloc.h']]], - ['vmadefragmentationmoveoperation_146',['VmaDefragmentationMoveOperation',['../group__group__alloc.html#gada9e3861caf96f08894b0bcc160ec257',1,'VmaDefragmentationMoveOperation: vk_mem_alloc.h'],['../group__group__alloc.html#ga2ea666deeb3c2c74806a097e27cdb4a1',1,'VmaDefragmentationMoveOperation: vk_mem_alloc.h']]], - ['vmadefragmentationpassmoveinfo_147',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../group__group__alloc.html#gad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo: vk_mem_alloc.h']]], - ['vmadefragmentationstats_148',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../group__group__alloc.html#gad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats: vk_mem_alloc.h']]], - ['vmadestroyallocator_149',['vmaDestroyAllocator',['../group__group__init.html#gaa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], - ['vmadestroybuffer_150',['vmaDestroyBuffer',['../group__group__alloc.html#ga0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], - ['vmadestroyimage_151',['vmaDestroyImage',['../group__group__alloc.html#gae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], - ['vmadestroypool_152',['vmaDestroyPool',['../group__group__alloc.html#ga5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], - ['vmadestroyvirtualblock_153',['vmaDestroyVirtualBlock',['../group__group__virtual.html#ga3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], - ['vmadetailedstatistics_154',['VmaDetailedStatistics',['../struct_vma_detailed_statistics.html',1,'VmaDetailedStatistics'],['../group__group__stats.html#ga9ab0c535a6ca655dc63b8609ab4b8394',1,'VmaDetailedStatistics: vk_mem_alloc.h']]], - ['vmadevicememorycallbacks_155',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../group__group__init.html#ga77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks: vk_mem_alloc.h']]], - ['vmaenddefragmentation_156',['vmaEndDefragmentation',['../group__group__alloc.html#ga59f01ca3d53d50b7cca9b442b77a3e87',1,'vk_mem_alloc.h']]], - ['vmaenddefragmentationpass_157',['vmaEndDefragmentationPass',['../group__group__alloc.html#gaded05a445742a00718ee766144c5c226',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindex_158',['vmaFindMemoryTypeIndex',['../group__group__alloc.html#gaef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindexforbufferinfo_159',['vmaFindMemoryTypeIndexForBufferInfo',['../group__group__alloc.html#gae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindexforimageinfo_160',['vmaFindMemoryTypeIndexForImageInfo',['../group__group__alloc.html#ga088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], - ['vmaflushallocation_161',['vmaFlushAllocation',['../group__group__alloc.html#ga30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], - ['vmaflushallocations_162',['vmaFlushAllocations',['../group__group__alloc.html#gac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], - ['vmafreememory_163',['vmaFreeMemory',['../group__group__alloc.html#ga11f0fbc034fa81a4efedd73d61ce7568',1,'vk_mem_alloc.h']]], - ['vmafreememorypages_164',['vmaFreeMemoryPages',['../group__group__alloc.html#ga834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], - ['vmafreestatsstring_165',['vmaFreeStatsString',['../group__group__stats.html#ga3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], - ['vmafreevirtualblockstatsstring_166',['vmaFreeVirtualBlockStatsString',['../group__group__stats.html#ga47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], - ['vmagetallocationinfo_167',['vmaGetAllocationInfo',['../group__group__alloc.html#ga86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], - ['vmagetallocationinfo2_168',['vmaGetAllocationInfo2',['../group__group__alloc.html#ga1405cf3eae2fd1305d645879173031a0',1,'vk_mem_alloc.h']]], - ['vmagetallocationmemoryproperties_169',['vmaGetAllocationMemoryProperties',['../group__group__alloc.html#ga571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], - ['vmagetallocatorinfo_170',['vmaGetAllocatorInfo',['../group__group__init.html#gafa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], - ['vmagetheapbudgets_171',['vmaGetHeapBudgets',['../group__group__stats.html#ga9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], - ['vmagetmemoryproperties_172',['vmaGetMemoryProperties',['../group__group__init.html#gab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], - ['vmagetmemorytypeproperties_173',['vmaGetMemoryTypeProperties',['../group__group__init.html#ga8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], - ['vmagetmemorywin32handle_174',['vmaGetMemoryWin32Handle',['../group__group__alloc.html#ga8d327b7458d8cf426b84b5efba9bb9bf',1,'vk_mem_alloc.h']]], - ['vmagetmemorywin32handle2_175',['vmaGetMemoryWin32Handle2',['../group__group__alloc.html#ga1a8d7aba3bf5a4de66c801b9988afa58',1,'vk_mem_alloc.h']]], - ['vmagetphysicaldeviceproperties_176',['vmaGetPhysicalDeviceProperties',['../group__group__init.html#gaecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], - ['vmagetpoolname_177',['vmaGetPoolName',['../group__group__alloc.html#gaf09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], - ['vmagetpoolstatistics_178',['vmaGetPoolStatistics',['../group__group__stats.html#ga34d8e7d83774eed0caee5c5ae88e217d',1,'vk_mem_alloc.h']]], - ['vmagetvirtualallocationinfo_179',['vmaGetVirtualAllocationInfo',['../group__group__virtual.html#ga8ee14ceb1fe033ec84d8aa29e1f75afa',1,'vk_mem_alloc.h']]], - ['vmagetvirtualblockstatistics_180',['vmaGetVirtualBlockStatistics',['../group__group__virtual.html#ga2902aa3130866afcc64bb5f984113db3',1,'vk_mem_alloc.h']]], - ['vmaimportvulkanfunctionsfromvolk_181',['vmaImportVulkanFunctionsFromVolk',['../group__group__init.html#gaf8d9ee01910a7af7f552145ef0065b9c',1,'vk_mem_alloc.h']]], - ['vmainvalidateallocation_182',['vmaInvalidateAllocation',['../group__group__alloc.html#gaaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], - ['vmainvalidateallocations_183',['vmaInvalidateAllocations',['../group__group__alloc.html#gab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], - ['vmaisvirtualblockempty_184',['vmaIsVirtualBlockEmpty',['../group__group__virtual.html#gacd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], - ['vmamapmemory_185',['vmaMapMemory',['../group__group__alloc.html#gad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], - ['vmamemoryusage_186',['VmaMemoryUsage',['../group__group__alloc.html#gaa5846affa1e9da3800e3e78fae2305cc',1,'VmaMemoryUsage: vk_mem_alloc.h'],['../group__group__alloc.html#ga806e8499dde802e59eb72a1dc811c35f',1,'VmaMemoryUsage: vk_mem_alloc.h']]], - ['vmapool_187',['VmaPool',['../struct_vma_pool.html',1,'']]], - ['vmapoolcreateflagbits_188',['VmaPoolCreateFlagBits',['../group__group__alloc.html#ga9a7c45f9c863695d98c83fa5ac940fe7',1,'VmaPoolCreateFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga4d4f2efc2509157a9e4ecd4fd7942303',1,'VmaPoolCreateFlagBits: vk_mem_alloc.h']]], - ['vmapoolcreateflags_189',['VmaPoolCreateFlags',['../group__group__alloc.html#ga2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]], - ['vmapoolcreateinfo_190',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'VmaPoolCreateInfo'],['../group__group__alloc.html#ga1017aa83489c0eee8d2163d2bf253f67',1,'VmaPoolCreateInfo: vk_mem_alloc.h']]], - ['vmasetallocationname_191',['vmaSetAllocationName',['../group__group__alloc.html#gabe02cbb0cd913b3f125958179f2020fc',1,'vk_mem_alloc.h']]], - ['vmasetallocationuserdata_192',['vmaSetAllocationUserData',['../group__group__alloc.html#gaf9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], - ['vmasetcurrentframeindex_193',['vmaSetCurrentFrameIndex',['../group__group__init.html#gade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], - ['vmasetpoolname_194',['vmaSetPoolName',['../group__group__alloc.html#gadbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], - ['vmasetvirtualallocationuserdata_195',['vmaSetVirtualAllocationUserData',['../group__group__virtual.html#ga001ea1850458a4062b829e09c303fca2',1,'vk_mem_alloc.h']]], - ['vmastatistics_196',['VmaStatistics',['../struct_vma_statistics.html',1,'VmaStatistics'],['../group__group__stats.html#gac94bd1a382a3922ddc8de3af4d3ddd06',1,'VmaStatistics: vk_mem_alloc.h']]], - ['vmatotalstatistics_197',['VmaTotalStatistics',['../struct_vma_total_statistics.html',1,'VmaTotalStatistics'],['../group__group__stats.html#ga68916e729e55d513f88ffafbadddb770',1,'VmaTotalStatistics: vk_mem_alloc.h']]], - ['vmaunmapmemory_198',['vmaUnmapMemory',['../group__group__alloc.html#ga9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], - ['vmavirtualallocate_199',['vmaVirtualAllocate',['../group__group__virtual.html#ga6b7cdcc1c3e5103c323fedc4e1319e01',1,'vk_mem_alloc.h']]], - ['vmavirtualallocation_200',['VmaVirtualAllocation',['../struct_vma_virtual_allocation.html',1,'']]], - ['vmavirtualallocationcreateflagbits_201',['VmaVirtualAllocationCreateFlagBits',['../group__group__virtual.html#ga2e9c64d405b14156fea7e10c4ad06cb6',1,'VmaVirtualAllocationCreateFlagBits: vk_mem_alloc.h'],['../group__group__virtual.html#ga936815e64946a6b6d812d08d10184c23',1,'VmaVirtualAllocationCreateFlagBits: vk_mem_alloc.h']]], - ['vmavirtualallocationcreateflags_202',['VmaVirtualAllocationCreateFlags',['../group__group__virtual.html#gae96ffc099bf898257fb19e9410ed08a7',1,'vk_mem_alloc.h']]], - ['vmavirtualallocationcreateinfo_203',['VmaVirtualAllocationCreateInfo',['../struct_vma_virtual_allocation_create_info.html',1,'VmaVirtualAllocationCreateInfo'],['../group__group__virtual.html#gac3c90d80bedc6847a41b82d0e2158c9e',1,'VmaVirtualAllocationCreateInfo: vk_mem_alloc.h']]], - ['vmavirtualallocationinfo_204',['VmaVirtualAllocationInfo',['../struct_vma_virtual_allocation_info.html',1,'VmaVirtualAllocationInfo'],['../group__group__virtual.html#ga75bc33ff7cf18c98e101f570dc2a5ebc',1,'VmaVirtualAllocationInfo: vk_mem_alloc.h']]], - ['vmavirtualblock_205',['VmaVirtualBlock',['../struct_vma_virtual_block.html',1,'']]], - ['vmavirtualblockcreateflagbits_206',['VmaVirtualBlockCreateFlagBits',['../group__group__virtual.html#ga88bcf8c1cd3bb1610ff7343811c65bca',1,'VmaVirtualBlockCreateFlagBits: vk_mem_alloc.h'],['../group__group__virtual.html#ga0860ba1c0a67178fae4aecb63a78573e',1,'VmaVirtualBlockCreateFlagBits: vk_mem_alloc.h']]], - ['vmavirtualblockcreateflags_207',['VmaVirtualBlockCreateFlags',['../group__group__virtual.html#ga4e49c2f0ab7f6b4868833e5bac78d91e',1,'vk_mem_alloc.h']]], - ['vmavirtualblockcreateinfo_208',['VmaVirtualBlockCreateInfo',['../struct_vma_virtual_block_create_info.html',1,'VmaVirtualBlockCreateInfo'],['../group__group__virtual.html#ga4753d42d40217a3a652a3cdf253ad773',1,'VmaVirtualBlockCreateInfo: vk_mem_alloc.h']]], - ['vmavirtualfree_209',['vmaVirtualFree',['../group__group__virtual.html#ga09fc688c0c3653ff23723b037e5d5033',1,'vk_mem_alloc.h']]], - ['vmavulkanfunctions_210',['VmaVulkanFunctions',['../struct_vma_vulkan_functions.html',1,'VmaVulkanFunctions'],['../group__group__init.html#gabb0a8e3b5040d847571cca6c7f9a8074',1,'VmaVulkanFunctions: vk_mem_alloc.h']]], - ['vulkan_20functions_211',['Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'Importing Vulkan functions'],['../configuration.html#config_Vulkan_functions',1,'Pointers to Vulkan functions']]], - ['vulkan_20memory_20allocator_212',['Vulkan Memory Allocator',['../index.html',1,'']]], - ['vulkan_20version_213',['Selecting Vulkan version',['../quick_start.html#quick_start_initialization_selecting_vulkan_version',1,'']]], - ['vulkanapiversion_214',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]] + ['vmaallocatededicatedmemory_99',['vmaAllocateDedicatedMemory',['../group__group__alloc.html#ga9a0b91c157adec03dae1e6ea78d33625',1,'vk_mem_alloc.h']]], + ['vmaallocatememory_100',['vmaAllocateMemory',['../group__group__alloc.html#gabf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]], + ['vmaallocatememoryforbuffer_101',['vmaAllocateMemoryForBuffer',['../group__group__alloc.html#ga7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]], + ['vmaallocatememoryforimage_102',['vmaAllocateMemoryForImage',['../group__group__alloc.html#ga0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]], + ['vmaallocatememorypages_103',['vmaAllocateMemoryPages',['../group__group__alloc.html#gad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]], + ['vmaallocation_104',['VmaAllocation',['../struct_vma_allocation.html',1,'']]], + ['vmaallocationcreateflagbits_105',['VmaAllocationCreateFlagBits',['../group__group__alloc.html#gad9889c10c798b040d59c92f257cae597',1,'VmaAllocationCreateFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga4fceecc301f4064dc808d3cd6c038941',1,'VmaAllocationCreateFlagBits: vk_mem_alloc.h']]], + ['vmaallocationcreateflags_106',['VmaAllocationCreateFlags',['../group__group__alloc.html#ga5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]], + ['vmaallocationcreateinfo_107',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../group__group__alloc.html#ga3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo: vk_mem_alloc.h']]], + ['vmaallocationinfo_108',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../group__group__alloc.html#ga1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo: vk_mem_alloc.h']]], + ['vmaallocationinfo2_109',['VmaAllocationInfo2',['../struct_vma_allocation_info2.html',1,'VmaAllocationInfo2'],['../group__group__alloc.html#ga25ede29f830f326b8572a18ce879bf64',1,'VmaAllocationInfo2: vk_mem_alloc.h']]], + ['vmaallocator_110',['VmaAllocator',['../struct_vma_allocator.html',1,'']]], + ['vmaallocatorcreateflagbits_111',['VmaAllocatorCreateFlagBits',['../group__group__init.html#ga4f87c9100d154a65a4ad495f7763cf7c',1,'VmaAllocatorCreateFlagBits: vk_mem_alloc.h'],['../group__group__init.html#gafd73b95e737ee7e76f827cb5472f559f',1,'VmaAllocatorCreateFlagBits: vk_mem_alloc.h']]], + ['vmaallocatorcreateflags_112',['VmaAllocatorCreateFlags',['../group__group__init.html#gacfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]], + ['vmaallocatorcreateinfo_113',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../group__group__init.html#gaad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo: vk_mem_alloc.h']]], + ['vmaallocatorinfo_114',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../group__group__init.html#ga1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo: vk_mem_alloc.h']]], + ['vmabegindefragmentation_115',['vmaBeginDefragmentation',['../group__group__alloc.html#gac3335566858b45541fa9c0d7a6bbb57e',1,'vk_mem_alloc.h']]], + ['vmabegindefragmentationpass_116',['vmaBeginDefragmentationPass',['../group__group__alloc.html#ga980d7da2ce3b1fd5c8b8476bc362cc00',1,'vk_mem_alloc.h']]], + ['vmabindbuffermemory_117',['vmaBindBufferMemory',['../group__group__alloc.html#ga6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]], + ['vmabindbuffermemory2_118',['vmaBindBufferMemory2',['../group__group__alloc.html#ga861f4f27189a7d11ab9d9eedc825cb6b',1,'vk_mem_alloc.h']]], + ['vmabindimagememory_119',['vmaBindImageMemory',['../group__group__alloc.html#ga3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]], + ['vmabindimagememory2_120',['vmaBindImageMemory2',['../group__group__alloc.html#ga5f3502dd7d38b53fb1533ea3921d038d',1,'vk_mem_alloc.h']]], + ['vmabudget_121',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../group__group__stats.html#gaa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget: vk_mem_alloc.h']]], + ['vmabuildstatsstring_122',['vmaBuildStatsString',['../group__group__stats.html#gaa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]], + ['vmabuildvirtualblockstatsstring_123',['vmaBuildVirtualBlockStatsString',['../group__group__stats.html#ga52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]], + ['vmacalculatepoolstatistics_124',['vmaCalculatePoolStatistics',['../group__group__stats.html#ga50ba0eb25d2b363b792be4645ca7a380',1,'vk_mem_alloc.h']]], + ['vmacalculatestatistics_125',['vmaCalculateStatistics',['../group__group__stats.html#ga36f3484de7aa6cd6edc4de9edfa0ff59',1,'vk_mem_alloc.h']]], + ['vmacalculatevirtualblockstatistics_126',['vmaCalculateVirtualBlockStatistics',['../group__group__virtual.html#ga93c5741bca44b43e5b849cacbd616098',1,'vk_mem_alloc.h']]], + ['vmacheckcorruption_127',['vmaCheckCorruption',['../group__group__alloc.html#ga49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]], + ['vmacheckpoolcorruption_128',['vmaCheckPoolCorruption',['../group__group__alloc.html#gad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]], + ['vmaclearvirtualblock_129',['vmaClearVirtualBlock',['../group__group__virtual.html#ga5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]], + ['vmacopyallocationtomemory_130',['vmaCopyAllocationToMemory',['../group__group__alloc.html#gaac883dd38863944335071213b9ae8477',1,'vk_mem_alloc.h']]], + ['vmacopymemorytoallocation_131',['vmaCopyMemoryToAllocation',['../group__group__alloc.html#ga11731ec58a3a43a22bb925e0780ef405',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingbuffer_132',['vmaCreateAliasingBuffer',['../group__group__alloc.html#ga60d5d4803e3c82505a2bfddb929adb03',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingbuffer2_133',['vmaCreateAliasingBuffer2',['../group__group__alloc.html#gaf0cf014344213e117bd9f9cf5f928122',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingimage_134',['vmaCreateAliasingImage',['../group__group__alloc.html#gaebc4db1f94b53dba2338b4c0fd80d0dc',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingimage2_135',['vmaCreateAliasingImage2',['../group__group__alloc.html#ga69ac829f5bb0737449fa92c2d971f1bb',1,'vk_mem_alloc.h']]], + ['vmacreateallocator_136',['vmaCreateAllocator',['../group__group__init.html#ga200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]], + ['vmacreatebuffer_137',['vmaCreateBuffer',['../group__group__alloc.html#gac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]], + ['vmacreatebufferwithalignment_138',['vmaCreateBufferWithAlignment',['../group__group__alloc.html#gaa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]], + ['vmacreatededicatedbuffer_139',['vmaCreateDedicatedBuffer',['../group__group__alloc.html#gab313b89299877ca21c196027bed9e874',1,'vk_mem_alloc.h']]], + ['vmacreatededicatedimage_140',['vmaCreateDedicatedImage',['../group__group__alloc.html#ga07c66ffa000906a599d471047a7c0324',1,'vk_mem_alloc.h']]], + ['vmacreateimage_141',['vmaCreateImage',['../group__group__alloc.html#ga02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]], + ['vmacreatepool_142',['vmaCreatePool',['../group__group__alloc.html#ga5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], + ['vmacreatevirtualblock_143',['vmaCreateVirtualBlock',['../group__group__virtual.html#gab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], + ['vmadefragmentationcontext_144',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]], + ['vmadefragmentationflagbits_145',['VmaDefragmentationFlagBits',['../group__group__alloc.html#ga6552a65b71d16f378c6994b3ceaef50c',1,'VmaDefragmentationFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga13415cc0b443353a7b5abda300b833fc',1,'VmaDefragmentationFlagBits: vk_mem_alloc.h']]], + ['vmadefragmentationflags_146',['VmaDefragmentationFlags',['../group__group__alloc.html#ga88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]], + ['vmadefragmentationinfo_147',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../group__group__alloc.html#ga2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo: vk_mem_alloc.h']]], + ['vmadefragmentationmove_148',['VmaDefragmentationMove',['../struct_vma_defragmentation_move.html',1,'VmaDefragmentationMove'],['../group__group__alloc.html#ga563f4b43d3e31ed603d80cacc9ba8589',1,'VmaDefragmentationMove: vk_mem_alloc.h']]], + ['vmadefragmentationmoveoperation_149',['VmaDefragmentationMoveOperation',['../group__group__alloc.html#gada9e3861caf96f08894b0bcc160ec257',1,'VmaDefragmentationMoveOperation: vk_mem_alloc.h'],['../group__group__alloc.html#ga2ea666deeb3c2c74806a097e27cdb4a1',1,'VmaDefragmentationMoveOperation: vk_mem_alloc.h']]], + ['vmadefragmentationpassmoveinfo_150',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../group__group__alloc.html#gad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo: vk_mem_alloc.h']]], + ['vmadefragmentationstats_151',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../group__group__alloc.html#gad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats: vk_mem_alloc.h']]], + ['vmadestroyallocator_152',['vmaDestroyAllocator',['../group__group__init.html#gaa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], + ['vmadestroybuffer_153',['vmaDestroyBuffer',['../group__group__alloc.html#ga0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], + ['vmadestroyimage_154',['vmaDestroyImage',['../group__group__alloc.html#gae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], + ['vmadestroypool_155',['vmaDestroyPool',['../group__group__alloc.html#ga5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], + ['vmadestroyvirtualblock_156',['vmaDestroyVirtualBlock',['../group__group__virtual.html#ga3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], + ['vmadetailedstatistics_157',['VmaDetailedStatistics',['../struct_vma_detailed_statistics.html',1,'VmaDetailedStatistics'],['../group__group__stats.html#ga9ab0c535a6ca655dc63b8609ab4b8394',1,'VmaDetailedStatistics: vk_mem_alloc.h']]], + ['vmadevicememorycallbacks_158',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../group__group__init.html#ga77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks: vk_mem_alloc.h']]], + ['vmaenddefragmentation_159',['vmaEndDefragmentation',['../group__group__alloc.html#ga59f01ca3d53d50b7cca9b442b77a3e87',1,'vk_mem_alloc.h']]], + ['vmaenddefragmentationpass_160',['vmaEndDefragmentationPass',['../group__group__alloc.html#gaded05a445742a00718ee766144c5c226',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindex_161',['vmaFindMemoryTypeIndex',['../group__group__alloc.html#gaef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforbufferinfo_162',['vmaFindMemoryTypeIndexForBufferInfo',['../group__group__alloc.html#gae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforimageinfo_163',['vmaFindMemoryTypeIndexForImageInfo',['../group__group__alloc.html#ga088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], + ['vmaflushallocation_164',['vmaFlushAllocation',['../group__group__alloc.html#ga30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], + ['vmaflushallocations_165',['vmaFlushAllocations',['../group__group__alloc.html#gac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], + ['vmafreememory_166',['vmaFreeMemory',['../group__group__alloc.html#ga11f0fbc034fa81a4efedd73d61ce7568',1,'vk_mem_alloc.h']]], + ['vmafreememorypages_167',['vmaFreeMemoryPages',['../group__group__alloc.html#ga834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], + ['vmafreestatsstring_168',['vmaFreeStatsString',['../group__group__stats.html#ga3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], + ['vmafreevirtualblockstatsstring_169',['vmaFreeVirtualBlockStatsString',['../group__group__stats.html#ga47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], + ['vmagetallocationinfo_170',['vmaGetAllocationInfo',['../group__group__alloc.html#ga86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], + ['vmagetallocationinfo2_171',['vmaGetAllocationInfo2',['../group__group__alloc.html#ga1405cf3eae2fd1305d645879173031a0',1,'vk_mem_alloc.h']]], + ['vmagetallocationmemoryproperties_172',['vmaGetAllocationMemoryProperties',['../group__group__alloc.html#ga571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], + ['vmagetallocatorinfo_173',['vmaGetAllocatorInfo',['../group__group__init.html#gafa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], + ['vmagetheapbudgets_174',['vmaGetHeapBudgets',['../group__group__stats.html#ga9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], + ['vmagetmemoryproperties_175',['vmaGetMemoryProperties',['../group__group__init.html#gab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], + ['vmagetmemorytypeproperties_176',['vmaGetMemoryTypeProperties',['../group__group__init.html#ga8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], + ['vmagetmemorywin32handle_177',['vmaGetMemoryWin32Handle',['../group__group__alloc.html#ga8d327b7458d8cf426b84b5efba9bb9bf',1,'vk_mem_alloc.h']]], + ['vmagetmemorywin32handle2_178',['vmaGetMemoryWin32Handle2',['../group__group__alloc.html#ga1a8d7aba3bf5a4de66c801b9988afa58',1,'vk_mem_alloc.h']]], + ['vmagetphysicaldeviceproperties_179',['vmaGetPhysicalDeviceProperties',['../group__group__init.html#gaecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], + ['vmagetpoolname_180',['vmaGetPoolName',['../group__group__alloc.html#gaf09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], + ['vmagetpoolstatistics_181',['vmaGetPoolStatistics',['../group__group__stats.html#ga34d8e7d83774eed0caee5c5ae88e217d',1,'vk_mem_alloc.h']]], + ['vmagetvirtualallocationinfo_182',['vmaGetVirtualAllocationInfo',['../group__group__virtual.html#ga8ee14ceb1fe033ec84d8aa29e1f75afa',1,'vk_mem_alloc.h']]], + ['vmagetvirtualblockstatistics_183',['vmaGetVirtualBlockStatistics',['../group__group__virtual.html#ga2902aa3130866afcc64bb5f984113db3',1,'vk_mem_alloc.h']]], + ['vmaimportvulkanfunctionsfromvolk_184',['vmaImportVulkanFunctionsFromVolk',['../group__group__init.html#gaf8d9ee01910a7af7f552145ef0065b9c',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocation_185',['vmaInvalidateAllocation',['../group__group__alloc.html#gaaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocations_186',['vmaInvalidateAllocations',['../group__group__alloc.html#gab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], + ['vmaisvirtualblockempty_187',['vmaIsVirtualBlockEmpty',['../group__group__virtual.html#gacd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], + ['vmamapmemory_188',['vmaMapMemory',['../group__group__alloc.html#gad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], + ['vmamemoryusage_189',['VmaMemoryUsage',['../group__group__alloc.html#gaa5846affa1e9da3800e3e78fae2305cc',1,'VmaMemoryUsage: vk_mem_alloc.h'],['../group__group__alloc.html#ga806e8499dde802e59eb72a1dc811c35f',1,'VmaMemoryUsage: vk_mem_alloc.h']]], + ['vmapool_190',['VmaPool',['../struct_vma_pool.html',1,'']]], + ['vmapoolcreateflagbits_191',['VmaPoolCreateFlagBits',['../group__group__alloc.html#ga9a7c45f9c863695d98c83fa5ac940fe7',1,'VmaPoolCreateFlagBits: vk_mem_alloc.h'],['../group__group__alloc.html#ga4d4f2efc2509157a9e4ecd4fd7942303',1,'VmaPoolCreateFlagBits: vk_mem_alloc.h']]], + ['vmapoolcreateflags_192',['VmaPoolCreateFlags',['../group__group__alloc.html#ga2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]], + ['vmapoolcreateinfo_193',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'VmaPoolCreateInfo'],['../group__group__alloc.html#ga1017aa83489c0eee8d2163d2bf253f67',1,'VmaPoolCreateInfo: vk_mem_alloc.h']]], + ['vmasetallocationname_194',['vmaSetAllocationName',['../group__group__alloc.html#gabe02cbb0cd913b3f125958179f2020fc',1,'vk_mem_alloc.h']]], + ['vmasetallocationuserdata_195',['vmaSetAllocationUserData',['../group__group__alloc.html#gaf9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], + ['vmasetcurrentframeindex_196',['vmaSetCurrentFrameIndex',['../group__group__init.html#gade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], + ['vmasetpoolname_197',['vmaSetPoolName',['../group__group__alloc.html#gadbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], + ['vmasetvirtualallocationuserdata_198',['vmaSetVirtualAllocationUserData',['../group__group__virtual.html#ga001ea1850458a4062b829e09c303fca2',1,'vk_mem_alloc.h']]], + ['vmastatistics_199',['VmaStatistics',['../struct_vma_statistics.html',1,'VmaStatistics'],['../group__group__stats.html#gac94bd1a382a3922ddc8de3af4d3ddd06',1,'VmaStatistics: vk_mem_alloc.h']]], + ['vmatotalstatistics_200',['VmaTotalStatistics',['../struct_vma_total_statistics.html',1,'VmaTotalStatistics'],['../group__group__stats.html#ga68916e729e55d513f88ffafbadddb770',1,'VmaTotalStatistics: vk_mem_alloc.h']]], + ['vmaunmapmemory_201',['vmaUnmapMemory',['../group__group__alloc.html#ga9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], + ['vmavirtualallocate_202',['vmaVirtualAllocate',['../group__group__virtual.html#ga6b7cdcc1c3e5103c323fedc4e1319e01',1,'vk_mem_alloc.h']]], + ['vmavirtualallocation_203',['VmaVirtualAllocation',['../struct_vma_virtual_allocation.html',1,'']]], + ['vmavirtualallocationcreateflagbits_204',['VmaVirtualAllocationCreateFlagBits',['../group__group__virtual.html#ga2e9c64d405b14156fea7e10c4ad06cb6',1,'VmaVirtualAllocationCreateFlagBits: vk_mem_alloc.h'],['../group__group__virtual.html#ga936815e64946a6b6d812d08d10184c23',1,'VmaVirtualAllocationCreateFlagBits: vk_mem_alloc.h']]], + ['vmavirtualallocationcreateflags_205',['VmaVirtualAllocationCreateFlags',['../group__group__virtual.html#gae96ffc099bf898257fb19e9410ed08a7',1,'vk_mem_alloc.h']]], + ['vmavirtualallocationcreateinfo_206',['VmaVirtualAllocationCreateInfo',['../struct_vma_virtual_allocation_create_info.html',1,'VmaVirtualAllocationCreateInfo'],['../group__group__virtual.html#gac3c90d80bedc6847a41b82d0e2158c9e',1,'VmaVirtualAllocationCreateInfo: vk_mem_alloc.h']]], + ['vmavirtualallocationinfo_207',['VmaVirtualAllocationInfo',['../struct_vma_virtual_allocation_info.html',1,'VmaVirtualAllocationInfo'],['../group__group__virtual.html#ga75bc33ff7cf18c98e101f570dc2a5ebc',1,'VmaVirtualAllocationInfo: vk_mem_alloc.h']]], + ['vmavirtualblock_208',['VmaVirtualBlock',['../struct_vma_virtual_block.html',1,'']]], + ['vmavirtualblockcreateflagbits_209',['VmaVirtualBlockCreateFlagBits',['../group__group__virtual.html#ga88bcf8c1cd3bb1610ff7343811c65bca',1,'VmaVirtualBlockCreateFlagBits: vk_mem_alloc.h'],['../group__group__virtual.html#ga0860ba1c0a67178fae4aecb63a78573e',1,'VmaVirtualBlockCreateFlagBits: vk_mem_alloc.h']]], + ['vmavirtualblockcreateflags_210',['VmaVirtualBlockCreateFlags',['../group__group__virtual.html#ga4e49c2f0ab7f6b4868833e5bac78d91e',1,'vk_mem_alloc.h']]], + ['vmavirtualblockcreateinfo_211',['VmaVirtualBlockCreateInfo',['../struct_vma_virtual_block_create_info.html',1,'VmaVirtualBlockCreateInfo'],['../group__group__virtual.html#ga4753d42d40217a3a652a3cdf253ad773',1,'VmaVirtualBlockCreateInfo: vk_mem_alloc.h']]], + ['vmavirtualfree_212',['vmaVirtualFree',['../group__group__virtual.html#ga09fc688c0c3653ff23723b037e5d5033',1,'vk_mem_alloc.h']]], + ['vmavulkanfunctions_213',['VmaVulkanFunctions',['../struct_vma_vulkan_functions.html',1,'VmaVulkanFunctions'],['../group__group__init.html#gabb0a8e3b5040d847571cca6c7f9a8074',1,'VmaVulkanFunctions: vk_mem_alloc.h']]], + ['vulkan_20functions_214',['Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'Importing Vulkan functions'],['../configuration.html#config_Vulkan_functions',1,'Pointers to Vulkan functions']]], + ['vulkan_20memory_20allocator_215',['Vulkan Memory Allocator',['../index.html',1,'']]], + ['vulkan_20version_216',['Selecting Vulkan version',['../quick_start.html#quick_start_initialization_selecting_vulkan_version',1,'']]], + ['vulkanapiversion_217',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]] ]; diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js index d659bcf7..1d3205d9 100644 --- a/docs/html/search/all_8.js +++ b/docs/html/search/all_8.js @@ -1,12 +1,13 @@ var searchData= [ - ['importing_20vulkan_20functions_0',['Importing Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'']]], - ['incorrect_20memory_20usage_1',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], - ['index_2',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], - ['information_3',['information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'Extended allocation information'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_more_information',1,'More information'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_more_information',1,'More information']]], - ['initialization_4',['Initialization',['../quick_start.html#quick_start_initialization',1,'Initialization'],['../other_api_interop.html#other_api_interop_exporting_initialization',1,'Initialization'],['../vk_ext_memory_priority.html#vk_ext_memory_priority_initialization',1,'Initialization'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_initialization',1,'Initialization'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_initialization',1,'Initialization']]], - ['initialization_5',['initialization',['../group__group__init.html',1,'Library initialization'],['../debugging_memory_usage.html#debugging_memory_usage_initialization',1,'Memory initialization']]], - ['instance_6',['instance',['../struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b',1,'VmaAllocatorCreateInfo::instance'],['../struct_vma_allocator_info.html#a2ed6a4d2d3fea039d66a13f15d0ce5fe',1,'VmaAllocatorInfo::instance']]], - ['interop_20with_20other_20graphics_20apis_7',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], - ['invalidate_8',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]] + ['importing_20memory_0',['Importing memory',['../other_api_interop.html#other_api_interop_importing_memory',1,'']]], + ['importing_20vulkan_20functions_1',['Importing Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'']]], + ['incorrect_20memory_20usage_2',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], + ['index_3',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], + ['information_4',['information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'Extended allocation information'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_more_information',1,'More information'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_more_information',1,'More information']]], + ['initialization_5',['Initialization',['../quick_start.html#quick_start_initialization',1,'Initialization'],['../other_api_interop.html#other_api_interop_exporting_initialization',1,'Initialization'],['../vk_ext_memory_priority.html#vk_ext_memory_priority_initialization',1,'Initialization'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_initialization',1,'Initialization'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_initialization',1,'Initialization']]], + ['initialization_6',['initialization',['../group__group__init.html',1,'Library initialization'],['../debugging_memory_usage.html#debugging_memory_usage_initialization',1,'Memory initialization']]], + ['instance_7',['instance',['../struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b',1,'VmaAllocatorCreateInfo::instance'],['../struct_vma_allocator_info.html#a2ed6a4d2d3fea039d66a13f15d0ce5fe',1,'VmaAllocatorInfo::instance']]], + ['interop_20with_20other_20graphics_20apis_8',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], + ['invalidate_9',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]] ]; diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js index 559df43f..e32840de 100644 --- a/docs/html/search/all_b.js +++ b/docs/html/search/all_b.js @@ -8,7 +8,7 @@ var searchData= ['maxallocationsperpass_5',['maxAllocationsPerPass',['../struct_vma_defragmentation_info.html#ac2db29d309bebc4f7d55041416e9694b',1,'VmaDefragmentationInfo']]], ['maxblockcount_6',['maxBlockCount',['../struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c',1,'VmaPoolCreateInfo']]], ['maxbytesperpass_7',['maxBytesPerPass',['../struct_vma_defragmentation_info.html#a637ada77b02179a27fa92290000afac4',1,'VmaDefragmentationInfo']]], - ['memory_8',['memory',['../other_api_interop.html#other_api_interop_exporting_memory',1,'Exporting memory'],['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'Persistently mapped memory']]], + ['memory_8',['memory',['../other_api_interop.html#other_api_interop_exporting_memory',1,'Exporting memory'],['../other_api_interop.html#other_api_interop_importing_memory',1,'Importing memory'],['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'Persistently mapped memory']]], ['memory_20allocation_9',['Memory allocation',['../group__group__alloc.html',1,'Memory allocation'],['../other_api_interop.html#other_api_interop_exporting_memory_allocation',1,'Memory allocation']]], ['memory_20allocation_20callbacks_10',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]], ['memory_20allocator_11',['Vulkan Memory Allocator',['../index.html',1,'']]], diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js index 375bec41..b673c52b 100644 --- a/docs/html/search/functions_0.js +++ b/docs/html/search/functions_0.js @@ -1,76 +1,79 @@ var searchData= [ - ['vmaallocatememory_0',['vmaAllocateMemory',['../group__group__alloc.html#gabf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]], - ['vmaallocatememoryforbuffer_1',['vmaAllocateMemoryForBuffer',['../group__group__alloc.html#ga7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]], - ['vmaallocatememoryforimage_2',['vmaAllocateMemoryForImage',['../group__group__alloc.html#ga0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]], - ['vmaallocatememorypages_3',['vmaAllocateMemoryPages',['../group__group__alloc.html#gad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]], - ['vmabegindefragmentation_4',['vmaBeginDefragmentation',['../group__group__alloc.html#gac3335566858b45541fa9c0d7a6bbb57e',1,'vk_mem_alloc.h']]], - ['vmabegindefragmentationpass_5',['vmaBeginDefragmentationPass',['../group__group__alloc.html#ga980d7da2ce3b1fd5c8b8476bc362cc00',1,'vk_mem_alloc.h']]], - ['vmabindbuffermemory_6',['vmaBindBufferMemory',['../group__group__alloc.html#ga6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]], - ['vmabindbuffermemory2_7',['vmaBindBufferMemory2',['../group__group__alloc.html#ga861f4f27189a7d11ab9d9eedc825cb6b',1,'vk_mem_alloc.h']]], - ['vmabindimagememory_8',['vmaBindImageMemory',['../group__group__alloc.html#ga3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]], - ['vmabindimagememory2_9',['vmaBindImageMemory2',['../group__group__alloc.html#ga5f3502dd7d38b53fb1533ea3921d038d',1,'vk_mem_alloc.h']]], - ['vmabuildstatsstring_10',['vmaBuildStatsString',['../group__group__stats.html#gaa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]], - ['vmabuildvirtualblockstatsstring_11',['vmaBuildVirtualBlockStatsString',['../group__group__stats.html#ga52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]], - ['vmacalculatepoolstatistics_12',['vmaCalculatePoolStatistics',['../group__group__stats.html#ga50ba0eb25d2b363b792be4645ca7a380',1,'vk_mem_alloc.h']]], - ['vmacalculatestatistics_13',['vmaCalculateStatistics',['../group__group__stats.html#ga36f3484de7aa6cd6edc4de9edfa0ff59',1,'vk_mem_alloc.h']]], - ['vmacalculatevirtualblockstatistics_14',['vmaCalculateVirtualBlockStatistics',['../group__group__virtual.html#ga93c5741bca44b43e5b849cacbd616098',1,'vk_mem_alloc.h']]], - ['vmacheckcorruption_15',['vmaCheckCorruption',['../group__group__alloc.html#ga49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]], - ['vmacheckpoolcorruption_16',['vmaCheckPoolCorruption',['../group__group__alloc.html#gad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]], - ['vmaclearvirtualblock_17',['vmaClearVirtualBlock',['../group__group__virtual.html#ga5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]], - ['vmacopyallocationtomemory_18',['vmaCopyAllocationToMemory',['../group__group__alloc.html#gaac883dd38863944335071213b9ae8477',1,'vk_mem_alloc.h']]], - ['vmacopymemorytoallocation_19',['vmaCopyMemoryToAllocation',['../group__group__alloc.html#ga11731ec58a3a43a22bb925e0780ef405',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingbuffer_20',['vmaCreateAliasingBuffer',['../group__group__alloc.html#ga60d5d4803e3c82505a2bfddb929adb03',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingbuffer2_21',['vmaCreateAliasingBuffer2',['../group__group__alloc.html#gaf0cf014344213e117bd9f9cf5f928122',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingimage_22',['vmaCreateAliasingImage',['../group__group__alloc.html#gaebc4db1f94b53dba2338b4c0fd80d0dc',1,'vk_mem_alloc.h']]], - ['vmacreatealiasingimage2_23',['vmaCreateAliasingImage2',['../group__group__alloc.html#ga69ac829f5bb0737449fa92c2d971f1bb',1,'vk_mem_alloc.h']]], - ['vmacreateallocator_24',['vmaCreateAllocator',['../group__group__init.html#ga200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]], - ['vmacreatebuffer_25',['vmaCreateBuffer',['../group__group__alloc.html#gac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]], - ['vmacreatebufferwithalignment_26',['vmaCreateBufferWithAlignment',['../group__group__alloc.html#gaa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]], - ['vmacreateimage_27',['vmaCreateImage',['../group__group__alloc.html#ga02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]], - ['vmacreatepool_28',['vmaCreatePool',['../group__group__alloc.html#ga5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], - ['vmacreatevirtualblock_29',['vmaCreateVirtualBlock',['../group__group__virtual.html#gab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], - ['vmadestroyallocator_30',['vmaDestroyAllocator',['../group__group__init.html#gaa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], - ['vmadestroybuffer_31',['vmaDestroyBuffer',['../group__group__alloc.html#ga0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], - ['vmadestroyimage_32',['vmaDestroyImage',['../group__group__alloc.html#gae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], - ['vmadestroypool_33',['vmaDestroyPool',['../group__group__alloc.html#ga5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], - ['vmadestroyvirtualblock_34',['vmaDestroyVirtualBlock',['../group__group__virtual.html#ga3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], - ['vmaenddefragmentation_35',['vmaEndDefragmentation',['../group__group__alloc.html#ga59f01ca3d53d50b7cca9b442b77a3e87',1,'vk_mem_alloc.h']]], - ['vmaenddefragmentationpass_36',['vmaEndDefragmentationPass',['../group__group__alloc.html#gaded05a445742a00718ee766144c5c226',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindex_37',['vmaFindMemoryTypeIndex',['../group__group__alloc.html#gaef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindexforbufferinfo_38',['vmaFindMemoryTypeIndexForBufferInfo',['../group__group__alloc.html#gae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindexforimageinfo_39',['vmaFindMemoryTypeIndexForImageInfo',['../group__group__alloc.html#ga088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], - ['vmaflushallocation_40',['vmaFlushAllocation',['../group__group__alloc.html#ga30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], - ['vmaflushallocations_41',['vmaFlushAllocations',['../group__group__alloc.html#gac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], - ['vmafreememory_42',['vmaFreeMemory',['../group__group__alloc.html#ga11f0fbc034fa81a4efedd73d61ce7568',1,'vk_mem_alloc.h']]], - ['vmafreememorypages_43',['vmaFreeMemoryPages',['../group__group__alloc.html#ga834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], - ['vmafreestatsstring_44',['vmaFreeStatsString',['../group__group__stats.html#ga3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], - ['vmafreevirtualblockstatsstring_45',['vmaFreeVirtualBlockStatsString',['../group__group__stats.html#ga47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], - ['vmagetallocationinfo_46',['vmaGetAllocationInfo',['../group__group__alloc.html#ga86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], - ['vmagetallocationinfo2_47',['vmaGetAllocationInfo2',['../group__group__alloc.html#ga1405cf3eae2fd1305d645879173031a0',1,'vk_mem_alloc.h']]], - ['vmagetallocationmemoryproperties_48',['vmaGetAllocationMemoryProperties',['../group__group__alloc.html#ga571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], - ['vmagetallocatorinfo_49',['vmaGetAllocatorInfo',['../group__group__init.html#gafa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], - ['vmagetheapbudgets_50',['vmaGetHeapBudgets',['../group__group__stats.html#ga9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], - ['vmagetmemoryproperties_51',['vmaGetMemoryProperties',['../group__group__init.html#gab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], - ['vmagetmemorytypeproperties_52',['vmaGetMemoryTypeProperties',['../group__group__init.html#ga8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], - ['vmagetmemorywin32handle_53',['vmaGetMemoryWin32Handle',['../group__group__alloc.html#ga8d327b7458d8cf426b84b5efba9bb9bf',1,'vk_mem_alloc.h']]], - ['vmagetmemorywin32handle2_54',['vmaGetMemoryWin32Handle2',['../group__group__alloc.html#ga1a8d7aba3bf5a4de66c801b9988afa58',1,'vk_mem_alloc.h']]], - ['vmagetphysicaldeviceproperties_55',['vmaGetPhysicalDeviceProperties',['../group__group__init.html#gaecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], - ['vmagetpoolname_56',['vmaGetPoolName',['../group__group__alloc.html#gaf09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], - ['vmagetpoolstatistics_57',['vmaGetPoolStatistics',['../group__group__stats.html#ga34d8e7d83774eed0caee5c5ae88e217d',1,'vk_mem_alloc.h']]], - ['vmagetvirtualallocationinfo_58',['vmaGetVirtualAllocationInfo',['../group__group__virtual.html#ga8ee14ceb1fe033ec84d8aa29e1f75afa',1,'vk_mem_alloc.h']]], - ['vmagetvirtualblockstatistics_59',['vmaGetVirtualBlockStatistics',['../group__group__virtual.html#ga2902aa3130866afcc64bb5f984113db3',1,'vk_mem_alloc.h']]], - ['vmaimportvulkanfunctionsfromvolk_60',['vmaImportVulkanFunctionsFromVolk',['../group__group__init.html#gaf8d9ee01910a7af7f552145ef0065b9c',1,'vk_mem_alloc.h']]], - ['vmainvalidateallocation_61',['vmaInvalidateAllocation',['../group__group__alloc.html#gaaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], - ['vmainvalidateallocations_62',['vmaInvalidateAllocations',['../group__group__alloc.html#gab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], - ['vmaisvirtualblockempty_63',['vmaIsVirtualBlockEmpty',['../group__group__virtual.html#gacd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], - ['vmamapmemory_64',['vmaMapMemory',['../group__group__alloc.html#gad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], - ['vmasetallocationname_65',['vmaSetAllocationName',['../group__group__alloc.html#gabe02cbb0cd913b3f125958179f2020fc',1,'vk_mem_alloc.h']]], - ['vmasetallocationuserdata_66',['vmaSetAllocationUserData',['../group__group__alloc.html#gaf9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], - ['vmasetcurrentframeindex_67',['vmaSetCurrentFrameIndex',['../group__group__init.html#gade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], - ['vmasetpoolname_68',['vmaSetPoolName',['../group__group__alloc.html#gadbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], - ['vmasetvirtualallocationuserdata_69',['vmaSetVirtualAllocationUserData',['../group__group__virtual.html#ga001ea1850458a4062b829e09c303fca2',1,'vk_mem_alloc.h']]], - ['vmaunmapmemory_70',['vmaUnmapMemory',['../group__group__alloc.html#ga9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], - ['vmavirtualallocate_71',['vmaVirtualAllocate',['../group__group__virtual.html#ga6b7cdcc1c3e5103c323fedc4e1319e01',1,'vk_mem_alloc.h']]], - ['vmavirtualfree_72',['vmaVirtualFree',['../group__group__virtual.html#ga09fc688c0c3653ff23723b037e5d5033',1,'vk_mem_alloc.h']]] + ['vmaallocatededicatedmemory_0',['vmaAllocateDedicatedMemory',['../group__group__alloc.html#ga9a0b91c157adec03dae1e6ea78d33625',1,'vk_mem_alloc.h']]], + ['vmaallocatememory_1',['vmaAllocateMemory',['../group__group__alloc.html#gabf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]], + ['vmaallocatememoryforbuffer_2',['vmaAllocateMemoryForBuffer',['../group__group__alloc.html#ga7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]], + ['vmaallocatememoryforimage_3',['vmaAllocateMemoryForImage',['../group__group__alloc.html#ga0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]], + ['vmaallocatememorypages_4',['vmaAllocateMemoryPages',['../group__group__alloc.html#gad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]], + ['vmabegindefragmentation_5',['vmaBeginDefragmentation',['../group__group__alloc.html#gac3335566858b45541fa9c0d7a6bbb57e',1,'vk_mem_alloc.h']]], + ['vmabegindefragmentationpass_6',['vmaBeginDefragmentationPass',['../group__group__alloc.html#ga980d7da2ce3b1fd5c8b8476bc362cc00',1,'vk_mem_alloc.h']]], + ['vmabindbuffermemory_7',['vmaBindBufferMemory',['../group__group__alloc.html#ga6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]], + ['vmabindbuffermemory2_8',['vmaBindBufferMemory2',['../group__group__alloc.html#ga861f4f27189a7d11ab9d9eedc825cb6b',1,'vk_mem_alloc.h']]], + ['vmabindimagememory_9',['vmaBindImageMemory',['../group__group__alloc.html#ga3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]], + ['vmabindimagememory2_10',['vmaBindImageMemory2',['../group__group__alloc.html#ga5f3502dd7d38b53fb1533ea3921d038d',1,'vk_mem_alloc.h']]], + ['vmabuildstatsstring_11',['vmaBuildStatsString',['../group__group__stats.html#gaa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]], + ['vmabuildvirtualblockstatsstring_12',['vmaBuildVirtualBlockStatsString',['../group__group__stats.html#ga52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]], + ['vmacalculatepoolstatistics_13',['vmaCalculatePoolStatistics',['../group__group__stats.html#ga50ba0eb25d2b363b792be4645ca7a380',1,'vk_mem_alloc.h']]], + ['vmacalculatestatistics_14',['vmaCalculateStatistics',['../group__group__stats.html#ga36f3484de7aa6cd6edc4de9edfa0ff59',1,'vk_mem_alloc.h']]], + ['vmacalculatevirtualblockstatistics_15',['vmaCalculateVirtualBlockStatistics',['../group__group__virtual.html#ga93c5741bca44b43e5b849cacbd616098',1,'vk_mem_alloc.h']]], + ['vmacheckcorruption_16',['vmaCheckCorruption',['../group__group__alloc.html#ga49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]], + ['vmacheckpoolcorruption_17',['vmaCheckPoolCorruption',['../group__group__alloc.html#gad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]], + ['vmaclearvirtualblock_18',['vmaClearVirtualBlock',['../group__group__virtual.html#ga5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]], + ['vmacopyallocationtomemory_19',['vmaCopyAllocationToMemory',['../group__group__alloc.html#gaac883dd38863944335071213b9ae8477',1,'vk_mem_alloc.h']]], + ['vmacopymemorytoallocation_20',['vmaCopyMemoryToAllocation',['../group__group__alloc.html#ga11731ec58a3a43a22bb925e0780ef405',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingbuffer_21',['vmaCreateAliasingBuffer',['../group__group__alloc.html#ga60d5d4803e3c82505a2bfddb929adb03',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingbuffer2_22',['vmaCreateAliasingBuffer2',['../group__group__alloc.html#gaf0cf014344213e117bd9f9cf5f928122',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingimage_23',['vmaCreateAliasingImage',['../group__group__alloc.html#gaebc4db1f94b53dba2338b4c0fd80d0dc',1,'vk_mem_alloc.h']]], + ['vmacreatealiasingimage2_24',['vmaCreateAliasingImage2',['../group__group__alloc.html#ga69ac829f5bb0737449fa92c2d971f1bb',1,'vk_mem_alloc.h']]], + ['vmacreateallocator_25',['vmaCreateAllocator',['../group__group__init.html#ga200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]], + ['vmacreatebuffer_26',['vmaCreateBuffer',['../group__group__alloc.html#gac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]], + ['vmacreatebufferwithalignment_27',['vmaCreateBufferWithAlignment',['../group__group__alloc.html#gaa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]], + ['vmacreatededicatedbuffer_28',['vmaCreateDedicatedBuffer',['../group__group__alloc.html#gab313b89299877ca21c196027bed9e874',1,'vk_mem_alloc.h']]], + ['vmacreatededicatedimage_29',['vmaCreateDedicatedImage',['../group__group__alloc.html#ga07c66ffa000906a599d471047a7c0324',1,'vk_mem_alloc.h']]], + ['vmacreateimage_30',['vmaCreateImage',['../group__group__alloc.html#ga02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]], + ['vmacreatepool_31',['vmaCreatePool',['../group__group__alloc.html#ga5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], + ['vmacreatevirtualblock_32',['vmaCreateVirtualBlock',['../group__group__virtual.html#gab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], + ['vmadestroyallocator_33',['vmaDestroyAllocator',['../group__group__init.html#gaa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], + ['vmadestroybuffer_34',['vmaDestroyBuffer',['../group__group__alloc.html#ga0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], + ['vmadestroyimage_35',['vmaDestroyImage',['../group__group__alloc.html#gae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], + ['vmadestroypool_36',['vmaDestroyPool',['../group__group__alloc.html#ga5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], + ['vmadestroyvirtualblock_37',['vmaDestroyVirtualBlock',['../group__group__virtual.html#ga3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], + ['vmaenddefragmentation_38',['vmaEndDefragmentation',['../group__group__alloc.html#ga59f01ca3d53d50b7cca9b442b77a3e87',1,'vk_mem_alloc.h']]], + ['vmaenddefragmentationpass_39',['vmaEndDefragmentationPass',['../group__group__alloc.html#gaded05a445742a00718ee766144c5c226',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindex_40',['vmaFindMemoryTypeIndex',['../group__group__alloc.html#gaef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforbufferinfo_41',['vmaFindMemoryTypeIndexForBufferInfo',['../group__group__alloc.html#gae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforimageinfo_42',['vmaFindMemoryTypeIndexForImageInfo',['../group__group__alloc.html#ga088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], + ['vmaflushallocation_43',['vmaFlushAllocation',['../group__group__alloc.html#ga30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], + ['vmaflushallocations_44',['vmaFlushAllocations',['../group__group__alloc.html#gac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], + ['vmafreememory_45',['vmaFreeMemory',['../group__group__alloc.html#ga11f0fbc034fa81a4efedd73d61ce7568',1,'vk_mem_alloc.h']]], + ['vmafreememorypages_46',['vmaFreeMemoryPages',['../group__group__alloc.html#ga834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], + ['vmafreestatsstring_47',['vmaFreeStatsString',['../group__group__stats.html#ga3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], + ['vmafreevirtualblockstatsstring_48',['vmaFreeVirtualBlockStatsString',['../group__group__stats.html#ga47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], + ['vmagetallocationinfo_49',['vmaGetAllocationInfo',['../group__group__alloc.html#ga86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], + ['vmagetallocationinfo2_50',['vmaGetAllocationInfo2',['../group__group__alloc.html#ga1405cf3eae2fd1305d645879173031a0',1,'vk_mem_alloc.h']]], + ['vmagetallocationmemoryproperties_51',['vmaGetAllocationMemoryProperties',['../group__group__alloc.html#ga571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], + ['vmagetallocatorinfo_52',['vmaGetAllocatorInfo',['../group__group__init.html#gafa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], + ['vmagetheapbudgets_53',['vmaGetHeapBudgets',['../group__group__stats.html#ga9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], + ['vmagetmemoryproperties_54',['vmaGetMemoryProperties',['../group__group__init.html#gab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], + ['vmagetmemorytypeproperties_55',['vmaGetMemoryTypeProperties',['../group__group__init.html#ga8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], + ['vmagetmemorywin32handle_56',['vmaGetMemoryWin32Handle',['../group__group__alloc.html#ga8d327b7458d8cf426b84b5efba9bb9bf',1,'vk_mem_alloc.h']]], + ['vmagetmemorywin32handle2_57',['vmaGetMemoryWin32Handle2',['../group__group__alloc.html#ga1a8d7aba3bf5a4de66c801b9988afa58',1,'vk_mem_alloc.h']]], + ['vmagetphysicaldeviceproperties_58',['vmaGetPhysicalDeviceProperties',['../group__group__init.html#gaecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], + ['vmagetpoolname_59',['vmaGetPoolName',['../group__group__alloc.html#gaf09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], + ['vmagetpoolstatistics_60',['vmaGetPoolStatistics',['../group__group__stats.html#ga34d8e7d83774eed0caee5c5ae88e217d',1,'vk_mem_alloc.h']]], + ['vmagetvirtualallocationinfo_61',['vmaGetVirtualAllocationInfo',['../group__group__virtual.html#ga8ee14ceb1fe033ec84d8aa29e1f75afa',1,'vk_mem_alloc.h']]], + ['vmagetvirtualblockstatistics_62',['vmaGetVirtualBlockStatistics',['../group__group__virtual.html#ga2902aa3130866afcc64bb5f984113db3',1,'vk_mem_alloc.h']]], + ['vmaimportvulkanfunctionsfromvolk_63',['vmaImportVulkanFunctionsFromVolk',['../group__group__init.html#gaf8d9ee01910a7af7f552145ef0065b9c',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocation_64',['vmaInvalidateAllocation',['../group__group__alloc.html#gaaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocations_65',['vmaInvalidateAllocations',['../group__group__alloc.html#gab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], + ['vmaisvirtualblockempty_66',['vmaIsVirtualBlockEmpty',['../group__group__virtual.html#gacd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], + ['vmamapmemory_67',['vmaMapMemory',['../group__group__alloc.html#gad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], + ['vmasetallocationname_68',['vmaSetAllocationName',['../group__group__alloc.html#gabe02cbb0cd913b3f125958179f2020fc',1,'vk_mem_alloc.h']]], + ['vmasetallocationuserdata_69',['vmaSetAllocationUserData',['../group__group__alloc.html#gaf9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], + ['vmasetcurrentframeindex_70',['vmaSetCurrentFrameIndex',['../group__group__init.html#gade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], + ['vmasetpoolname_71',['vmaSetPoolName',['../group__group__alloc.html#gadbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], + ['vmasetvirtualallocationuserdata_72',['vmaSetVirtualAllocationUserData',['../group__group__virtual.html#ga001ea1850458a4062b829e09c303fca2',1,'vk_mem_alloc.h']]], + ['vmaunmapmemory_73',['vmaUnmapMemory',['../group__group__alloc.html#ga9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], + ['vmavirtualallocate_74',['vmaVirtualAllocate',['../group__group__virtual.html#ga6b7cdcc1c3e5103c323fedc4e1319e01',1,'vk_mem_alloc.h']]], + ['vmavirtualfree_75',['vmaVirtualFree',['../group__group__virtual.html#ga09fc688c0c3653ff23723b037e5d5033',1,'vk_mem_alloc.h']]] ]; diff --git a/docs/html/search/pages_8.js b/docs/html/search/pages_8.js index 3bebba8b..15526611 100644 --- a/docs/html/search/pages_8.js +++ b/docs/html/search/pages_8.js @@ -1,11 +1,12 @@ var searchData= [ - ['importing_20vulkan_20functions_0',['Importing Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'']]], - ['incorrect_20memory_20usage_1',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], - ['index_2',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], - ['information_3',['information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'Extended allocation information'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_more_information',1,'More information'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_more_information',1,'More information']]], - ['initialization_4',['Initialization',['../quick_start.html#quick_start_initialization',1,'Initialization'],['../other_api_interop.html#other_api_interop_exporting_initialization',1,'Initialization'],['../vk_ext_memory_priority.html#vk_ext_memory_priority_initialization',1,'Initialization'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_initialization',1,'Initialization'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_initialization',1,'Initialization']]], - ['initialization_5',['Memory initialization',['../debugging_memory_usage.html#debugging_memory_usage_initialization',1,'']]], - ['interop_20with_20other_20graphics_20apis_6',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], - ['invalidate_7',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]] + ['importing_20memory_0',['Importing memory',['../other_api_interop.html#other_api_interop_importing_memory',1,'']]], + ['importing_20vulkan_20functions_1',['Importing Vulkan functions',['../quick_start.html#quick_start_initialization_importing_vulkan_functions',1,'']]], + ['incorrect_20memory_20usage_2',['Debugging incorrect memory usage',['../debugging_memory_usage.html',1,'index']]], + ['index_3',['Choosing memory type index',['../custom_memory_pools.html#custom_memory_pools_MemTypeIndex',1,'']]], + ['information_4',['information',['../other_api_interop.html#other_api_interop_exporting_extended_allocation_information',1,'Extended allocation information'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_more_information',1,'More information'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_more_information',1,'More information']]], + ['initialization_5',['Initialization',['../quick_start.html#quick_start_initialization',1,'Initialization'],['../other_api_interop.html#other_api_interop_exporting_initialization',1,'Initialization'],['../vk_ext_memory_priority.html#vk_ext_memory_priority_initialization',1,'Initialization'],['../vk_amd_device_coherent_memory.html#vk_amd_device_coherent_memory_initialization',1,'Initialization'],['../enabling_buffer_device_address.html#enabling_buffer_device_address_initialization',1,'Initialization']]], + ['initialization_6',['Memory initialization',['../debugging_memory_usage.html#debugging_memory_usage_initialization',1,'']]], + ['interop_20with_20other_20graphics_20apis_7',['Interop with other graphics APIs',['../other_api_interop.html',1,'index']]], + ['invalidate_8',['Cache flush and invalidate',['../memory_mapping.html#memory_mapping_cache_control',1,'']]] ]; diff --git a/docs/html/search/pages_b.js b/docs/html/search/pages_b.js index c14c2a7b..cee85b62 100644 --- a/docs/html/search/pages_b.js +++ b/docs/html/search/pages_b.js @@ -5,7 +5,7 @@ var searchData= ['mapping_2',['Memory mapping',['../memory_mapping.html',1,'index']]], ['mapping_20functions_3',['Mapping functions',['../memory_mapping.html#memory_mapping_mapping_functions',1,'']]], ['margins_4',['Margins',['../debugging_memory_usage.html#debugging_memory_usage_margins',1,'']]], - ['memory_5',['memory',['../other_api_interop.html#other_api_interop_exporting_memory',1,'Exporting memory'],['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'Persistently mapped memory']]], + ['memory_5',['memory',['../other_api_interop.html#other_api_interop_exporting_memory',1,'Exporting memory'],['../other_api_interop.html#other_api_interop_importing_memory',1,'Importing memory'],['../memory_mapping.html#memory_mapping_persistently_mapped_memory',1,'Persistently mapped memory']]], ['memory_20allocation_6',['Memory allocation',['../other_api_interop.html#other_api_interop_exporting_memory_allocation',1,'']]], ['memory_20allocation_20callbacks_7',['Device memory allocation callbacks',['../configuration.html#allocation_callbacks',1,'']]], ['memory_20allocator_8',['Vulkan Memory Allocator',['../index.html',1,'']]], diff --git a/docs/html/struct_vma_allocation_create_info.html b/docs/html/struct_vma_allocation_create_info.html index 583239d5..71e503e6 100644 --- a/docs/html/struct_vma_allocation_create_info.html +++ b/docs/html/struct_vma_allocation_create_info.html @@ -102,7 +102,7 @@

    Detailed Description

    Parameters of new VmaAllocation.

    -

    To be used with functions like vmaCreateBuffer(), vmaCreateImage(), and many others.

    +

    To be used with functions like vmaCreateBuffer(), vmaCreateImage(), and many others.

    Member Data Documentation

    ◆ flags

    diff --git a/docs/html/struct_vma_allocation_info.html b/docs/html/struct_vma_allocation_info.html index b1026d6c..6358901f 100644 --- a/docs/html/struct_vma_allocation_info.html +++ b/docs/html/struct_vma_allocation_info.html @@ -147,7 +147,7 @@

    Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory, offset) pair is unique to this allocation.

    -

    You usually don't need to use this offset. If you create a buffer or an image together with the allocation using e.g. function vmaCreateBuffer(), vmaCreateImage(), functions that operate on these resources refer to the beginning of the buffer or image, not entire device memory block. Functions like vmaMapMemory(), vmaBindBufferMemory() also refer to the beginning of the allocation and apply this offset automatically.

    +

    You usually don't need to use this offset. If you create a buffer or an image together with the allocation using e.g. function vmaCreateBuffer(), vmaCreateImage(), functions that operate on these resources refer to the beginning of the buffer or image, not entire device memory block. Functions like vmaMapMemory(), vmaBindBufferMemory() also refer to the beginning of the allocation and apply this offset automatically.

    It can change after the allocation is moved during Defragmentation.

    diff --git a/docs/html/topics.html b/docs/html/topics.html index 455533a9..c091fd70 100644 --- a/docs/html/topics.html +++ b/docs/html/topics.html @@ -77,7 +77,7 @@
    Here is a list of all topics with brief descriptions:
    - +
     Library initializationAPI elements related to the initialization and management of the entire library, especially VmaAllocator object
     Memory allocationAPI elements related to the allocation, deallocation, and management of Vulkan memory, buffers, images. Most basic ones being: vmaCreateBuffer(), vmaCreateImage()
     Memory allocationAPI elements related to the allocation, deallocation, and management of Vulkan memory, buffers, images. Most basic ones being: vmaCreateBuffer(), vmaCreateImage()
     Virtual allocatorAPI elements related to the mechanism of Virtual allocator - using the core allocation algorithm for user-defined purpose without allocating any real GPU memory
     StatisticsAPI elements that query current status of the allocator, from memory usage, budget, to full dump of the internal state in JSON format. See documentation chapter: Statistics
    diff --git a/docs/html/usage_patterns.html b/docs/html/usage_patterns.html index f0ae1e7c..f33fb6ef 100644 --- a/docs/html/usage_patterns.html +++ b/docs/html/usage_patterns.html @@ -105,13 +105,13 @@

    VkImage img;
    vmaCreateImage(allocator, &imgCreateInfo, &allocCreateInfo, &img, &alloc, nullptr);
    -
    VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    Function similar to vmaCreateBuffer().
    -
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:550
    -
    @ VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
    Set this flag if the allocation should have its own memory block.
    Definition vk_mem_alloc.h:589
    -
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1291
    -
    float priority
    A floating-point value between 0 and 1, indicating the priority of the allocation relative to other m...
    Definition vk_mem_alloc.h:1337
    -
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1299
    -
    VmaAllocationCreateFlags flags
    Use VmaAllocationCreateFlagBits enum.
    Definition vk_mem_alloc.h:1293
    +
    VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    Function similar to vmaCreateBuffer() but for images.
    +
    @ VMA_MEMORY_USAGE_AUTO
    Definition vk_mem_alloc.h:551
    +
    @ VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
    Set this flag if the allocation should have its own memory block.
    Definition vk_mem_alloc.h:590
    +
    Parameters of new VmaAllocation.
    Definition vk_mem_alloc.h:1292
    +
    float priority
    A floating-point value between 0 and 1, indicating the priority of the allocation relative to other m...
    Definition vk_mem_alloc.h:1338
    +
    VmaMemoryUsage usage
    Intended usage of memory.
    Definition vk_mem_alloc.h:1300
    +
    VmaAllocationCreateFlags flags
    Use VmaAllocationCreateFlagBits enum.
    Definition vk_mem_alloc.h:1294
    Represents single memory allocation.

    Also consider: Consider creating them as dedicated allocations using VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT, especially if they are large or if you plan to destroy and recreate them with different sizes e.g. when display resolution changes. Prefer to create such resources first and all other GPU resources (like textures and vertex buffers) later. When VK_EXT_memory_priority extension is enabled, it is also worth setting high priority to such allocation to decrease chances to be evicted to system memory by the operating system.

    @@ -136,10 +136,10 @@

    memcpy(allocInfo.pMappedData, myData, myDataSize);
    VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
    Creates a new VkBuffer, allocates and binds memory for it.
    -
    @ VMA_ALLOCATION_CREATE_MAPPED_BIT
    Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
    Definition vk_mem_alloc.h:610
    -
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
    Definition vk_mem_alloc.h:659
    -
    Definition vk_mem_alloc.h:1410
    -
    void * pMappedData
    Pointer to the beginning of this allocation as mapped data.
    Definition vk_mem_alloc.h:1452
    +
    @ VMA_ALLOCATION_CREATE_MAPPED_BIT
    Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.
    Definition vk_mem_alloc.h:611
    +
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_SEQUENTIAL_WRITE_BIT
    Definition vk_mem_alloc.h:660
    +
    Definition vk_mem_alloc.h:1411
    +
    void * pMappedData
    Pointer to the beginning of this allocation as mapped data.
    Definition vk_mem_alloc.h:1453

    Also consider: You can map the allocation using vmaMapMemory() or you can create it as persistenly mapped using VMA_ALLOCATION_CREATE_MAPPED_BIT, as in the example above.

    Readback

    @@ -162,7 +162,7 @@

    ...
    const float* downloadedData = (const float*)allocInfo.pMappedData;
    -
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
    Definition vk_mem_alloc.h:671
    +
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT
    Definition vk_mem_alloc.h:672

    Advanced data uploading

    For resources that you frequently write on CPU via mapped pointer and frequently read on GPU e.g. as a uniform buffer (also called "dynamic"), multiple options are possible:

    @@ -277,7 +277,7 @@

    }
    VkResult vmaCopyMemoryToAllocation(VmaAllocator allocator, const void *pSrcHostPointer, VmaAllocation dstAllocation, VkDeviceSize dstAllocationLocalOffset, VkDeviceSize size)
    Maps the allocation temporarily if needed, copies data from specified host pointer to it,...
    void vmaGetAllocationMemoryProperties(VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags)
    Given an allocation, returns Property Flags of its memory type.
    -
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT
    Definition vk_mem_alloc.h:683
    +
    @ VMA_ALLOCATION_CREATE_HOST_ACCESS_ALLOW_TRANSFER_INSTEAD_BIT
    Definition vk_mem_alloc.h:684

    Other use cases

    Here are some other, less obvious use cases and their recommended settings:

    diff --git a/docs/html/virtual_allocator.html b/docs/html/virtual_allocator.html index 2b9e88bd..9edb409a 100644 --- a/docs/html/virtual_allocator.html +++ b/docs/html/virtual_allocator.html @@ -93,8 +93,8 @@

    VmaVirtualBlock block;
    VkResult res = vmaCreateVirtualBlock(&blockCreateInfo, &block);
    VkResult vmaCreateVirtualBlock(const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock)
    Creates new VmaVirtualBlock object.
    -
    Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
    Definition vk_mem_alloc.h:1599
    -
    VkDeviceSize size
    Total size of the virtual block.
    Definition vk_mem_alloc.h:1605
    +
    Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().
    Definition vk_mem_alloc.h:1600
    +
    VkDeviceSize size
    Total size of the virtual block.
    Definition vk_mem_alloc.h:1606
    Handle to a virtual block object that allows to use core allocation algorithm without allocating any ...

    Making virtual allocations

    @@ -120,8 +120,8 @@

    // Allocation failed - no space for it could be found. Handle this error!
    }
    VkResult vmaVirtualAllocate(VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VmaVirtualAllocation *pAllocation, VkDeviceSize *pOffset)
    Allocates new virtual allocation inside given VmaVirtualBlock.
    -
    Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
    Definition vk_mem_alloc.h:1620
    -
    VkDeviceSize size
    Size of the allocation.
    Definition vk_mem_alloc.h:1625
    +
    Parameters of created virtual allocation to be passed to vmaVirtualAllocate().
    Definition vk_mem_alloc.h:1621
    +
    VkDeviceSize size
    Size of the allocation.
    Definition vk_mem_alloc.h:1626
    Represents single memory allocation done inside VmaVirtualBlock.

    Deallocation

    @@ -149,8 +149,8 @@

    vmaVirtualFree(block, alloc);
    void vmaGetVirtualAllocationInfo(VmaVirtualBlock virtualBlock, VmaVirtualAllocation allocation, VmaVirtualAllocationInfo *pVirtualAllocInfo)
    Returns information about a specific virtual allocation within a virtual block, like its size and pUs...
    -
    Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
    Definition vk_mem_alloc.h:1643
    -
    void * pUserData
    Custom pointer associated with the allocation.
    Definition vk_mem_alloc.h:1658
    +
    Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().
    Definition vk_mem_alloc.h:1644
    +
    void * pUserData
    Custom pointer associated with the allocation.
    Definition vk_mem_alloc.h:1659

    Alignment and units

    It feels natural to express sizes and offsets in bytes. If an offset of an allocation needs to be aligned to a multiply of some number (e.g. 4 bytes), you can fill optional member VmaVirtualAllocationCreateInfo::alignment to request it. Example:

    @@ -160,7 +160,7 @@

    res = vmaVirtualAllocate(block, &allocCreateInfo, &alloc, nullptr);
    -
    VkDeviceSize alignment
    Required alignment of the allocation. Optional.
    Definition vk_mem_alloc.h:1630
    +
    VkDeviceSize alignment
    Required alignment of the allocation. Optional.
    Definition vk_mem_alloc.h:1631

    Alignments of different allocations made from one block may vary. However, if all alignments and sizes are always multiply of some size e.g. 4 B or sizeof(MyDataStruct), you can express all sizes, alignments, and offsets in multiples of that size instead of individual bytes. It might be more convenient, but you need to make sure to use this new unit consistently in all the places:

    • VmaVirtualBlockCreateInfo::size
    • @@ -175,9 +175,9 @@

      printf("My virtual block has %llu bytes used by %u virtual allocations\n",
      void vmaGetVirtualBlockStatistics(VmaVirtualBlock virtualBlock, VmaStatistics *pStats)
      Calculates and returns statistics about virtual allocations and memory usage in given VmaVirtualBlock...
      -
      Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool,...
      Definition vk_mem_alloc.h:1180
      -
      VkDeviceSize allocationBytes
      Total number of bytes occupied by all VmaAllocation objects.
      Definition vk_mem_alloc.h:1202
      -
      uint32_t allocationCount
      Number of VmaAllocation objects allocated.
      Definition vk_mem_alloc.h:1188
      +
      Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool,...
      Definition vk_mem_alloc.h:1181
      +
      VkDeviceSize allocationBytes
      Total number of bytes occupied by all VmaAllocation objects.
      Definition vk_mem_alloc.h:1203
      +
      uint32_t allocationCount
      Number of VmaAllocation objects allocated.
      Definition vk_mem_alloc.h:1189

      You can also request a full list of allocations and free regions as a string in JSON format by calling vmaBuildVirtualBlockStatsString(). Returned string must be later freed using vmaFreeVirtualBlockStatsString(). The format of this string differs from the one returned by the main Vulkan allocator, but it is similar.

      Additional considerations

      diff --git a/docs/html/vk__mem__alloc_8h.html b/docs/html/vk__mem__alloc_8h.html index 15776838..1e66a17a 100644 --- a/docs/html/vk__mem__alloc_8h.html +++ b/docs/html/vk__mem__alloc_8h.html @@ -341,6 +341,8 @@  Sets name of a custom pool.
      VkResult vmaAllocateMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)  General purpose memory allocation.
      +VkResult vmaAllocateDedicatedMemory (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) + General purpose allocation of a dedicated memory.
      VkResult vmaAllocateMemoryPages (VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, size_t allocationCount, VmaAllocation *pAllocations, VmaAllocationInfo *pAllocationInfo)  General purpose memory allocation for multiple allocation objects at once.
      VkResult vmaAllocateMemoryForBuffer (VmaAllocator allocator, VkBuffer buffer, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) @@ -403,6 +405,8 @@  Creates a new VkBuffer, allocates and binds memory for it.
      VkResult vmaCreateBufferWithAlignment (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkDeviceSize minAlignment, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)  Creates a buffer with additional minimum alignment.
      +VkResult vmaCreateDedicatedBuffer (VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) + Creates a dedicated buffer while offering extra parameter pMemoryAllocateNext.
      VkResult vmaCreateAliasingBuffer (VmaAllocator allocator, VmaAllocation allocation, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer)  Creates a new VkBuffer, binds already created memory for it.
      VkResult vmaCreateAliasingBuffer2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkBufferCreateInfo *pBufferCreateInfo, VkBuffer *pBuffer) @@ -410,7 +414,9 @@ void vmaDestroyBuffer (VmaAllocator allocator, VkBuffer buffer, VmaAllocation allocation)  Destroys Vulkan buffer and frees allocated memory.
      VkResult vmaCreateImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) - Function similar to vmaCreateBuffer().
      + Function similar to vmaCreateBuffer() but for images.
      +VkResult vmaCreateDedicatedImage (VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, void *(VkMemoryAllocateInfo) pMemoryAllocateNext, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo) + Function similar to vmaCreateDedicatedBuffer() but for images.
      VkResult vmaCreateAliasingImage (VmaAllocator allocator, VmaAllocation allocation, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage)  Function similar to vmaCreateAliasingBuffer() but for images.
      VkResult vmaCreateAliasingImage2 (VmaAllocator allocator, VmaAllocation allocation, VkDeviceSize allocationLocalOffset, const VkImageCreateInfo *pImageCreateInfo, VkImage *pImage) diff --git a/docs/html/vk_ext_memory_priority.html b/docs/html/vk_ext_memory_priority.html index 42d8239d..815ae4a3 100644 --- a/docs/html/vk_ext_memory_priority.html +++ b/docs/html/vk_ext_memory_priority.html @@ -118,13 +118,13 @@

      VkImage img;
      vmaCreateImage(allocator, &imgCreateInfo, &allocCreateInfo, &img, &alloc, nullptr);
      -
      VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
      Function similar to vmaCreateBuffer().
      -
      @ VMA_MEMORY_USAGE_AUTO
      Definition vk_mem_alloc.h:550
      -
      @ VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
      Set this flag if the allocation should have its own memory block.
      Definition vk_mem_alloc.h:589
      -
      Parameters of new VmaAllocation.
      Definition vk_mem_alloc.h:1291
      -
      float priority
      A floating-point value between 0 and 1, indicating the priority of the allocation relative to other m...
      Definition vk_mem_alloc.h:1337
      -
      VmaMemoryUsage usage
      Intended usage of memory.
      Definition vk_mem_alloc.h:1299
      -
      VmaAllocationCreateFlags flags
      Use VmaAllocationCreateFlagBits enum.
      Definition vk_mem_alloc.h:1293
      +
      VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)
      Function similar to vmaCreateBuffer() but for images.
      +
      @ VMA_MEMORY_USAGE_AUTO
      Definition vk_mem_alloc.h:551
      +
      @ VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT
      Set this flag if the allocation should have its own memory block.
      Definition vk_mem_alloc.h:590
      +
      Parameters of new VmaAllocation.
      Definition vk_mem_alloc.h:1292
      +
      float priority
      A floating-point value between 0 and 1, indicating the priority of the allocation relative to other m...
      Definition vk_mem_alloc.h:1338
      +
      VmaMemoryUsage usage
      Intended usage of memory.
      Definition vk_mem_alloc.h:1300
      +
      VmaAllocationCreateFlags flags
      Use VmaAllocationCreateFlagBits enum.
      Definition vk_mem_alloc.h:1294
      Represents single memory allocation.

      priority member is ignored in the following situations:

        diff --git a/docs/html/vk_khr_dedicated_allocation.html b/docs/html/vk_khr_dedicated_allocation.html index 2fcf41f5..09ed5105 100644 --- a/docs/html/vk_khr_dedicated_allocation.html +++ b/docs/html/vk_khr_dedicated_allocation.html @@ -92,8 +92,8 @@
        vmaCreateAllocator(&allocatorInfo, &allocator);
        VkResult vmaCreateAllocator(const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator)
        Creates VmaAllocator object.
        -
        @ VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT
        Enables usage of VK_KHR_dedicated_allocation extension.
        Definition vk_mem_alloc.h:380
        -

        That is all. The extension will be automatically used whenever you create a buffer using vmaCreateBuffer() or image using vmaCreateImage().

        +
        @ VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT
        Enables usage of VK_KHR_dedicated_allocation extension.
        Definition vk_mem_alloc.h:381
        +

        That is all. The extension will be automatically used whenever you create a buffer using vmaCreateBuffer() or image using vmaCreateImage().

        When using the extension together with Vulkan Validation Layer, you will receive warnings like this:

        vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer.

        It is OK, you should just ignore it. It happens because you use function vkGetBufferMemoryRequirements2KHR() instead of standard vkGetBufferMemoryRequirements(), while the validation layer seems to be unaware of it.

        diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index 11347295..7f81f7f3 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -80,6 +80,7 @@ See also: [product page on GPUOpen](https://gpuopen.com/vulkan-memory-allocator/ - [Leak detection features](@ref debugging_memory_usage_leak_detection) - \subpage other_api_interop - [Exporting memory](@ref other_api_interop_exporting_memory) + - [Importing memory](@ref other_api_interop_importing_memory) - \subpage usage_patterns - [GPU-only resource](@ref usage_patterns_gpu_only) - [Staging copy for upload](@ref usage_patterns_staging_copy_upload) @@ -1979,6 +1980,8 @@ The function creates a #VmaAllocation object without creating a buffer or an ima You must free the returned allocation object using vmaFreeMemory() or vmaFreeMemoryPages(). +There is also extended version of this function: vmaAllocateDedicatedMemory() +that offers additional parameter `pMemoryAllocateNext`. */ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory( VmaAllocator VMA_NOT_NULL allocator, @@ -1987,7 +1990,14 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory( VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation, VmaAllocationInfo* VMA_NULLABLE pAllocationInfo); -/** \bref TODO docs... */ +/** \brief General purpose allocation of a dedicated memory. + +This function is similar vmaAllocateMemory(), but +it always allocates dedicated memory - flag #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. +It offers additional parameter `pMemoryAllocateNext`, +which can be used to attach `pNext` chain to the `VkMemoryAllocateInfo` structure. +It can be useful for importing external memory. For more information, see \ref other_api_interop. +*/ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateDedicatedMemory( VmaAllocator VMA_NOT_NULL allocator, const VkMemoryRequirements* VMA_NOT_NULL pVkMemoryRequirements, @@ -2654,8 +2664,9 @@ allocation for this buffer, just like when using although recommended as a good practice, is out of scope of this library and could be implemented by the user as a higher-level logic on top of VMA. -There is also an extended version of this function available with additional parameter `minAlignment` - -see vmaCreateBufferWithAlignment(). +There are also extended versions of this function available: +- With additional parameter `minAlignment` - see vmaCreateBufferWithAlignment(). +- With additional parameter `pMemoryAllocateNext` - see vmaCreateDedicatedBuffer(). */ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer( VmaAllocator VMA_NOT_NULL allocator, @@ -2680,7 +2691,14 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation, VmaAllocationInfo* VMA_NULLABLE pAllocationInfo); -/** \brief TODO docs... */ +/** \brief Creates a dedicated buffer while offering extra parameter `pMemoryAllocateNext`. + +This function is similar vmaCreateBuffer(), but +it always allocates dedicated memory for the buffer - flag #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. +It offers additional parameter `pMemoryAllocateNext`, +which can be used to attach `pNext` chain to the `VkMemoryAllocateInfo` structure. +It can be useful for importing external memory. For more information, see \ref other_api_interop. +*/ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateDedicatedBuffer( VmaAllocator VMA_NOT_NULL allocator, const VkBufferCreateInfo* VMA_NOT_NULL pBufferCreateInfo, @@ -2762,7 +2780,11 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyBuffer( VkBuffer VMA_NULLABLE_NON_DISPATCHABLE buffer, VmaAllocation VMA_NULLABLE allocation); -/// Function similar to vmaCreateBuffer(). +/** \brief Function similar to vmaCreateBuffer() but for images. + +There is also an extended version of this function available: vmaCreateDedicatedImage() +which offers additional parameter `pMemoryAllocateNext`. +*/ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage( VmaAllocator VMA_NOT_NULL allocator, const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo, @@ -2771,6 +2793,23 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage( VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation, VmaAllocationInfo* VMA_NULLABLE pAllocationInfo); +/** \brief Function similar to vmaCreateDedicatedBuffer() but for images. + +This function is similar vmaCreateImage(), but +it always allocates dedicated memory for the image - flag #VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT is implied. +It offers additional parameter `pMemoryAllocateNext`, +which can be used to attach `pNext` chain to the `VkMemoryAllocateInfo` structure. +It can be useful for importing external memory. For more information, see \ref other_api_interop. +*/ +VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateDedicatedImage( + VmaAllocator VMA_NOT_NULL allocator, + const VkImageCreateInfo* VMA_NOT_NULL pImageCreateInfo, + const VmaAllocationCreateInfo* VMA_NOT_NULL pAllocationCreateInfo, + void* VMA_NULLABLE VMA_EXTENDS_VK_STRUCT(VkMemoryAllocateInfo) pMemoryAllocateNext, + VkImage VMA_NULLABLE_NON_DISPATCHABLE* VMA_NOT_NULL pImage, + VmaAllocation VMA_NULLABLE* VMA_NOT_NULL pAllocation, + VmaAllocationInfo* VMA_NULLABLE pAllocationInfo); + /// Function similar to vmaCreateAliasingBuffer() but for images. VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingImage( VmaAllocator VMA_NOT_NULL allocator, @@ -10502,6 +10541,14 @@ struct VmaAllocator_T VkBuffer* pBuffer, VmaAllocation* pAllocation, VmaAllocationInfo* pAllocationInfo); + // Common code for public functions vmaCreateImage, vmaCreateDedicatedImage. + VkResult CreateImage( + const VkImageCreateInfo* pImageCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, + void* pMemoryAllocateNext, // pNext chain for VkMemoryAllocateInfo. + VkImage* pImage, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo); // Main allocation function. VkResult AllocateMemory( @@ -14219,11 +14266,6 @@ VkResult VmaAllocator_T::CreateBuffer( GetBufferMemoryRequirements(*pBuffer, vkMemReq, requiresDedicatedAllocation, prefersDedicatedAllocation); - if(pMemoryAllocateNext != VMA_NULL) - { - requiresDedicatedAllocation = true; - } - // 2a. Include minAlignment vkMemReq.alignment = VMA_MAX(vkMemReq.alignment, minAlignment); @@ -14273,6 +14315,87 @@ VkResult VmaAllocator_T::CreateBuffer( return res; } +VkResult VmaAllocator_T::CreateImage( + const VkImageCreateInfo* pImageCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, + void* pMemoryAllocateNext, + VkImage* pImage, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) +{ + *pImage = VK_NULL_HANDLE; + *pAllocation = VK_NULL_HANDLE; + + if (pImageCreateInfo->extent.width == 0 || + pImageCreateInfo->extent.height == 0 || + pImageCreateInfo->extent.depth == 0 || + pImageCreateInfo->mipLevels == 0 || + pImageCreateInfo->arrayLayers == 0) + { + return VK_ERROR_INITIALIZATION_FAILED; + } + + // 1. Create VkImage. + VkResult res = (*m_VulkanFunctions.vkCreateImage)(m_hDevice, pImageCreateInfo, + GetAllocationCallbacks(), pImage); + if (res == VK_SUCCESS) + { + VmaSuballocationType suballocType = pImageCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ? + VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL : + VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR; + + // 2. Allocate memory using allocator. + VkMemoryRequirements vkMemReq = {}; + bool requiresDedicatedAllocation = false; + bool prefersDedicatedAllocation = false; + GetImageMemoryRequirements(*pImage, vkMemReq, + requiresDedicatedAllocation, prefersDedicatedAllocation); + + res = AllocateMemory( + vkMemReq, + requiresDedicatedAllocation, + prefersDedicatedAllocation, + VK_NULL_HANDLE, // dedicatedBuffer + *pImage, // dedicatedImage + VmaBufferImageUsage(*pImageCreateInfo), // dedicatedBufferImageUsage + pMemoryAllocateNext, + *pAllocationCreateInfo, + suballocType, + 1, // allocationCount + pAllocation); + if (res == VK_SUCCESS) + { + // 3. Bind image with memory. + if ((pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_DONT_BIND_BIT) == 0) + { + res = BindImageMemory(*pAllocation, 0, *pImage, VMA_NULL); + } + if (res == VK_SUCCESS) + { + // All steps succeeded. +#if VMA_STATS_STRING_ENABLED + (*pAllocation)->InitImageUsage(*pImageCreateInfo); +#endif + if (pAllocationInfo != VMA_NULL) + { + GetAllocationInfo(*pAllocation, pAllocationInfo); + } + + return VK_SUCCESS; + } + FreeMemory(1, pAllocation); + *pAllocation = VK_NULL_HANDLE; + (*m_VulkanFunctions.vkDestroyImage)(m_hDevice, *pImage, GetAllocationCallbacks()); + *pImage = VK_NULL_HANDLE; + return res; + } + (*m_VulkanFunctions.vkDestroyImage)(m_hDevice, *pImage, GetAllocationCallbacks()); + *pImage = VK_NULL_HANDLE; + return res; + } + return res; +} + VkResult VmaAllocator_T::AllocateMemory( const VkMemoryRequirements& vkMemReq, bool requiresDedicatedAllocation, @@ -14290,8 +14413,12 @@ VkResult VmaAllocator_T::AllocateMemory( memset(pAllocations, 0, sizeof(VmaAllocation) * allocationCount); VMA_ASSERT(VmaIsPow2(vkMemReq.alignment)); + // If using custom pNext chain for VkMemoryAllocateInfo, must require dedicated allocations. - VMA_ASSERT(pMemoryAllocateNext == VMA_NULL || requiresDedicatedAllocation); + if(pMemoryAllocateNext != VMA_NULL) + { + requiresDedicatedAllocation = true; + } if(vkMemReq.size == 0) { @@ -16555,7 +16682,8 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( VMA_DEBUG_LOG("vmaCreateBufferWithAlignment"); VMA_DEBUG_GLOBAL_MUTEX_LOCK; - return allocator->CreateBuffer(pBufferCreateInfo, pAllocationCreateInfo, minAlignment, + return allocator->CreateBuffer(pBufferCreateInfo, pAllocationCreateInfo, + minAlignment, // minAlignment VMA_NULL, // pMemoryAllocateNext pBuffer, pAllocation, pAllocationInfo); } @@ -16573,9 +16701,13 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateDedicatedBuffer( VMA_DEBUG_LOG("vmaCreateDedicatedBuffer"); VMA_DEBUG_GLOBAL_MUTEX_LOCK; - return allocator->CreateBuffer(pBufferCreateInfo, pAllocationCreateInfo, + VmaAllocationCreateInfo allocCreateInfoCopy = *pAllocationCreateInfo; + allocCreateInfoCopy.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; + + return allocator->CreateBuffer(pBufferCreateInfo, &allocCreateInfoCopy, 1, // minAlignment - pMemoryAllocateNext, pBuffer, pAllocation, pAllocationInfo); + pMemoryAllocateNext, // pMemoryAllocateNext + pBuffer, pAllocation, pAllocationInfo); } VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingBuffer( @@ -16671,91 +16803,37 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage( VmaAllocationInfo* pAllocationInfo) { VMA_ASSERT(allocator && pImageCreateInfo && pAllocationCreateInfo && pImage && pAllocation); - VMA_ASSERT((pImageCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT_COPY) == 0 && "vmaCreateImage() doesn't support disjoint multi-planar images. Please allocate memory for the planes using vmaAllocateMemory() and bind them using vmaBindImageMemory2()."); - - if(pImageCreateInfo->extent.width == 0 || - pImageCreateInfo->extent.height == 0 || - pImageCreateInfo->extent.depth == 0 || - pImageCreateInfo->mipLevels == 0 || - pImageCreateInfo->arrayLayers == 0) - { - return VK_ERROR_INITIALIZATION_FAILED; - } - VMA_DEBUG_LOG("vmaCreateImage"); + VMA_DEBUG_GLOBAL_MUTEX_LOCK; - VMA_DEBUG_GLOBAL_MUTEX_LOCK - - *pImage = VK_NULL_HANDLE; - *pAllocation = VK_NULL_HANDLE; - - // 1. Create VkImage. - VkResult res = (*allocator->GetVulkanFunctions().vkCreateImage)( - allocator->m_hDevice, - pImageCreateInfo, - allocator->GetAllocationCallbacks(), - pImage); - if(res == VK_SUCCESS) - { - VmaSuballocationType suballocType = pImageCreateInfo->tiling == VK_IMAGE_TILING_OPTIMAL ? - VMA_SUBALLOCATION_TYPE_IMAGE_OPTIMAL : - VMA_SUBALLOCATION_TYPE_IMAGE_LINEAR; - - // 2. Allocate memory using allocator. - VkMemoryRequirements vkMemReq = {}; - bool requiresDedicatedAllocation = false; - bool prefersDedicatedAllocation = false; - allocator->GetImageMemoryRequirements(*pImage, vkMemReq, - requiresDedicatedAllocation, prefersDedicatedAllocation); + return allocator->CreateImage(pImageCreateInfo, pAllocationCreateInfo, + VMA_NULL, // pMemoryAllocateNext + pImage, pAllocation, pAllocationInfo); +} - res = allocator->AllocateMemory( - vkMemReq, - requiresDedicatedAllocation, - prefersDedicatedAllocation, - VK_NULL_HANDLE, // dedicatedBuffer - *pImage, // dedicatedImage - VmaBufferImageUsage(*pImageCreateInfo), // dedicatedBufferImageUsage - VMA_NULL, // pMemoryAllocateNext - *pAllocationCreateInfo, - suballocType, - 1, // allocationCount - pAllocation); +VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateDedicatedImage( + VmaAllocator allocator, + const VkImageCreateInfo* pImageCreateInfo, + const VmaAllocationCreateInfo* pAllocationCreateInfo, + void* pMemoryAllocateNext, + VkImage* pImage, + VmaAllocation* pAllocation, + VmaAllocationInfo* pAllocationInfo) +{ + VMA_ASSERT(allocator && pImageCreateInfo && pAllocationCreateInfo && pImage && pAllocation); + VMA_ASSERT((pImageCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT_COPY) == 0 && + "vmaCreateDedicatedImage() doesn't support disjoint multi-planar images. Please allocate memory for the planes using vmaAllocateMemory() and bind them using vmaBindImageMemory2()."); + VMA_DEBUG_LOG("vmaCreateDedicatedImage"); + VMA_DEBUG_GLOBAL_MUTEX_LOCK; - if(res == VK_SUCCESS) - { - // 3. Bind image with memory. - if((pAllocationCreateInfo->flags & VMA_ALLOCATION_CREATE_DONT_BIND_BIT) == 0) - { - res = allocator->BindImageMemory(*pAllocation, 0, *pImage, VMA_NULL); - } - if(res == VK_SUCCESS) - { - // All steps succeeded. - #if VMA_STATS_STRING_ENABLED - (*pAllocation)->InitImageUsage(*pImageCreateInfo); - #endif - if(pAllocationInfo != VMA_NULL) - { - allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); - } + VmaAllocationCreateInfo allocCreateInfoCopy = *pAllocationCreateInfo; + allocCreateInfoCopy.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; - return VK_SUCCESS; - } - allocator->FreeMemory( - 1, // allocationCount - pAllocation); - *pAllocation = VK_NULL_HANDLE; - (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks()); - *pImage = VK_NULL_HANDLE; - return res; - } - (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, *pImage, allocator->GetAllocationCallbacks()); - *pImage = VK_NULL_HANDLE; - return res; - } - return res; + return allocator->CreateImage(pImageCreateInfo, &allocCreateInfoCopy, + pMemoryAllocateNext, // pMemoryAllocateNext + pImage, pAllocation, pAllocationInfo); } VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateAliasingImage( @@ -18965,6 +19043,44 @@ with its own dedicated memory, use function vmaGetAllocationInfo2() to retrieve extended allocation information in structure #VmaAllocationInfo2, which provides extra members: `blockSize` and `dedicatedMemory`. +\section other_api_interop_importing_memory Importing memory + +Importing external memory requires attaching an extra structure like `VkImportMemoryWin32HandleInfoKHR` +to the `pNext` chain of `VkMemoryAllocateInfo` structure. +VMA offers support for it by providing functions that allocate memory, create a buffer or an image +always with a dedicated `VkDeviceMemory` block and accept custom `pNext` pointer: +vmaAllocateDedicatedMemory(), vmaCreateDedicatedBuffer(), vmaCreateDedicatedImage(). +Example: + +\code +constexpr VkExternalMemoryHandleTypeFlagBits handleType = + VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; + +VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = { + VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR }; +externalMemBufCreateInfo.handleTypes = handleType; + +VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; +bufCreateInfo.pNext = &externalMemBufCreateInfo; // !!! +bufCreateInfo.size = ... +bufCreateInfo.usage = ... + +VkImportMemoryWin32HandleInfoKHR importInfo = { + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR }; +importInfo.handleType = handleType; +importInfo.handle = myExternalHandleToImport; + +VmaAllocationCreateInfo allocCreateInfo = {}; +allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + +VkBuffer buf = VK_NULL_HANDLE; +VmaAllocation alloc = VK_NULL_HANDLE; +VkResult res = vmaCreateDedicatedBuffer(allocator, &bufCreateInfo, &allocCreateInfo, + &importInfo, // pMemoryAllocateNext !!! + &buf, &alloc, nullptr); +// Check res... +\endcode + \page usage_patterns Recommended usage patterns diff --git a/src/Tests.cpp b/src/Tests.cpp index d28b2c6b..82e62fa8 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -8596,9 +8596,10 @@ static void TestWin32HandlesImport() vkGetInstanceProcAddr(g_hVulkanInstance, "vkGetPhysicalDeviceExternalBufferProperties"); TEST(pfnGetPhysicalDeviceExternalBufferProperties != nullptr); - for(size_t testIndex = 0; testIndex < 2; ++testIndex) + for(size_t testIndex = 0; testIndex < 4; ++testIndex) { - const bool testImport = testIndex > 0; + const bool testImport = (testIndex & 1) != 0; + const bool testCreateBuffer = (testIndex & 2) != 0; VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; bufCreateInfo.size = 0x10000; // 64 KB @@ -8636,7 +8637,7 @@ static void TestWin32HandlesImport() mappingName); TEST(sharedHandle != NULL); - // Map the memory temporarily and write the dataValue there. + // Map the memory temporarily and write the dataValue to it. void* sharedMemoryPtr = MapViewOfFile( sharedHandle, FILE_MAP_ALL_ACCESS, @@ -8664,26 +8665,35 @@ static void TestWin32HandlesImport() memoryAllocateNext = &importInfo; } - VkBuffer buf = VK_NULL_HANDLE; - TEST(vkCreateBuffer(g_hDevice, &bufCreateInfo, g_Allocs, &buf) == VK_SUCCESS); - VmaAllocationCreateInfo allocCreateInfo = {}; // Will need to read the data. allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; - VkMemoryRequirements memReq = {}; - vkGetBufferMemoryRequirements(g_hDevice, buf, &memReq); - + VkBuffer buf = VK_NULL_HANDLE; VmaAllocation alloc = VK_NULL_HANDLE; - TEST(vmaAllocateDedicatedMemory(g_hAllocator, &memReq, - &allocCreateInfo, memoryAllocateNext, &alloc, nullptr) == VK_SUCCESS); + + if (testCreateBuffer) + { + TEST(vmaCreateDedicatedBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + memoryAllocateNext, &buf, &alloc, nullptr) == VK_SUCCESS); + } + else + { + TEST(vkCreateBuffer(g_hDevice, &bufCreateInfo, g_Allocs, &buf) == VK_SUCCESS); + + VkMemoryRequirements memReq = {}; + vkGetBufferMemoryRequirements(g_hDevice, buf, &memReq); + + TEST(vmaAllocateDedicatedMemory(g_hAllocator, &memReq, + &allocCreateInfo, memoryAllocateNext, &alloc, nullptr) == VK_SUCCESS); + + TEST(vmaBindBufferMemory(g_hAllocator, alloc, buf) == VK_SUCCESS); + } VmaAllocationInfo2 allocInfo2 = {}; vmaGetAllocationInfo2(g_hAllocator, alloc, &allocInfo2); TEST(allocInfo2.dedicatedMemory); - TEST(vmaBindBufferMemory(g_hAllocator, alloc, buf) == VK_SUCCESS); - if(testImport) { uint32_t readValue = 0; From e64d42b36fc20a7e377c58f5b70b4871a7bb5075 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Wed, 3 Sep 2025 13:48:39 +0200 Subject: [PATCH 15/16] Improvements in TestWin32HandlesImport Passing now on RTX 4090, but still failing on integrated AMD. --- src/Tests.cpp | 85 ++++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 68 insertions(+), 17 deletions(-) diff --git a/src/Tests.cpp b/src/Tests.cpp index 82e62fa8..71883a97 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -8666,16 +8666,34 @@ static void TestWin32HandlesImport() } VmaAllocationCreateInfo allocCreateInfo = {}; - // Will need to read the data. - allocCreateInfo.flags = VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT; + // We would like read the data. We cannot use VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT + // as we don't use VMA_MEMORY_USAGE_AUTO. + allocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | + VK_MEMORY_PROPERTY_HOST_CACHED_BIT; VkBuffer buf = VK_NULL_HANDLE; VmaAllocation alloc = VK_NULL_HANDLE; if (testCreateBuffer) { - TEST(vmaCreateDedicatedBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, - memoryAllocateNext, &buf, &alloc, nullptr) == VK_SUCCESS); + VkResult res = vmaCreateDedicatedBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, + memoryAllocateNext, &buf, &alloc, nullptr); + if (res != VK_SUCCESS) + { + TEST(alloc == VK_NULL_HANDLE && buf == VK_NULL_HANDLE); + if (res == VK_ERROR_FEATURE_NOT_PRESENT) + { + wprintf(L" WARNING: Couldn't create dedicated buffer - returned VK_ERROR_FEATURE_NOT_PRESENT. Likely no eligible memory type found.\n"); + } + else if (res == VK_ERROR_OUT_OF_DEVICE_MEMORY) + { + wprintf(L" WARNING: Couldn't create dedicated buffer - returned VK_ERROR_OUT_OF_DEVICE_MEMORY.\n"); + } + else + { + wprintf(L" WARNING: Couldn't create dedicated buffer - returned other error %u.\n", res); + } + } } else { @@ -8683,22 +8701,55 @@ static void TestWin32HandlesImport() VkMemoryRequirements memReq = {}; vkGetBufferMemoryRequirements(g_hDevice, buf, &memReq); - - TEST(vmaAllocateDedicatedMemory(g_hAllocator, &memReq, - &allocCreateInfo, memoryAllocateNext, &alloc, nullptr) == VK_SUCCESS); - TEST(vmaBindBufferMemory(g_hAllocator, alloc, buf) == VK_SUCCESS); - } + VkResult res = vmaAllocateDedicatedMemory(g_hAllocator, &memReq, + &allocCreateInfo, memoryAllocateNext, &alloc, nullptr); + if(res != VK_SUCCESS) + { + TEST(alloc == VK_NULL_HANDLE); + if (res == VK_ERROR_FEATURE_NOT_PRESENT) + { + wprintf(L" WARNING: Couldn't allocate dedicated memory - returned VK_ERROR_FEATURE_NOT_PRESENT. Likely no eligible memory type found.\n"); + } + else if(res == VK_ERROR_OUT_OF_DEVICE_MEMORY) + { + wprintf(L" WARNING: Couldn't allocate dedicated memory - returned VK_ERROR_OUT_OF_DEVICE_MEMORY.\n"); + } + else + { + wprintf(L" WARNING: Couldn't allocate dedicated memory - returned other error %u.\n", res); + } + } - VmaAllocationInfo2 allocInfo2 = {}; - vmaGetAllocationInfo2(g_hAllocator, alloc, &allocInfo2); - TEST(allocInfo2.dedicatedMemory); + if(alloc) + { + TEST(vmaBindBufferMemory(g_hAllocator, alloc, buf) == VK_SUCCESS); + } + } - if(testImport) + if(alloc) { - uint32_t readValue = 0; - TEST(vmaCopyAllocationToMemory(g_hAllocator, alloc, 0, &readValue, sizeof readValue) == VK_SUCCESS); - TEST(readValue == dataValue); + VmaAllocationInfo2 allocInfo2 = {}; + vmaGetAllocationInfo2(g_hAllocator, alloc, &allocInfo2); + TEST(allocInfo2.dedicatedMemory); + + VkMemoryPropertyFlags memPropsFlags = 0; + vmaGetAllocationMemoryProperties(g_hAllocator, alloc, &memPropsFlags); + const bool memoryMappable = (memPropsFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0; + + if(testImport) + { + if(memoryMappable) + { + uint32_t readValue = 0; + TEST(vmaCopyAllocationToMemory(g_hAllocator, alloc, 0, &readValue, sizeof readValue) == VK_SUCCESS); + TEST(readValue == dataValue); + } + else + { + wprintf(L" WARNING: Allocation ended up in a non-HOST_VISIBLE memory.\n"); + } + } } vmaDestroyBuffer(g_hAllocator, buf, alloc); @@ -8844,7 +8895,7 @@ void Test() TestDeviceLocalMapped(); TestMaintenance5(); TestWin32HandlesExport(); - TestWin32HandlesImport(); + //TestWin32HandlesImport(); // Commented out because failing on some GPUs with strange errors. TestMappingMultithreaded(); TestLinearAllocator(); ManuallyTestLinearAllocator(); From d9ff0b454bac167a9c9d664620b182acdea25183 Mon Sep 17 00:00:00 2001 From: Adam Sawicki Date: Mon, 8 Sep 2025 17:01:39 +0200 Subject: [PATCH 16/16] Changes in TestWin32HandlesExport Based on a patch proposed in https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/pull/503 - thanks @Agrael1 --- src/Tests.cpp | 215 +++++++------------------------------------------- 1 file changed, 30 insertions(+), 185 deletions(-) diff --git a/src/Tests.cpp b/src/Tests.cpp index 71883a97..90d9a438 100644 --- a/src/Tests.cpp +++ b/src/Tests.cpp @@ -8529,7 +8529,7 @@ static void TestWin32HandlesExport() if((externalBufferProperties.externalMemoryProperties.externalMemoryFeatures & VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT) == 0) { - wprintf(L"WARNING: External memory not exportable, skipping test.\n"); + wprintf(L" WARNING: External memory not exportable, skipping test.\n"); return; } requiresDedicated = (externalBufferProperties.externalMemoryProperties.externalMemoryFeatures & @@ -8587,180 +8587,6 @@ static void TestWin32HandlesImport() wprintf(L"Test Win32 handles import\n"); - constexpr VkExternalMemoryHandleTypeFlagBits handleType = - VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; - constexpr uint32_t dataValue = 0x72158510; - - PFN_vkGetPhysicalDeviceExternalBufferProperties pfnGetPhysicalDeviceExternalBufferProperties = - (PFN_vkGetPhysicalDeviceExternalBufferProperties) - vkGetInstanceProcAddr(g_hVulkanInstance, "vkGetPhysicalDeviceExternalBufferProperties"); - TEST(pfnGetPhysicalDeviceExternalBufferProperties != nullptr); - - for(size_t testIndex = 0; testIndex < 4; ++testIndex) - { - const bool testImport = (testIndex & 1) != 0; - const bool testCreateBuffer = (testIndex & 2) != 0; - - VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; - bufCreateInfo.size = 0x10000; // 64 KB - bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT; - - HANDLE sharedHandle = NULL; - if(testImport) - { - VkPhysicalDeviceExternalBufferInfo externalBufInfo = { - VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_BUFFER_INFO }; - externalBufInfo.flags = bufCreateInfo.flags; - externalBufInfo.usage = bufCreateInfo.usage; - externalBufInfo.handleType = handleType; - - VkExternalBufferProperties externalBufProps = { - VK_STRUCTURE_TYPE_EXTERNAL_BUFFER_PROPERTIES }; - - pfnGetPhysicalDeviceExternalBufferProperties(g_hPhysicalDevice, - &externalBufInfo, &externalBufProps); - - if((externalBufProps.externalMemoryProperties.externalMemoryFeatures & - VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT) == 0) - { - wprintf(L" WARNING: External memory not importable, skipping test.\n"); - continue; - } - - const wchar_t* mappingName = L"MySharedVulkanMemory"; - sharedHandle = CreateFileMapping( - INVALID_HANDLE_VALUE, // hFile - only in memory, no file. - NULL, // lpFileMappingAttributes - PAGE_READWRITE, - 0, // dwMaximumSizeHigh - (DWORD)bufCreateInfo.size, // dwMaximumSizeLow - mappingName); - TEST(sharedHandle != NULL); - - // Map the memory temporarily and write the dataValue to it. - void* sharedMemoryPtr = MapViewOfFile( - sharedHandle, - FILE_MAP_ALL_ACCESS, - 0, // dwFileOffsetHigh - 0, // dwFileOffsetLow - bufCreateInfo.size); - TEST(sharedMemoryPtr != NULL); - memcpy(sharedMemoryPtr, &dataValue, sizeof(dataValue)); - UnmapViewOfFile(sharedMemoryPtr); - } - - VkImportMemoryWin32HandleInfoKHR importInfo = { - VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR }; - VkExternalMemoryBufferCreateInfoKHR externalMemBufCreateInfo = { - VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_BUFFER_CREATE_INFO_KHR }; - void* memoryAllocateNext = nullptr; - - if(testImport) - { - externalMemBufCreateInfo.handleTypes = handleType; - bufCreateInfo.pNext = &externalMemBufCreateInfo; - - importInfo.handleType = handleType; - importInfo.handle = sharedHandle; - memoryAllocateNext = &importInfo; - } - - VmaAllocationCreateInfo allocCreateInfo = {}; - // We would like read the data. We cannot use VMA_ALLOCATION_CREATE_HOST_ACCESS_RANDOM_BIT - // as we don't use VMA_MEMORY_USAGE_AUTO. - allocCreateInfo.preferredFlags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | - VK_MEMORY_PROPERTY_HOST_CACHED_BIT; - - VkBuffer buf = VK_NULL_HANDLE; - VmaAllocation alloc = VK_NULL_HANDLE; - - if (testCreateBuffer) - { - VkResult res = vmaCreateDedicatedBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, - memoryAllocateNext, &buf, &alloc, nullptr); - if (res != VK_SUCCESS) - { - TEST(alloc == VK_NULL_HANDLE && buf == VK_NULL_HANDLE); - if (res == VK_ERROR_FEATURE_NOT_PRESENT) - { - wprintf(L" WARNING: Couldn't create dedicated buffer - returned VK_ERROR_FEATURE_NOT_PRESENT. Likely no eligible memory type found.\n"); - } - else if (res == VK_ERROR_OUT_OF_DEVICE_MEMORY) - { - wprintf(L" WARNING: Couldn't create dedicated buffer - returned VK_ERROR_OUT_OF_DEVICE_MEMORY.\n"); - } - else - { - wprintf(L" WARNING: Couldn't create dedicated buffer - returned other error %u.\n", res); - } - } - } - else - { - TEST(vkCreateBuffer(g_hDevice, &bufCreateInfo, g_Allocs, &buf) == VK_SUCCESS); - - VkMemoryRequirements memReq = {}; - vkGetBufferMemoryRequirements(g_hDevice, buf, &memReq); - - VkResult res = vmaAllocateDedicatedMemory(g_hAllocator, &memReq, - &allocCreateInfo, memoryAllocateNext, &alloc, nullptr); - if(res != VK_SUCCESS) - { - TEST(alloc == VK_NULL_HANDLE); - if (res == VK_ERROR_FEATURE_NOT_PRESENT) - { - wprintf(L" WARNING: Couldn't allocate dedicated memory - returned VK_ERROR_FEATURE_NOT_PRESENT. Likely no eligible memory type found.\n"); - } - else if(res == VK_ERROR_OUT_OF_DEVICE_MEMORY) - { - wprintf(L" WARNING: Couldn't allocate dedicated memory - returned VK_ERROR_OUT_OF_DEVICE_MEMORY.\n"); - } - else - { - wprintf(L" WARNING: Couldn't allocate dedicated memory - returned other error %u.\n", res); - } - } - - if(alloc) - { - TEST(vmaBindBufferMemory(g_hAllocator, alloc, buf) == VK_SUCCESS); - } - } - - if(alloc) - { - VmaAllocationInfo2 allocInfo2 = {}; - vmaGetAllocationInfo2(g_hAllocator, alloc, &allocInfo2); - TEST(allocInfo2.dedicatedMemory); - - VkMemoryPropertyFlags memPropsFlags = 0; - vmaGetAllocationMemoryProperties(g_hAllocator, alloc, &memPropsFlags); - const bool memoryMappable = (memPropsFlags & VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT) != 0; - - if(testImport) - { - if(memoryMappable) - { - uint32_t readValue = 0; - TEST(vmaCopyAllocationToMemory(g_hAllocator, alloc, 0, &readValue, sizeof readValue) == VK_SUCCESS); - TEST(readValue == dataValue); - } - else - { - wprintf(L" WARNING: Allocation ended up in a non-HOST_VISIBLE memory.\n"); - } - } - } - - vmaDestroyBuffer(g_hAllocator, buf, alloc); - - if(testImport) - { - CloseHandle(sharedHandle); - } - } - -#if 0 constexpr VkExternalMemoryHandleTypeFlagBits handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT; @@ -8794,10 +8620,12 @@ static void TestWin32HandlesImport() vkGetPhysicalDeviceExternalBufferProperties(g_hPhysicalDevice, &externalBufferInfo, &externalBufferProperties); + constexpr VkExternalMemoryFeatureFlags expectedFlags = + VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT | VK_EXTERNAL_MEMORY_FEATURE_IMPORTABLE_BIT; if((externalBufferProperties.externalMemoryProperties.externalMemoryFeatures & - VK_EXTERNAL_MEMORY_FEATURE_EXPORTABLE_BIT) == 0) + expectedFlags) != expectedFlags) { - wprintf(L"WARNING: External memory not exportable, skipping test.\n"); + wprintf(L" WARNING: External memory not exportable and importable, skipping test.\n"); return; } requiresDedicated = (externalBufferProperties.externalMemoryProperties.externalMemoryFeatures & @@ -8831,21 +8659,38 @@ static void TestWin32HandlesImport() VmaAllocation alloc = VK_NULL_HANDLE; TEST(vmaCreateBuffer(g_hAllocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, nullptr) == VK_SUCCESS); HANDLE handle = NULL; - HANDLE handle2 = NULL; TEST(vmaGetMemoryWin32Handle(g_hAllocator, alloc, nullptr, &handle) == VK_SUCCESS); TEST(handle != nullptr); - TEST(vmaGetMemoryWin32Handle(g_hAllocator, alloc, nullptr, &handle2) == VK_SUCCESS); - TEST(handle2 != nullptr); - TEST(handle2 != handle); + // Import it into another allocation. + VkImportMemoryWin32HandleInfoKHR importMemHandleInfo = { + VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR }; + importMemHandleInfo.handleType = handleType; + importMemHandleInfo.handle = handle; + importMemHandleInfo.name = nullptr; + VmaAllocationCreateInfo importAllocCreateInfo = {}; + importAllocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO; + + VkBuffer importedBuf = VK_NULL_HANDLE; + VmaAllocation importedAlloc = VK_NULL_HANDLE; + TEST(vmaCreateDedicatedBuffer(g_hAllocator, &bufCreateInfo, &importAllocCreateInfo, + &importMemHandleInfo, &importedBuf, &importedAlloc, nullptr) == VK_SUCCESS); + TEST(importedBuf != VK_NULL_HANDLE); + TEST(importedAlloc != VK_NULL_HANDLE); + + VmaAllocationInfo2 allocInfo2 = {}; + vmaGetAllocationInfo2(g_hAllocator, importedAlloc, &allocInfo2); + if (test == 1) + { + TEST(allocInfo2.dedicatedMemory != VK_FALSE); + } + + vmaDestroyBuffer(g_hAllocator, importedBuf, importedAlloc); vmaDestroyBuffer(g_hAllocator, buf, alloc); TEST(CloseHandle(handle)); - TEST(CloseHandle(handle2)); } vmaDestroyPool(g_hAllocator, pool); -#endif // #if 0 - #endif } @@ -8895,7 +8740,7 @@ void Test() TestDeviceLocalMapped(); TestMaintenance5(); TestWin32HandlesExport(); - //TestWin32HandlesImport(); // Commented out because failing on some GPUs with strange errors. + TestWin32HandlesImport(); TestMappingMultithreaded(); TestLinearAllocator(); ManuallyTestLinearAllocator();