From a8581fc96c2b198a06b85db1a1e1e215138b998e Mon Sep 17 00:00:00 2001 From: Adam Sawicki <adam.sawicki@amd.com> Date: Mon, 10 Jan 2022 18:11:09 +0100 Subject: [PATCH] Deleted the whole Record&Replay feature. COMPATIBILITY BREAKING! Removed from the API: VmaAllocatorCreateInfo::pRecordSettings, VmaRecordSettings, VmaRecordFlagBits, VmaRecordFlags. Regenerated documentation. Updated README. --- CMakeLists.txt | 6 +- README.md | 2 - docs/Recording file format.md | 343 -- docs/html/allocation_annotation.html | 18 +- docs/html/annotated.html | 17 +- docs/html/choosing_memory_type.html | 16 +- docs/html/classes.html | 2 +- docs/html/custom_memory_pools.html | 19 +- docs/html/debugging_memory_usage.html | 2 +- docs/html/defragmentation.html | 26 +- docs/html/deprecated.html | 4 + docs/html/functions.html | 7 +- docs/html/functions_vars.html | 7 +- docs/html/general_considerations.html | 6 +- docs/html/globals.html | 13 +- docs/html/globals_defs.html | 1 - docs/html/globals_enum.html | 1 - docs/html/globals_eval.html | 6 +- docs/html/globals_func.html | 3 - docs/html/globals_type.html | 3 - docs/html/index.html | 2 - docs/html/memory_mapping.html | 18 +- docs/html/quick_start.html | 16 +- docs/html/resource_aliasing.html | 6 +- docs/html/search/all_10.js | 193 +- docs/html/search/all_5.js | 3 +- docs/html/search/all_8.js | 17 +- docs/html/search/all_9.js | 18 +- docs/html/search/all_a.js | 24 +- docs/html/search/all_b.js | 25 +- docs/html/search/all_c.js | 4 +- docs/html/search/all_d.js | 7 +- docs/html/search/all_e.js | 4 +- docs/html/search/all_f.js | 9 +- docs/html/search/classes_0.js | 15 +- docs/html/search/defines_0.js | 3 +- docs/html/search/enums_0.js | 5 +- docs/html/search/enumvalues_0.js | 36 +- docs/html/search/functions_0.js | 85 +- docs/html/search/pages_5.js | 2 +- docs/html/search/pages_6.js | 2 +- docs/html/search/pages_7.js | 2 +- docs/html/search/pages_8.js | 3 +- docs/html/search/pages_9.js | 5 +- docs/html/search/pages_a.js | 6 +- docs/html/search/searchdata.js | 4 +- docs/html/search/typedefs_1.js | 23 +- docs/html/search/variables_4.js | 3 +- docs/html/search/variables_8.js | 34 +- docs/html/search/variables_c.js | 2 +- docs/html/statistics.html | 2 +- docs/html/staying_within_budget.html | 2 +- docs/html/struct_vma_allocation.html | 3 +- docs/html/struct_vma_allocation_info.html | 11 +- ...uct_vma_allocator_create_info-members.html | 12 +- .../struct_vma_allocator_create_info.html | 42 - docs/html/struct_vma_budget.html | 3 +- .../struct_vma_defragmentation_info2.html | 4 +- .../struct_vma_pool_create_info-members.html | 13 +- docs/html/struct_vma_pool_create_info.html | 22 - docs/html/struct_vma_pool_stats-members.html | 3 +- docs/html/struct_vma_pool_stats.html | 24 +- docs/html/usage_patterns.html | 2 +- docs/html/virtual_allocator.html | 22 +- docs/html/vk__mem__alloc_8h.html | 268 +- docs/html/vk_khr_dedicated_allocation.html | 2 +- include/vk_mem_alloc.h | 1074 +--- src/CMakeLists.txt | 4 - src/VmaReplay/CMakeLists.txt | 28 - src/VmaReplay/Common.cpp | 721 --- src/VmaReplay/Common.h | 426 -- src/VmaReplay/Constants.cpp | 795 --- src/VmaReplay/Constants.h | 149 - src/VmaReplay/VmaReplay.cpp | 4397 ----------------- src/VmaReplay/VmaUsage.cpp | 24 - src/VmaReplay/VmaUsage.h | 50 - 76 files changed, 493 insertions(+), 8688 deletions(-) delete mode 100644 docs/Recording file format.md delete mode 100644 src/VmaReplay/CMakeLists.txt delete mode 100644 src/VmaReplay/Common.cpp delete mode 100644 src/VmaReplay/Common.h delete mode 100644 src/VmaReplay/Constants.cpp delete mode 100644 src/VmaReplay/Constants.h delete mode 100644 src/VmaReplay/VmaReplay.cpp delete mode 100644 src/VmaReplay/VmaUsage.cpp delete mode 100644 src/VmaReplay/VmaUsage.h diff --git a/CMakeLists.txt b/CMakeLists.txt index d46b019..959058c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,16 +5,13 @@ project(VulkanMemoryAllocator) find_package(Vulkan REQUIRED) include_directories(${Vulkan_INCLUDE_DIR}) -# VulkanMemoryAllocator contains an sample application and VmaReplay which are not build by default +# VulkanMemoryAllocator contains an sample application which is not built by default option(VMA_BUILD_SAMPLE "Build VulkanMemoryAllocator sample application" OFF) option(VMA_BUILD_SAMPLE_SHADERS "Build VulkanMemoryAllocator sample application's shaders" OFF) -option(VMA_BUILD_REPLAY "Build VulkanMemoryAllocator replay application" OFF) message(STATUS "VMA_BUILD_SAMPLE = ${VMA_BUILD_SAMPLE}") message(STATUS "VMA_BUILD_SAMPLE_SHADERS = ${VMA_BUILD_SAMPLE_SHADERS}") -message(STATUS "VMA_BUILD_REPLAY = ${VMA_BUILD_REPLAY}") -option(VMA_RECORDING_ENABLED "Enable VMA memory recording for debugging" OFF) option(VMA_STATIC_VULKAN_FUNCTIONS "Link statically with Vulkan API" ON) option(VMA_DYNAMIC_VULKAN_FUNCTIONS "Fetch pointers to Vulkan functions internally (no static linking)" OFF) option(VMA_DEBUG_ALWAYS_DEDICATED_MEMORY "Every allocation will have its own memory block" OFF) @@ -22,7 +19,6 @@ option(VMA_DEBUG_INITIALIZE_ALLOCATIONS "Automatically fill new allocations and option(VMA_DEBUG_GLOBAL_MUTEX "Enable single mutex protecting all entry calls to the library" OFF) option(VMA_DEBUG_DONT_EXCEED_MAX_MEMORY_ALLOCATION_COUNT "Never exceed VkPhysicalDeviceLimits::maxMemoryAllocationCount and return error" OFF) -message(STATUS "VMA_RECORDING_ENABLED = ${VMA_RECORDING_ENABLED}") message(STATUS "VMA_STATIC_VULKAN_FUNCTIONS = ${VMA_STATIC_VULKAN_FUNCTIONS}") message(STATUS "VMA_DYNAMIC_VULKAN_FUNCTIONS = ${VMA_DYNAMIC_VULKAN_FUNCTIONS}") message(STATUS "VMA_DEBUG_ALWAYS_DEDICATED_MEMORY = ${VMA_DEBUG_ALWAYS_DEDICATED_MEMORY}") diff --git a/README.md b/README.md index 0f2f2a5..e4117fe 100644 --- a/README.md +++ b/README.md @@ -53,13 +53,11 @@ Additional features: - VK_AMD_device_coherent_memory - VK_KHR_buffer_device_address - Defragmentation of GPU and CPU memory: Let the library move data around to free some memory blocks and make your allocations better compacted. -- Lost allocations: Allocate memory with appropriate flags and let the library remove allocations that are not used for many frames to make room for new ones. - Statistics: Obtain detailed statistics about the amount of memory used, unused, number of allocated blocks, number of allocations etc. - globally, per memory heap, and per memory type. - Debug annotations: Associate string with name or opaque pointer to your own data with every allocation. - JSON dump: Obtain a string in JSON format with detailed map of internal state, including list of allocations and gaps between them. - Convert this JSON dump into a picture to visualize your memory. See [tools/VmaDumpVis](tools/VmaDumpVis/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 before and after every allocation to detect out-of-bounds memory corruption. -- Record and replay sequence of calls to library functions to a file to check correctness, measure performance, and gather statistics. - Support for interoperability with OpenGL. - Virtual allocator: Interface for using core allocation algorithm to allocate any custom data, e.g. pieces of one large buffer. diff --git a/docs/Recording file format.md b/docs/Recording file format.md deleted file mode 100644 index 6ca218c..0000000 --- a/docs/Recording file format.md +++ /dev/null @@ -1,343 +0,0 @@ -This is an official documentation for file format used by Vulkan Memory Allocator library -to record and replay sequence of calls to its functions. -This feature can be enabled by using `VmaAllocatorCreateInfo::pRecordSettings` structure members. -For details, see main documentation of the library. -Playback can be launched using **VmaReplay** console application. - -Recording is a text file. -Line endings: Unix `'\n'`. -Character encoding: single-byte (can be ASCII or UTF-8, whaterver you use in custom strings). -Suggested file extension: **csv**. File can be processed sequentially - no random access is needed. -Each line forms a separate entry. -Each line consists of a set of values (also called columns), separated by comma `','` (hence "CSV" format - Comma Separated Values). -Number of columns is different in different lines. - -# Header - -First line identifies file format. It must always be: - - Vulkan Memory Allocator,Calls recording - -Second line identifies format version, where first column is major version and second column is minor version. -Formats with only minor version incremented are backward compatible. -VmaReplay application supports all older versions. -Current version is: - - 1,8 - -# Configuration - -Header is followed by mandatory configuration section (min format version 1.3). It starts with line: - - Config,Begin - -And ends with line: - - Config,End - -Between them there can be zero or more lines with configuration options. They store values of various variables from the current environment from the time of recording, like properties and limits of Vulkan physical device, available memory heaps and types, enabled Vulkan extensions, as well macros that configure VMA internals. Supported configuration options are: - - VulkanApiVersion,<uint32>,<uint32> - - PhysicalDevice,apiVersion,<uint32> - PhysicalDevice,driverVersion,<uint32> - PhysicalDevice,vendorID,<uint32> - PhysicalDevice,deviceID,<uint32> - PhysicalDevice,deviceType,<uint32> - PhysicalDevice,deviceName,<string> - - PhysicalDeviceLimits,maxMemoryAllocationCount,<uint32> - PhysicalDeviceLimits,bufferImageGranularity,<uint64> - PhysicalDeviceLimits,nonCoherentAtomSize,<uint64> - - PhysicalDeviceMemory,HeapCount,<uint32> - PhysicalDeviceMemory,Heap,<index:uint32>,size,<uint64> - PhysicalDeviceMemory,Heap,<index:uint32>,flags,<uint32> - PhysicalDeviceMemory,TypeCount,<uint32> - PhysicalDeviceMemory,Type,<index:uint32>,heapIndex,<uint32> - PhysicalDeviceMemory,Type,<index:uint32>,propertyFlags,<uint32> - - Extension,VK_KHR_dedicated_allocation,<bool> - Extension,VK_KHR_bind_memory2,<bool> - Extension,VK_EXT_memory_budget,<bool> - Extension,VK_AMD_device_coherent_memory,<bool> - - Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,<bool> - Macro,VMA_DEBUG_ALIGNMENT,<uint64> - Macro,VMA_DEBUG_MARGIN,<uint64> - Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,<bool> - Macro,VMA_DEBUG_DETECT_CORRUPTION,<bool> - Macro,VMA_DEBUG_GLOBAL_MUTEX,<bool> - Macro,VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY,<uint64> - Macro,VMA_SMALL_HEAP_MAX_SIZE,<uint64> - Macro,VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE,<uint64> - -# Function calls - -Remaining lines contain recorded calls to VMA functions. First columns are always: - -- Thread ID : uint32 -- Time since first call : float, in seconds -- VMA frame index : uint32 -- Function name : string - -Remaining columns are function parameters and output, depending on function name, which can be: - -**vmaCreateAllocator, vmaDestroyAllocator** - -No parameters. - -**vmaCreatePool** - -- memoryTypeIndex : uint32 -- flags : uint32 -- blockSize : uint64 -- minBlockCount : uint64 -- maxBlockCount : uint64 -- frameInUseCount : uint32 -- pool (output) : pointer - -**vmaDestroyPool** - -- pool : pointer - -**vmaSetAllocationUserData** - -- allocation : pointer -- pUserData : string (may contain additional commas) - -**vmaCreateBuffer** - -- bufferCreateInfo.flags : uint32 -- bufferCreateInfo.size : uint64 -- bufferCreateInfo.usage : uint32 -- bufferCreateInfo.sharingMode : uint32 -- allocationCreateInfo.flags : uint32 -- allocationCreateInfo.usage : uint32 -- allocationCreateInfo.requiredFlags : uint32 -- allocationCreateInfo.preferredFlags : uint32 -- allocationCreateInfo.memoryTypeBits : uint32 -- allocationCreateInfo.pool : pointer -- allocation (output) : pointer -- allocationCreateInfo.pUserData : string (may contain additional commas) - -**vmaDestroyBuffer** - -- allocation : pointer - -**vmaCreateImage** - -- imageCreateInfo.flags : uint32 -- imageCreateInfo.imageType : uint32 -- imageCreateInfo.format : uint32 -- imageCreateInfo.extent.width : uint32 -- imageCreateInfo.extent.height : uint32 -- imageCreateInfo.extent.depth : uint32 -- imageCreateInfo.mipLevels : uint32 -- imageCreateInfo.arrayLayers : uint32 -- imageCreateInfo.samples : uint32 -- imageCreateInfo.tiling : uint32 -- imageCreateInfo.usage : uint32 -- imageCreateInfo.sharingMode : uint32 -- imageCreateInfo.initialLayout : uint32 -- allocationCreateInfo.flags : uint32 -- allocationCreateInfo.usage : uint32 -- allocationCreateInfo.requiredFlags : uint32 -- allocationCreateInfo.preferredFlags : uint32 -- allocationCreateInfo.memoryTypeBits : uint32 -- allocationCreateInfo.pool : pointer -- allocation (output) : pointer -- allocationCreateInfo.pUserData : string (may contain additional commas) - -**vmaDestroyImage** - -- allocation : pointer - -**vmaFreeMemory** (min format version 1.1) - -- allocation : pointer - -**vmaFreeMemoryPages** (min format version: 1.5) - -- allocations : list of pointers - -**vmaCreateLostAllocation** (min format version 1.2) - -- allocation (output) : pointer - -**vmaAllocateMemory** (min format version 1.2) - -- vkMemoryRequirements.size : uint64 -- vkMemoryRequirements.alignment : uint64 -- vkMemoryRequirements.memoryTypeBits : uint32 -- allocationCreateInfo.flags : uint32 -- allocationCreateInfo.usage : uint32 -- allocationCreateInfo.requiredFlags : uint32 -- allocationCreateInfo.preferredFlags : uint32 -- allocationCreateInfo.memoryTypeBits : uint32 -- allocationCreateInfo.pool : pointer -- allocation (output) : pointer -- allocationCreateInfo.pUserData : string (may contain additional commas) - -**vmaAllocateMemoryPages** (min format version 1.5) - -- vkMemoryRequirements.size : uint64 -- vkMemoryRequirements.alignment : uint64 -- vkMemoryRequirements.memoryTypeBits : uint32 -- allocationCreateInfo.flags : uint32 -- allocationCreateInfo.usage : uint32 -- allocationCreateInfo.requiredFlags : uint32 -- allocationCreateInfo.preferredFlags : uint32 -- allocationCreateInfo.memoryTypeBits : uint32 -- allocationCreateInfo.pool : pointer -- allocations (output) : list of pointers -- allocationCreateInfo.pUserData : string (may contain additional commas) - -**vmaAllocateMemoryForBuffer, vmaAllocateMemoryForImage** (min format version 1.2) - -- vkMemoryRequirements.size : uint64 -- vkMemoryRequirements.alignment : uint64 -- vkMemoryRequirements.memoryTypeBits : uint32 -- requiresDedicatedAllocation : bool -- prefersDedicatedAllocation : bool -- allocationCreateInfo.flags : uint32 -- allocationCreateInfo.usage : uint32 -- allocationCreateInfo.requiredFlags : uint32 -- allocationCreateInfo.preferredFlags : uint32 -- allocationCreateInfo.memoryTypeBits : uint32 -- allocationCreateInfo.pool : pointer -- allocation (output) : pointer -- allocationCreateInfo.pUserData : string (may contain additional commas) - -**vmaMapMemory, vmaUnmapMemory** (min format version 1.2) - -- allocation : pointer - -**vmaFlushAllocation, vmaInvalidateAllocation** (min format version 1.2) - -- allocation : pointer -- offset : uint64 -- size : uint64 - -**vmaTouchAllocation, vmaGetAllocationInfo** (min format version 1.2) - -- allocation : pointer - -**vmaMakePoolAllocationsLost** (min format version: 1.2) - -- pool : pointer - -**vmaResizeAllocation** (min format version: 1.4, max format version: 1.5) - -- allocation : pointer -- newSize : uint64 - -**vmaDefragmentationBegin** (min format version: 1.5) - -- defragmentationInfo2.flags : uint32 -- defragmentationInfo2.pAllocations : list of pointers -- defragmentationInfo2.pPools : list of pointers -- defragmentationInfo2.maxCpuBytesToMove : uint64 -- defragmentationInfo2.maxCpuAllocationsToMove : uint32 -- defragmentationInfo2.maxGpuBytesToMove : uint64 -- defragmentationInfo2.maxGpuAllocationsToMove : uint32 -- defragmentationInfo2.commandBuffer : pointer -- context (output) : pointer - -**vmaDefragmentationEnd** (min format version: 1.5) - -- context : pointer - -**vmaSetPoolName** (min format version: 1.7) - -- pool : pointer -- pName : string (may contain additional commas) - -# Data types - -**bool** - -Encoded as `0` for false or `1` for true. - -**uint32, uint64** - -Encoded in decimal format. - -**pointer** - -Encoded in hexadecimal format. - -**pUserData** - -If `pUserData` was a pointer, it is encoded as hexadecimal string. -If `VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT` was used with the allocation, the string is written as-is. -It may contain additional commas. -It should not contain end-of-line characters - results are then undefined. - -**list of (...)** (min format version: 1.5) - -An ordered sequence of values of some type, separated by single space. - -# Example file - - Vulkan Memory Allocator,Calls recording - 1,8 - Config,Begin - VulkanApiVersion,1,1 - PhysicalDevice,apiVersion,4198477 - PhysicalDevice,driverVersion,8388653 - PhysicalDevice,vendorID,4098 - PhysicalDevice,deviceID,26751 - PhysicalDevice,deviceType,2 - PhysicalDevice,deviceName,Radeon RX Vega - PhysicalDeviceLimits,maxMemoryAllocationCount,4096 - PhysicalDeviceLimits,bufferImageGranularity,1 - PhysicalDeviceLimits,nonCoherentAtomSize,128 - PhysicalDeviceMemory,HeapCount,3 - PhysicalDeviceMemory,Heap,0,size,8304721920 - PhysicalDeviceMemory,Heap,0,flags,3 - PhysicalDeviceMemory,Heap,1,size,8286175232 - PhysicalDeviceMemory,Heap,1,flags,0 - PhysicalDeviceMemory,Heap,2,size,268435456 - PhysicalDeviceMemory,Heap,2,flags,3 - PhysicalDeviceMemory,TypeCount,4 - PhysicalDeviceMemory,Type,0,heapIndex,0 - PhysicalDeviceMemory,Type,0,propertyFlags,1 - PhysicalDeviceMemory,Type,1,heapIndex,1 - PhysicalDeviceMemory,Type,1,propertyFlags,6 - PhysicalDeviceMemory,Type,2,heapIndex,2 - PhysicalDeviceMemory,Type,2,propertyFlags,7 - PhysicalDeviceMemory,Type,3,heapIndex,1 - PhysicalDeviceMemory,Type,3,propertyFlags,14 - Extension,VK_KHR_dedicated_allocation,1 - Extension,VK_KHR_bind_memory2,1 - Extension,VK_EXT_memory_budget,1 - Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,0 - Macro,VMA_DEBUG_ALIGNMENT,1 - Macro,VMA_DEBUG_MARGIN,0 - Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,0 - Macro,VMA_DEBUG_DETECT_CORRUPTION,0 - Macro,VMA_DEBUG_GLOBAL_MUTEX,0 - Macro,VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY,1 - Macro,VMA_SMALL_HEAP_MAX_SIZE,1073741824 - Macro,VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE,268435456 - Config,End - 12552,0.000,0,vmaCreateAllocator - 12552,0.010,0,vmaCreateImage,0,1,37,128,128,1,1,1,1,1,1,0,8,36,2,0,0,0,0000000000000000,000001D85B8B1A80, - 12552,0.010,0,vmaSetAllocationUserData,000001D85B8B1A80,Ala ma kota - 12552,0.015,0,vmaCreateImage,0,1,37,128,128,1,1,1,1,0,6,0,0,0,1,0,0,0,0000000000000000,000001D85B8B1620, - 12552,0.017,0,vmaDestroyImage,000001D85B8B1A80 - 12552,0.017,0,vmaCreateBuffer,0,768,1,0,4,2,0,0,0,0000000000000000,000001D85B8B19E0, - 12552,0.017,0,vmaCreateBuffer,0,768,130,0,0,1,0,0,0,0000000000000000,000001D85B8B1A80, - 12552,0.017,0,vmaCreateBuffer,0,60,1,0,4,2,0,0,0,0000000000000000,000001D85B8B1DA0, - 12552,0.017,0,vmaCreateBuffer,0,60,66,0,0,1,0,0,0,0000000000000000,000001D85B8B16C0, - 12552,0.017,0,vmaDestroyBuffer,000001D85B8B1DA0 - 12552,0.017,0,vmaDestroyBuffer,000001D85B8B19E0 - 12552,0.022,0,vmaCreateImage,0,1,126,1424,704,1,1,1,1,0,32,0,0,0,1,0,0,0,0000000000000000,000001D85B8B1EE0, - 12552,0.048,0,vmaDestroyImage,000001D85B8B1EE0 - 12552,0.053,0,vmaCreateImage,0,1,126,1424,704,1,1,1,1,0,32,0,0,0,1,0,0,0,0000000000000000,000001D85B8B1EE0, - 12552,0.662,0,vmaDestroyImage,000001D85B8B1EE0 - 12552,0.695,0,vmaDestroyImage,000001D85B8B1620 - 12552,0.695,0,vmaDestroyBuffer,000001D85B8B16C0 - 12552,0.695,0,vmaDestroyBuffer,000001D85B8B1A80 - 12552,0.695,0,vmaDestroyAllocator diff --git a/docs/html/allocation_annotation.html b/docs/html/allocation_annotation.html index 232c2db..237c388 100644 --- a/docs/html/allocation_annotation.html +++ b/docs/html/allocation_annotation.html @@ -84,19 +84,19 @@ Allocation user data</h1> <div class="line">VkBuffer buffer;</div> <div class="line"><a class="code hl_struct" href="struct_vma_allocation.html">VmaAllocation</a> allocation;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a>(allocator, &bufferInfo, &allocCreateInfo, &buffer, &allocation, <span class="keyword">nullptr</span>);</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1098</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_a8259e85c272683434f4abb4ddddffe19"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19">VmaAllocationCreateInfo::pUserData</a></div><div class="ttdeci">void * pUserData</div><div class="ttdoc">Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1137</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1106</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1014</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_a8259e85c272683434f4abb4ddddffe19"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19">VmaAllocationCreateInfo::pUserData</a></div><div class="ttdeci">void * pUserData</div><div class="ttdoc">Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1053</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1022</div></div> <div class="ttc" id="astruct_vma_allocation_html"><div class="ttname"><a href="struct_vma_allocation.html">VmaAllocation</a></div><div class="ttdoc">Represents single memory allocation.</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:458</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:434</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_ac72ee55598617e8eecca384e746bab51"><div class="ttname"><a href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a></div><div class="ttdeci">VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)</div></div> </div><!-- fragment --><p >The pointer may be later retrieved as <a class="el" href="struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13" title="Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...">VmaAllocationInfo::pUserData</a>:</p> <div class="fragment"><div class="line"><a class="code hl_struct" href="struct_vma_allocation_info.html">VmaAllocationInfo</a> allocInfo;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">vmaGetAllocationInfo</a>(allocator, allocation, &allocInfo);</div> <div class="line">MyBufferMetadata* pMetadata = (MyBufferMetadata*)allocInfo.<a class="code hl_variable" href="struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13">pUserData</a>;</div> -<div class="ttc" id="astruct_vma_allocation_info_html"><div class="ttname"><a href="struct_vma_allocation_info.html">VmaAllocationInfo</a></div><div class="ttdoc">Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1247</div></div> -<div class="ttc" id="astruct_vma_allocation_info_html_adc507656149c04de7ed95d0042ba2a13"><div class="ttname"><a href="struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13">VmaAllocationInfo::pUserData</a></div><div class="ttdeci">void * pUserData</div><div class="ttdoc">Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1296</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_a86dd08aba8633bfa4ad0df2e76481d8b"><div class="ttname"><a href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">vmaGetAllocationInfo</a></div><div class="ttdeci">void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)</div><div class="ttdoc">Returns current information about specified allocation and atomically marks it as used in current fra...</div></div> +<div class="ttc" id="astruct_vma_allocation_info_html"><div class="ttname"><a href="struct_vma_allocation_info.html">VmaAllocationInfo</a></div><div class="ttdoc">Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1142</div></div> +<div class="ttc" id="astruct_vma_allocation_info_html_adc507656149c04de7ed95d0042ba2a13"><div class="ttname"><a href="struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13">VmaAllocationInfo::pUserData</a></div><div class="ttdeci">void * pUserData</div><div class="ttdoc">Custom general-purpose pointer that was passed as VmaAllocationCreateInfo::pUserData or set using vma...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1189</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_a86dd08aba8633bfa4ad0df2e76481d8b"><div class="ttname"><a href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">vmaGetAllocationInfo</a></div><div class="ttdeci">void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)</div><div class="ttdoc">Returns current information about specified allocation.</div></div> </div><!-- fragment --><p >It can also be changed using function <a class="el" href="vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f" title="Sets pUserData in given allocation to new value.">vmaSetAllocationUserData()</a>.</p> <p >Values of (non-zero) allocations' <code>pUserData</code> are printed in JSON report created by <a class="el" href="vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0" title="Builds and returns statistics as a null-terminated string in JSON format.">vmaBuildStatsString()</a>, in hexadecimal form.</p> <h1><a class="anchor" id="allocation_names"></a> @@ -116,9 +116,9 @@ Allocation names</h1> <div class="line">VkImage image;</div> <div class="line"><a class="code hl_struct" href="struct_vma_allocation.html">VmaAllocation</a> allocation;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73">vmaCreateImage</a>(allocator, &imageInfo, &allocCreateInfo, &image, &allocation, <span class="keyword">nullptr</span>);</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_add09658ac14fe290ace25470ddd6d41b"><div class="ttname"><a href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo::flags</a></div><div class="ttdeci">VmaAllocationCreateFlags flags</div><div class="ttdoc">Use VmaAllocationCreateFlagBits enum.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1100</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_add09658ac14fe290ace25470ddd6d41b"><div class="ttname"><a href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo::flags</a></div><div class="ttdeci">VmaAllocationCreateFlags flags</div><div class="ttdoc">Use VmaAllocationCreateFlagBits enum.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1016</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a02a94f25679275851a53e82eacbcfc73"><div class="ttname"><a href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73">vmaCreateImage</a></div><div class="ttdeci">VkResult vmaCreateImage(VmaAllocator allocator, const VkImageCreateInfo *pImageCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkImage *pImage, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)</div><div class="ttdoc">Function similar to vmaCreateBuffer().</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520"><div class="ttname"><a href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520">VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:560</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520"><div class="ttname"><a href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520">VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:518</div></div> </div><!-- fragment --><p >The value of <code>pUserData</code> pointer of the allocation will be different than the one you passed when setting allocation's name - pointing to a buffer managed internally that holds copy of the string.</p> <div class="fragment"><div class="line"><a class="code hl_struct" href="struct_vma_allocation_info.html">VmaAllocationInfo</a> allocInfo;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">vmaGetAllocationInfo</a>(allocator, allocation, &allocInfo);</div> diff --git a/docs/html/annotated.html b/docs/html/annotated.html index 95eedc6..a60a1a2 100644 --- a/docs/html/annotated.html +++ b/docs/html/annotated.html @@ -69,7 +69,7 @@ $(function() { <table class="directory"> <tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_allocation.html" target="_self">VmaAllocation</a></td><td class="desc">Represents single memory allocation </td></tr> <tr id="row_1_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_allocation_create_info.html" target="_self">VmaAllocationCreateInfo</a></td><td class="desc"></td></tr> -<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_allocation_info.html" target="_self">VmaAllocationInfo</a></td><td class="desc">Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> </td></tr> +<tr id="row_2_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_allocation_info.html" target="_self">VmaAllocationInfo</a></td><td class="desc">Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a> </td></tr> <tr id="row_3_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_allocator.html" target="_self">VmaAllocator</a></td><td class="desc">Represents main object of this library initialized </td></tr> <tr id="row_4_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_allocator_create_info.html" target="_self">VmaAllocatorCreateInfo</a></td><td class="desc">Description of a Allocator to be created </td></tr> <tr id="row_5_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_allocator_info.html" target="_self">VmaAllocatorInfo</a></td><td class="desc">Information about existing <a class="el" href="struct_vma_allocator.html" title="Represents main object of this library initialized.">VmaAllocator</a> object </td></tr> @@ -84,14 +84,13 @@ $(function() { <tr id="row_14_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_pool.html" target="_self">VmaPool</a></td><td class="desc">Represents custom memory pool </td></tr> <tr id="row_15_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_pool_create_info.html" target="_self">VmaPoolCreateInfo</a></td><td class="desc">Describes parameter of created <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a> </td></tr> <tr id="row_16_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_pool_stats.html" target="_self">VmaPoolStats</a></td><td class="desc">Describes parameter of existing <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a> </td></tr> -<tr id="row_17_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_record_settings.html" target="_self">VmaRecordSettings</a></td><td class="desc">Parameters for recording calls to VMA functions. To be used in <a class="el" href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee" title="Parameters for recording of VMA calls. Can be null.">VmaAllocatorCreateInfo::pRecordSettings</a> </td></tr> -<tr id="row_18_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_stat_info.html" target="_self">VmaStatInfo</a></td><td class="desc">Calculated statistics of memory usage in entire allocator </td></tr> -<tr id="row_19_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_stats.html" target="_self">VmaStats</a></td><td class="desc">General statistics from current state of Allocator </td></tr> -<tr id="row_20_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_virtual_allocation_create_info.html" target="_self">VmaVirtualAllocationCreateInfo</a></td><td class="desc">Parameters of created virtual allocation to be passed to <a class="el" href="vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2" title="Allocates new virtual allocation inside given VmaVirtualBlock.">vmaVirtualAllocate()</a> </td></tr> -<tr id="row_21_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_virtual_allocation_info.html" target="_self">VmaVirtualAllocationInfo</a></td><td class="desc">Parameters of an existing virtual allocation, returned by <a class="el" href="vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e" title="Returns information about a specific virtual allocation within a virtual block, like its size and pUs...">vmaGetVirtualAllocationInfo()</a> </td></tr> -<tr id="row_22_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_virtual_block.html" target="_self">VmaVirtualBlock</a></td><td class="desc">Handle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory </td></tr> -<tr id="row_23_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_virtual_block_create_info.html" target="_self">VmaVirtualBlockCreateInfo</a></td><td class="desc">Parameters of created <a class="el" href="struct_vma_virtual_block.html" title="Handle to a virtual block object that allows to use core allocation algorithm without allocating any ...">VmaVirtualBlock</a> object to be passed to <a class="el" href="vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b" title="Creates new VmaVirtualBlock object.">vmaCreateVirtualBlock()</a> </td></tr> -<tr id="row_24_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_vulkan_functions.html" target="_self">VmaVulkanFunctions</a></td><td class="desc">Pointers to some Vulkan functions - a subset used by the library </td></tr> +<tr id="row_17_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_stat_info.html" target="_self">VmaStatInfo</a></td><td class="desc">Calculated statistics of memory usage in entire allocator </td></tr> +<tr id="row_18_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_stats.html" target="_self">VmaStats</a></td><td class="desc">General statistics from current state of Allocator </td></tr> +<tr id="row_19_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_virtual_allocation_create_info.html" target="_self">VmaVirtualAllocationCreateInfo</a></td><td class="desc">Parameters of created virtual allocation to be passed to <a class="el" href="vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2" title="Allocates new virtual allocation inside given VmaVirtualBlock.">vmaVirtualAllocate()</a> </td></tr> +<tr id="row_20_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_virtual_allocation_info.html" target="_self">VmaVirtualAllocationInfo</a></td><td class="desc">Parameters of an existing virtual allocation, returned by <a class="el" href="vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e" title="Returns information about a specific virtual allocation within a virtual block, like its size and pUs...">vmaGetVirtualAllocationInfo()</a> </td></tr> +<tr id="row_21_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_virtual_block.html" target="_self">VmaVirtualBlock</a></td><td class="desc">Handle to a virtual block object that allows to use core allocation algorithm without allocating any real GPU memory </td></tr> +<tr id="row_22_" class="even"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_virtual_block_create_info.html" target="_self">VmaVirtualBlockCreateInfo</a></td><td class="desc">Parameters of created <a class="el" href="struct_vma_virtual_block.html" title="Handle to a virtual block object that allows to use core allocation algorithm without allocating any ...">VmaVirtualBlock</a> object to be passed to <a class="el" href="vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b" title="Creates new VmaVirtualBlock object.">vmaCreateVirtualBlock()</a> </td></tr> +<tr id="row_23_"><td class="entry"><span style="width:16px;display:inline-block;"> </span><span class="icona"><span class="icon">C</span></span><a class="el" href="struct_vma_vulkan_functions.html" target="_self">VmaVulkanFunctions</a></td><td class="desc">Pointers to some Vulkan functions - a subset used by the library </td></tr> </table> </div><!-- directory --> </div><!-- contents --> diff --git a/docs/html/choosing_memory_type.html b/docs/html/choosing_memory_type.html index 5115ad4..a63e187 100644 --- a/docs/html/choosing_memory_type.html +++ b/docs/html/choosing_memory_type.html @@ -93,10 +93,10 @@ Usage</h1> <div class="line">VkBuffer buffer;</div> <div class="line"><a class="code hl_struct" href="struct_vma_allocation.html">VmaAllocation</a> allocation;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a>(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, <span class="keyword">nullptr</span>);</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1098</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1106</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1014</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1022</div></div> <div class="ttc" id="astruct_vma_allocation_html"><div class="ttname"><a href="struct_vma_allocation.html">VmaAllocation</a></div><div class="ttdoc">Represents single memory allocation.</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:458</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:434</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_ac72ee55598617e8eecca384e746bab51"><div class="ttname"><a href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a></div><div class="ttdeci">VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)</div></div> </div><!-- fragment --><h1><a class="anchor" id="choosing_memory_type_required_preferred_flags"></a> Required and preferred flags</h1> @@ -109,10 +109,10 @@ Required and preferred flags</h1> <div class="line">VkBuffer buffer;</div> <div class="line"><a class="code hl_struct" href="struct_vma_allocation.html">VmaAllocation</a> allocation;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a>(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, <span class="keyword">nullptr</span>);</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_a7fe8d81a1ad10b2a2faacacee5b15d6d"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d">VmaAllocationCreateInfo::preferredFlags</a></div><div class="ttdeci">VkMemoryPropertyFlags preferredFlags</div><div class="ttdoc">Flags that preferably should be set in a memory type chosen for an allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1116</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_a9166390303ff42d783305bc31c2b6b90"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90">VmaAllocationCreateInfo::requiredFlags</a></div><div class="ttdeci">VkMemoryPropertyFlags requiredFlags</div><div class="ttdoc">Flags that must be set in a Memory Type chosen for an allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1111</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_add09658ac14fe290ace25470ddd6d41b"><div class="ttname"><a href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo::flags</a></div><div class="ttdeci">VmaAllocationCreateFlags flags</div><div class="ttdoc">Use VmaAllocationCreateFlagBits enum.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1100</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f"><div class="ttname"><a href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">VMA_ALLOCATION_CREATE_MAPPED_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATION_CREATE_MAPPED_BIT</div><div class="ttdoc">Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:534</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_a7fe8d81a1ad10b2a2faacacee5b15d6d"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d">VmaAllocationCreateInfo::preferredFlags</a></div><div class="ttdeci">VkMemoryPropertyFlags preferredFlags</div><div class="ttdoc">Flags that preferably should be set in a memory type chosen for an allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1032</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_a9166390303ff42d783305bc31c2b6b90"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90">VmaAllocationCreateInfo::requiredFlags</a></div><div class="ttdeci">VkMemoryPropertyFlags requiredFlags</div><div class="ttdoc">Flags that must be set in a Memory Type chosen for an allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1027</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_add09658ac14fe290ace25470ddd6d41b"><div class="ttname"><a href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo::flags</a></div><div class="ttdeci">VmaAllocationCreateFlags flags</div><div class="ttdoc">Use VmaAllocationCreateFlagBits enum.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1016</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f"><div class="ttname"><a href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">VMA_ALLOCATION_CREATE_MAPPED_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATION_CREATE_MAPPED_BIT</div><div class="ttdoc">Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:508</div></div> </div><!-- fragment --><p >A memory type is chosen that has all the required flags and as many preferred flags set as possible.</p> <p >If you use <a class="el" href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910" title="Intended usage of memory.">VmaAllocationCreateInfo::usage</a>, it is just internally converted to a set of required and preferred flags.</p> <h1><a class="anchor" id="choosing_memory_type_explicit_memory_types"></a> @@ -127,7 +127,7 @@ Explicit memory types</h1> <div class="line">VkBuffer buffer;</div> <div class="line"><a class="code hl_struct" href="struct_vma_allocation.html">VmaAllocation</a> allocation;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a>(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, <span class="keyword">nullptr</span>);</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_a3bf940c0271d85d6ba32a4d820075055"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055">VmaAllocationCreateInfo::memoryTypeBits</a></div><div class="ttdeci">uint32_t memoryTypeBits</div><div class="ttdoc">Bitmask containing one bit set for every memory type acceptable for this allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1124</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_a3bf940c0271d85d6ba32a4d820075055"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055">VmaAllocationCreateInfo::memoryTypeBits</a></div><div class="ttdeci">uint32_t memoryTypeBits</div><div class="ttdoc">Bitmask containing one bit set for every memory type acceptable for this allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1040</div></div> </div><!-- fragment --><h1><a class="anchor" id="choosing_memory_type_custom_memory_pools"></a> Custom memory pools</h1> <p >If you allocate from custom memory pool, all the ways of specifying memory requirements described above are not applicable and the aforementioned members of <a class="el" href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a> 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 <a class="el" href="custom_memory_pools.html">Custom memory pools</a>.</p> diff --git a/docs/html/classes.html b/docs/html/classes.html index a768e5d..1a7d444 100644 --- a/docs/html/classes.html +++ b/docs/html/classes.html @@ -69,7 +69,7 @@ $(function() { <div class="classindex"> <dl class="classindex even"> <dt class="alphachar"><a id="letter_V" name="letter_V">V</a></dt> -<dd><a class="el" href="struct_vma_allocation.html">VmaAllocation</a></dd><dd><a class="el" href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></dd><dd><a class="el" href="struct_vma_allocation_info.html">VmaAllocationInfo</a></dd><dd><a class="el" href="struct_vma_allocator.html">VmaAllocator</a></dd><dd><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></dd><dd><a class="el" href="struct_vma_allocator_info.html">VmaAllocatorInfo</a></dd><dd><a class="el" href="struct_vma_budget.html">VmaBudget</a></dd><dd><a class="el" href="struct_vma_defragmentation_context.html">VmaDefragmentationContext</a></dd><dd><a class="el" href="struct_vma_defragmentation_info.html">VmaDefragmentationInfo</a></dd><dd><a class="el" href="struct_vma_defragmentation_info2.html">VmaDefragmentationInfo2</a></dd><dd><a class="el" href="struct_vma_defragmentation_pass_info.html">VmaDefragmentationPassInfo</a></dd><dd><a class="el" href="struct_vma_defragmentation_pass_move_info.html">VmaDefragmentationPassMoveInfo</a></dd><dd><a class="el" href="struct_vma_defragmentation_stats.html">VmaDefragmentationStats</a></dd><dd><a class="el" href="struct_vma_device_memory_callbacks.html">VmaDeviceMemoryCallbacks</a></dd><dd><a class="el" href="struct_vma_pool.html">VmaPool</a></dd><dd><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></dd><dd><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a></dd><dd><a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a></dd><dd><a class="el" href="struct_vma_stat_info.html">VmaStatInfo</a></dd><dd><a class="el" href="struct_vma_stats.html">VmaStats</a></dd><dd><a class="el" href="struct_vma_virtual_allocation_create_info.html">VmaVirtualAllocationCreateInfo</a></dd><dd><a class="el" href="struct_vma_virtual_allocation_info.html">VmaVirtualAllocationInfo</a></dd><dd><a class="el" href="struct_vma_virtual_block.html">VmaVirtualBlock</a></dd><dd><a class="el" href="struct_vma_virtual_block_create_info.html">VmaVirtualBlockCreateInfo</a></dd><dd><a class="el" href="struct_vma_vulkan_functions.html">VmaVulkanFunctions</a></dd></dl> +<dd><a class="el" href="struct_vma_allocation.html">VmaAllocation</a></dd><dd><a class="el" href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></dd><dd><a class="el" href="struct_vma_allocation_info.html">VmaAllocationInfo</a></dd><dd><a class="el" href="struct_vma_allocator.html">VmaAllocator</a></dd><dd><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></dd><dd><a class="el" href="struct_vma_allocator_info.html">VmaAllocatorInfo</a></dd><dd><a class="el" href="struct_vma_budget.html">VmaBudget</a></dd><dd><a class="el" href="struct_vma_defragmentation_context.html">VmaDefragmentationContext</a></dd><dd><a class="el" href="struct_vma_defragmentation_info.html">VmaDefragmentationInfo</a></dd><dd><a class="el" href="struct_vma_defragmentation_info2.html">VmaDefragmentationInfo2</a></dd><dd><a class="el" href="struct_vma_defragmentation_pass_info.html">VmaDefragmentationPassInfo</a></dd><dd><a class="el" href="struct_vma_defragmentation_pass_move_info.html">VmaDefragmentationPassMoveInfo</a></dd><dd><a class="el" href="struct_vma_defragmentation_stats.html">VmaDefragmentationStats</a></dd><dd><a class="el" href="struct_vma_device_memory_callbacks.html">VmaDeviceMemoryCallbacks</a></dd><dd><a class="el" href="struct_vma_pool.html">VmaPool</a></dd><dd><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></dd><dd><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a></dd><dd><a class="el" href="struct_vma_stat_info.html">VmaStatInfo</a></dd><dd><a class="el" href="struct_vma_stats.html">VmaStats</a></dd><dd><a class="el" href="struct_vma_virtual_allocation_create_info.html">VmaVirtualAllocationCreateInfo</a></dd><dd><a class="el" href="struct_vma_virtual_allocation_info.html">VmaVirtualAllocationInfo</a></dd><dd><a class="el" href="struct_vma_virtual_block.html">VmaVirtualBlock</a></dd><dd><a class="el" href="struct_vma_virtual_block_create_info.html">VmaVirtualBlockCreateInfo</a></dd><dd><a class="el" href="struct_vma_vulkan_functions.html">VmaVulkanFunctions</a></dd></dl> </div> </div><!-- contents --> <!-- start footer part --> diff --git a/docs/html/custom_memory_pools.html b/docs/html/custom_memory_pools.html index 22b602d..7e31861 100644 --- a/docs/html/custom_memory_pools.html +++ b/docs/html/custom_memory_pools.html @@ -106,13 +106,13 @@ $(function() { <div class="line"><a class="code hl_struct" href="struct_vma_allocation.html">VmaAllocation</a> alloc;</div> <div class="line"><a class="code hl_struct" href="struct_vma_allocation_info.html">VmaAllocationInfo</a> allocInfo;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a>(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1098</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_a6272c0555cfd1fe28bff1afeb6190150"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150">VmaAllocationCreateInfo::pool</a></div><div class="ttdeci">VmaPool pool</div><div class="ttdoc">Pool that this allocation should be created in.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1130</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1014</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_a6272c0555cfd1fe28bff1afeb6190150"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150">VmaAllocationCreateInfo::pool</a></div><div class="ttdeci">VmaPool pool</div><div class="ttdoc">Pool that this allocation should be created in.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1046</div></div> <div class="ttc" id="astruct_vma_allocation_html"><div class="ttname"><a href="struct_vma_allocation.html">VmaAllocation</a></div><div class="ttdoc">Represents single memory allocation.</div></div> -<div class="ttc" id="astruct_vma_allocation_info_html"><div class="ttname"><a href="struct_vma_allocation_info.html">VmaAllocationInfo</a></div><div class="ttdoc">Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1247</div></div> -<div class="ttc" id="astruct_vma_pool_create_info_html"><div class="ttname"><a href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></div><div class="ttdoc">Describes parameter of created VmaPool.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1149</div></div> -<div class="ttc" id="astruct_vma_pool_create_info_html_a596fa76b685d3f1f688f84a709a5b319"><div class="ttname"><a href="struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319">VmaPoolCreateInfo::memoryTypeIndex</a></div><div class="ttdeci">uint32_t memoryTypeIndex</div><div class="ttdoc">Vulkan memory type index to allocate this pool from.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1152</div></div> -<div class="ttc" id="astruct_vma_pool_create_info_html_ae41142f2834fcdc82baa4883c187b75c"><div class="ttname"><a href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c">VmaPoolCreateInfo::maxBlockCount</a></div><div class="ttdeci">size_t maxBlockCount</div><div class="ttdoc">Maximum number of blocks that can be allocated in this pool. Optional.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1178</div></div> +<div class="ttc" id="astruct_vma_allocation_info_html"><div class="ttname"><a href="struct_vma_allocation_info.html">VmaAllocationInfo</a></div><div class="ttdoc">Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1142</div></div> +<div class="ttc" id="astruct_vma_pool_create_info_html"><div class="ttname"><a href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></div><div class="ttdoc">Describes parameter of created VmaPool.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1065</div></div> +<div class="ttc" id="astruct_vma_pool_create_info_html_a596fa76b685d3f1f688f84a709a5b319"><div class="ttname"><a href="struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319">VmaPoolCreateInfo::memoryTypeIndex</a></div><div class="ttdeci">uint32_t memoryTypeIndex</div><div class="ttdoc">Vulkan memory type index to allocate this pool from.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1068</div></div> +<div class="ttc" id="astruct_vma_pool_create_info_html_ae41142f2834fcdc82baa4883c187b75c"><div class="ttname"><a href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c">VmaPoolCreateInfo::maxBlockCount</a></div><div class="ttdeci">size_t maxBlockCount</div><div class="ttdoc">Maximum number of blocks that can be allocated in this pool. Optional.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1094</div></div> <div class="ttc" id="astruct_vma_pool_html"><div class="ttname"><a href="struct_vma_pool.html">VmaPool</a></div><div class="ttdoc">Represents custom memory pool.</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a5c8770ded7c59c8caac6de0c2cb00b50"><div class="ttname"><a href="vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50">vmaCreatePool</a></div><div class="ttdeci">VkResult vmaCreatePool(VmaAllocator allocator, const VmaPoolCreateInfo *pCreateInfo, VmaPool *pPool)</div><div class="ttdoc">Allocates Vulkan device memory and creates VmaPool object.</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_ac72ee55598617e8eecca384e746bab51"><div class="ttname"><a href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a></div><div class="ttdeci">VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)</div></div> @@ -138,8 +138,8 @@ Choosing memory type index</h1> <div class="line"><a class="code hl_struct" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a> poolCreateInfo = {};</div> <div class="line">poolCreateInfo.<a class="code hl_variable" href="struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319">memoryTypeIndex</a> = memTypeIndex;</div> <div class="line"><span class="comment">// ...</span></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1106</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:458</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1022</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:434</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_ae790ab9ffaf7667fb8f62523e6897888"><div class="ttname"><a href="vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888">vmaFindMemoryTypeIndexForBufferInfo</a></div><div class="ttdeci">VkResult vmaFindMemoryTypeIndexForBufferInfo(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, uint32_t *pMemoryTypeIndex)</div><div class="ttdoc">Helps to find memoryTypeIndex, given VkBufferCreateInfo and VmaAllocationCreateInfo.</div></div> </div><!-- fragment --><p >When creating buffers/images allocated in that pool, provide following parameters:</p> <ul> @@ -178,8 +178,6 @@ Double stack</h2> Ring buffer</h2> <p >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.</p> <p ><img src="../gfx/Linear_allocator_5_ring_buffer.png" alt="Ring buffer" class="inline"/></p> -<p >Pools with linear algorithm support <a class="el" href="lost_allocations.html">lost allocations</a> when used as ring buffer. If there is not enough free space for a new allocation, but existing allocations from the front of the queue can become lost, they become lost and the allocation succeeds.</p> -<p ><img src="../gfx/Linear_allocator_6_ring_buffer_lost.png" alt="Ring buffer with lost allocations" class="inline"/></p> <p >Ring buffer is available only in pools with one memory block - <a class="el" href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c" title="Maximum number of blocks that can be allocated in this pool. Optional.">VmaPoolCreateInfo::maxBlockCount</a> must be 1. Otherwise behavior is undefined.</p> <h1><a class="anchor" id="buddy_algorithm"></a> Buddy allocation algorithm</h1> @@ -191,7 +189,6 @@ Buddy allocation algorithm</h1> <ul> <li>It is recommended to use <a class="el" href="struct_vma_pool_create_info.html#aa4265160536cdb9be821b7686c16c676" title="Size of a single VkDeviceMemory block to be allocated as part of this pool, in bytes....">VmaPoolCreateInfo::blockSize</a> that is a power of two. Otherwise, only largest power of two smaller than the size is used for allocations. The remaining space always stays unused.</li> <li><a class="el" href="debugging_memory_usage.html#debugging_memory_usage_margins">Margins</a> and <a class="el" href="debugging_memory_usage.html#debugging_memory_usage_corruption_detection">corruption detection</a> don't work in such pools.</li> -<li><a class="el" href="lost_allocations.html">Lost allocations</a> don't work in such pools. You can use them, but they never become lost. Support may be added in the future.</li> <li><a class="el" href="defragmentation.html">Defragmentation</a> doesn't work with allocations made from such pool. </li> </ul> </div></div><!-- contents --> diff --git a/docs/html/debugging_memory_usage.html b/docs/html/debugging_memory_usage.html index 6c6b739..da8ef43 100644 --- a/docs/html/debugging_memory_usage.html +++ b/docs/html/debugging_memory_usage.html @@ -77,7 +77,7 @@ Memory initialization</h1> <div class="line"><span class="preprocessor">#include "vk_mem_alloc.h"</span></div> </div><!-- fragment --><p >It makes memory of all new allocations initialized to bit pattern <code>0xDCDCDCDC</code>. Before an allocation is destroyed, its memory is filled with bit pattern <code>0xEFEFEFEF</code>. Memory is automatically mapped and unmapped if necessary.</p> <p >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.</p> -<p >Memory initialization works only with memory types that are <code>HOST_VISIBLE</code>. It works also with dedicated allocations. It doesn't work with allocations created with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a> flag, as they cannot be mapped.</p> +<p >Memory initialization works only with memory types that are <code>HOST_VISIBLE</code>. It works also with dedicated allocations.</p> <h1><a class="anchor" id="debugging_memory_usage_margins"></a> Margins</h1> <p >By default, allocations are laid out in memory blocks next to each other if possible (considering required alignment, <code>bufferImageGranularity</code>, and <code>nonCoherentAtomSize</code>).</p> diff --git a/docs/html/defragmentation.html b/docs/html/defragmentation.html index e87e1f6..3db8b4f 100644 --- a/docs/html/defragmentation.html +++ b/docs/html/defragmentation.html @@ -73,7 +73,7 @@ $(function() { <p >To mitigate this problem, you can use defragmentation feature: structure <a class="el" href="struct_vma_defragmentation_info2.html" title="Parameters for defragmentation.">VmaDefragmentationInfo2</a>, function <a class="el" href="vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a" title="Begins defragmentation process.">vmaDefragmentationBegin()</a>, <a class="el" href="vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2" title="Ends defragmentation process.">vmaDefragmentationEnd()</a>. Given set of allocations, this function can move them to compact used memory, ensure more continuous free space and possibly also free some <code>VkDeviceMemory</code> blocks.</p> <p >What the defragmentation does is:</p> <ul> -<li>Updates <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects to point to new <code>VkDeviceMemory</code> and offset. After allocation has been moved, its <a class="el" href="struct_vma_allocation_info.html#ae0bfb7dfdf79a76ffefc9a94677a2f67" title="Handle to Vulkan memory object.">VmaAllocationInfo::deviceMemory</a> and/or <a class="el" href="struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268" title="Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory,...">VmaAllocationInfo::offset</a> changes. You must query them again using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> if you need them.</li> +<li>Updates <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects to point to new <code>VkDeviceMemory</code> and offset. After allocation has been moved, its <a class="el" href="struct_vma_allocation_info.html#ae0bfb7dfdf79a76ffefc9a94677a2f67" title="Handle to Vulkan memory object.">VmaAllocationInfo::deviceMemory</a> and/or <a class="el" href="struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268" title="Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory,...">VmaAllocationInfo::offset</a> changes. You must query them again using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a> if you need them.</li> <li>Moves actual data in memory.</li> </ul> <p >What it doesn't do, so you need to do it yourself:</p> @@ -129,20 +129,20 @@ Defragmenting CPU memory</h1> <div class="line"> <a class="code hl_function" href="vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470">vmaBindBufferMemory</a>(allocator, allocations[i], buffers[i]);</div> <div class="line"> }</div> <div class="line">}</div> -<div class="ttc" id="astruct_vma_allocation_info_html"><div class="ttname"><a href="struct_vma_allocation_info.html">VmaAllocationInfo</a></div><div class="ttdoc">Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1247</div></div> +<div class="ttc" id="astruct_vma_allocation_info_html"><div class="ttname"><a href="struct_vma_allocation_info.html">VmaAllocationInfo</a></div><div class="ttdoc">Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1142</div></div> <div class="ttc" id="astruct_vma_allocator_html"><div class="ttname"><a href="struct_vma_allocator.html">VmaAllocator</a></div><div class="ttdoc">Represents main object of this library initialized.</div></div> <div class="ttc" id="astruct_vma_defragmentation_context_html"><div class="ttname"><a href="struct_vma_defragmentation_context.html">VmaDefragmentationContext</a></div><div class="ttdoc">Represents Opaque object that represents started defragmentation process.</div></div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html"><div class="ttname"><a href="struct_vma_defragmentation_info2.html">VmaDefragmentationInfo2</a></div><div class="ttdoc">Parameters for defragmentation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1304</div></div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html_a3cf86ab32c1da779b4923d301a3056ba"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a3cf86ab32c1da779b4923d301a3056ba">VmaDefragmentationInfo2::allocationCount</a></div><div class="ttdeci">uint32_t allocationCount</div><div class="ttdoc">Number of allocations in pAllocations array.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1310</div></div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html_a76d51a644dc7f5405d0cdd0025ecd0cc"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc">VmaDefragmentationInfo2::pAllocationsChanged</a></div><div class="ttdeci">VkBool32 * pAllocationsChanged</div><div class="ttdoc">Optional, output. Pointer to array that will be filled with information whether the allocation at cer...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1325</div></div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html_a94c2c7223d52878445a8cccce396b671"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a94c2c7223d52878445a8cccce396b671">VmaDefragmentationInfo2::maxCpuAllocationsToMove</a></div><div class="ttdeci">uint32_t maxCpuAllocationsToMove</div><div class="ttdoc">Maximum number of allocations that can be moved to a different place using transfers on CPU side,...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1354</div></div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html_ab6d288f29d028156cf73542d630a2e32"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32">VmaDefragmentationInfo2::pAllocations</a></div><div class="ttdeci">const VmaAllocation * pAllocations</div><div class="ttdoc">Pointer to array of allocations that can be defragmented.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1319</div></div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html_af78e1ea40c22d85137b65f6b384a4d0a"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#af78e1ea40c22d85137b65f6b384a4d0a">VmaDefragmentationInfo2::maxCpuBytesToMove</a></div><div class="ttdeci">VkDeviceSize maxCpuBytesToMove</div><div class="ttdoc">Maximum total numbers of bytes that can be copied while moving allocations to different places using ...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1349</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html"><div class="ttname"><a href="struct_vma_defragmentation_info2.html">VmaDefragmentationInfo2</a></div><div class="ttdoc">Parameters for defragmentation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1197</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html_a3cf86ab32c1da779b4923d301a3056ba"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a3cf86ab32c1da779b4923d301a3056ba">VmaDefragmentationInfo2::allocationCount</a></div><div class="ttdeci">uint32_t allocationCount</div><div class="ttdoc">Number of allocations in pAllocations array.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1203</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html_a76d51a644dc7f5405d0cdd0025ecd0cc"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc">VmaDefragmentationInfo2::pAllocationsChanged</a></div><div class="ttdeci">VkBool32 * pAllocationsChanged</div><div class="ttdoc">Optional, output. Pointer to array that will be filled with information whether the allocation at cer...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1217</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html_a94c2c7223d52878445a8cccce396b671"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a94c2c7223d52878445a8cccce396b671">VmaDefragmentationInfo2::maxCpuAllocationsToMove</a></div><div class="ttdeci">uint32_t maxCpuAllocationsToMove</div><div class="ttdoc">Maximum number of allocations that can be moved to a different place using transfers on CPU side,...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1246</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html_ab6d288f29d028156cf73542d630a2e32"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32">VmaDefragmentationInfo2::pAllocations</a></div><div class="ttdeci">const VmaAllocation * pAllocations</div><div class="ttdoc">Pointer to array of allocations that can be defragmented.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1211</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html_af78e1ea40c22d85137b65f6b384a4d0a"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#af78e1ea40c22d85137b65f6b384a4d0a">VmaDefragmentationInfo2::maxCpuBytesToMove</a></div><div class="ttdeci">VkDeviceSize maxCpuBytesToMove</div><div class="ttdoc">Maximum total numbers of bytes that can be copied while moving allocations to different places using ...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1241</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a36ba776fd7fd5cb1e9359fdc0d8e6e8a"><div class="ttname"><a href="vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a">vmaDefragmentationBegin</a></div><div class="ttdeci">VkResult vmaDefragmentationBegin(VmaAllocator allocator, const VmaDefragmentationInfo2 *pInfo, VmaDefragmentationStats *pStats, VmaDefragmentationContext *pContext)</div><div class="ttdoc">Begins defragmentation process.</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a6b0929b914b60cf2d45cac4bf3547470"><div class="ttname"><a href="vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470">vmaBindBufferMemory</a></div><div class="ttdeci">VkResult vmaBindBufferMemory(VmaAllocator allocator, VmaAllocation allocation, VkBuffer buffer)</div><div class="ttdoc">Binds buffer to allocation.</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_a86dd08aba8633bfa4ad0df2e76481d8b"><div class="ttname"><a href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">vmaGetAllocationInfo</a></div><div class="ttdeci">void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)</div><div class="ttdoc">Returns current information about specified allocation and atomically marks it as used in current fra...</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_a86dd08aba8633bfa4ad0df2e76481d8b"><div class="ttname"><a href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">vmaGetAllocationInfo</a></div><div class="ttdeci">void vmaGetAllocationInfo(VmaAllocator allocator, VmaAllocation allocation, VmaAllocationInfo *pAllocationInfo)</div><div class="ttdoc">Returns current information about specified allocation.</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a8774e20e91e245aae959ba63efa15dd2"><div class="ttname"><a href="vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2">vmaDefragmentationEnd</a></div><div class="ttdeci">VkResult vmaDefragmentationEnd(VmaAllocator allocator, VmaDefragmentationContext context)</div><div class="ttdoc">Ends defragmentation process.</div></div> -</div><!-- fragment --><p >Setting <a class="el" href="struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc" title="Optional, output. Pointer to array that will be filled with information whether the allocation at cer...">VmaDefragmentationInfo2::pAllocationsChanged</a> is optional. This output array tells whether particular allocation in <a class="el" href="struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32" title="Pointer to array of allocations that can be defragmented.">VmaDefragmentationInfo2::pAllocations</a> at the same index has been modified during defragmentation. You can pass null, but you then need to query every allocation passed to defragmentation for new parameters using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> if you might need to recreate and rebind a buffer or image associated with it.</p> +</div><!-- fragment --><p >Setting <a class="el" href="struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc" title="Optional, output. Pointer to array that will be filled with information whether the allocation at cer...">VmaDefragmentationInfo2::pAllocationsChanged</a> is optional. This output array tells whether particular allocation in <a class="el" href="struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32" title="Pointer to array of allocations that can be defragmented.">VmaDefragmentationInfo2::pAllocations</a> at the same index has been modified during defragmentation. You can pass null, but you then need to query every allocation passed to defragmentation for new parameters using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a> if you might need to recreate and rebind a buffer or image associated with it.</p> <p >If you use <a class="el" href="choosing_memory_type.html#choosing_memory_type_custom_memory_pools">Custom memory pools</a>, you can fill <a class="el" href="struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d" title="Numer of pools in pPools array.">VmaDefragmentationInfo2::poolCount</a> and <a class="el" href="struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b" title="Either null or pointer to array of pools to be defragmented.">VmaDefragmentationInfo2::pPools</a> instead of <a class="el" href="struct_vma_defragmentation_info2.html#a3cf86ab32c1da779b4923d301a3056ba" title="Number of allocations in pAllocations array.">VmaDefragmentationInfo2::allocationCount</a> and <a class="el" href="struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32" title="Pointer to array of allocations that can be defragmented.">VmaDefragmentationInfo2::pAllocations</a> to defragment all allocations in given pools. You cannot use <a class="el" href="struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc" title="Optional, output. Pointer to array that will be filled with information whether the allocation at cer...">VmaDefragmentationInfo2::pAllocationsChanged</a> in that case. You can also combine both methods.</p> <h1><a class="anchor" id="defragmentation_gpu"></a> Defragmenting GPU memory</h1> @@ -203,9 +203,9 @@ Defragmenting GPU memory</h1> <div class="line"> <a class="code hl_function" href="vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470">vmaBindBufferMemory</a>(allocator, allocations[i], buffers[i]);</div> <div class="line"> }</div> <div class="line">}</div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html_a40d53d33e71ba0b66f844ed63c05a3f6"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a40d53d33e71ba0b66f844ed63c05a3f6">VmaDefragmentationInfo2::maxGpuAllocationsToMove</a></div><div class="ttdeci">uint32_t maxGpuAllocationsToMove</div><div class="ttdoc">Maximum number of allocations that can be moved to a different place using transfers on GPU side,...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1364</div></div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html_a4ddbc898d0afe1518f863a3763628f08"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a4ddbc898d0afe1518f863a3763628f08">VmaDefragmentationInfo2::maxGpuBytesToMove</a></div><div class="ttdeci">VkDeviceSize maxGpuBytesToMove</div><div class="ttdoc">Maximum total numbers of bytes that can be copied while moving allocations to different places using ...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1359</div></div> -<div class="ttc" id="astruct_vma_defragmentation_info2_html_a7f71f39590c5316771493d2333f9c1bd"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a7f71f39590c5316771493d2333f9c1bd">VmaDefragmentationInfo2::commandBuffer</a></div><div class="ttdeci">VkCommandBuffer commandBuffer</div><div class="ttdoc">Optional. Command buffer where GPU copy commands will be posted.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1373</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html_a40d53d33e71ba0b66f844ed63c05a3f6"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a40d53d33e71ba0b66f844ed63c05a3f6">VmaDefragmentationInfo2::maxGpuAllocationsToMove</a></div><div class="ttdeci">uint32_t maxGpuAllocationsToMove</div><div class="ttdoc">Maximum number of allocations that can be moved to a different place using transfers on GPU side,...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1256</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html_a4ddbc898d0afe1518f863a3763628f08"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a4ddbc898d0afe1518f863a3763628f08">VmaDefragmentationInfo2::maxGpuBytesToMove</a></div><div class="ttdeci">VkDeviceSize maxGpuBytesToMove</div><div class="ttdoc">Maximum total numbers of bytes that can be copied while moving allocations to different places using ...</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1251</div></div> +<div class="ttc" id="astruct_vma_defragmentation_info2_html_a7f71f39590c5316771493d2333f9c1bd"><div class="ttname"><a href="struct_vma_defragmentation_info2.html#a7f71f39590c5316771493d2333f9c1bd">VmaDefragmentationInfo2::commandBuffer</a></div><div class="ttdeci">VkCommandBuffer commandBuffer</div><div class="ttdoc">Optional. Command buffer where GPU copy commands will be posted.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1265</div></div> </div><!-- fragment --><p >You can combine these two methods by specifying non-zero <code>maxGpu*</code> as well as <code>maxCpu*</code> parameters. The library automatically chooses best method to defragment each memory pool.</p> <p >You may try not to block your entire program to wait until defragmentation finishes, but do it in the background, as long as you carefully fullfill requirements described in function <a class="el" href="vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a" title="Begins defragmentation process.">vmaDefragmentationBegin()</a>.</p> <h1><a class="anchor" id="defragmentation_additional_notes"></a> diff --git a/docs/html/deprecated.html b/docs/html/deprecated.html index 0d266db..8990531 100644 --- a/docs/html/deprecated.html +++ b/docs/html/deprecated.html @@ -66,6 +66,10 @@ $(function() { </div><!--header--> <div class="contents"> <div class="textblock"><dl class="reflist"> +<dt>Member <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad7e8035e8edecd8dfa1f32a194bdf103">VMA_ALLOCATION_CREATE_RESERVED_1_BIT</a> </dt> +<dd><a class="anchor" id="_deprecated000003"></a>Removed. Do not use. </dd> +<dt>Member <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae9290dbcf5817e7616d5802e2aa251e7">VMA_ALLOCATION_CREATE_RESERVED_2_BIT</a> </dt> +<dd><a class="anchor" id="_deprecated000004"></a>Removed. Do not use. </dd> <dt>Member <a class="el" href="vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac">vmaDefragment</a> (<a class="el" href="struct_vma_allocator.html" title="Represents main object of this library initialized.">VmaAllocator</a> allocator, const <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> *pAllocations, size_t allocationCount, VkBool32 *pAllocationsChanged, const <a class="el" href="struct_vma_defragmentation_info.html" title="Deprecated. Optional configuration parameters to be passed to function vmaDefragment().">VmaDefragmentationInfo</a> *pDefragmentationInfo, <a class="el" href="struct_vma_defragmentation_stats.html" title="Statistics returned by function vmaDefragment().">VmaDefragmentationStats</a> *pDefragmentationStats)</dt> <dd><a class="anchor" id="_deprecated000002"></a>This is a part of the old interface. It is recommended to use structure <a class="el" href="struct_vma_defragmentation_info2.html" title="Parameters for defragmentation.">VmaDefragmentationInfo2</a> and function <a class="el" href="vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a" title="Begins defragmentation process.">vmaDefragmentationBegin()</a> instead. </dd> <dt>Member <a class="el" href="vk__mem__alloc_8h.html#a2bf47f96bf92bed2a49461bd9af3acfa">VmaDefragmentationInfo</a> </dt> diff --git a/docs/html/functions.html b/docs/html/functions.html index ae89598..003c3ad 100644 --- a/docs/html/functions.html +++ b/docs/html/functions.html @@ -99,8 +99,7 @@ $(function() { <h3><a id="index_f" name="index_f"></a>- f -</h3><ul> -<li>flags : <a class="el" href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo</a>, <a class="el" href="struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346">VmaAllocatorCreateInfo</a>, <a class="el" href="struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9">VmaDefragmentationInfo2</a>, <a class="el" href="struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446">VmaPoolCreateInfo</a>, <a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a">VmaRecordSettings</a>, <a class="el" href="struct_vma_virtual_allocation_create_info.html#ab10e16956cc4bf20ced9de77d1129ea4">VmaVirtualAllocationCreateInfo</a>, <a class="el" href="struct_vma_virtual_block_create_info.html#a5838b15c053a0370420e4e1d82d09c09">VmaVirtualBlockCreateInfo</a></li> -<li>frameInUseCount : <a class="el" href="struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7">VmaAllocatorCreateInfo</a>, <a class="el" href="struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa">VmaPoolCreateInfo</a></li> +<li>flags : <a class="el" href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo</a>, <a class="el" href="struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346">VmaAllocatorCreateInfo</a>, <a class="el" href="struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9">VmaDefragmentationInfo2</a>, <a class="el" href="struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446">VmaPoolCreateInfo</a>, <a class="el" href="struct_vma_virtual_allocation_create_info.html#ab10e16956cc4bf20ced9de77d1129ea4">VmaVirtualAllocationCreateInfo</a>, <a class="el" href="struct_vma_virtual_block_create_info.html#a5838b15c053a0370420e4e1d82d09c09">VmaVirtualBlockCreateInfo</a></li> </ul> @@ -138,7 +137,6 @@ $(function() { <li>pAllocations : <a class="el" href="struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32">VmaDefragmentationInfo2</a></li> <li>pAllocationsChanged : <a class="el" href="struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc">VmaDefragmentationInfo2</a></li> <li>pDeviceMemoryCallbacks : <a class="el" href="struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e">VmaAllocatorCreateInfo</a></li> -<li>pFilePath : <a class="el" href="struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d">VmaRecordSettings</a></li> <li>pfnAllocate : <a class="el" href="struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb">VmaDeviceMemoryCallbacks</a></li> <li>pfnFree : <a class="el" href="struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c">VmaDeviceMemoryCallbacks</a></li> <li>pHeapSizeLimit : <a class="el" href="struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b">VmaAllocatorCreateInfo</a></li> @@ -149,7 +147,6 @@ $(function() { <li>pool : <a class="el" href="struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150">VmaAllocationCreateInfo</a></li> <li>poolCount : <a class="el" href="struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d">VmaDefragmentationInfo2</a></li> <li>pPools : <a class="el" href="struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b">VmaDefragmentationInfo2</a></li> -<li>pRecordSettings : <a class="el" href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee">VmaAllocatorCreateInfo</a></li> <li>preferredFlags : <a class="el" href="struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d">VmaAllocationCreateInfo</a></li> <li>preferredLargeHeapBlockSize : <a class="el" href="struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a">VmaAllocatorCreateInfo</a></li> <li>priority : <a class="el" href="struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7">VmaAllocationCreateInfo</a>, <a class="el" href="struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274">VmaPoolCreateInfo</a></li> @@ -178,7 +175,7 @@ $(function() { <li>unusedBytes : <a class="el" href="struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669">VmaStatInfo</a></li> <li>unusedRangeCount : <a class="el" href="struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4">VmaPoolStats</a>, <a class="el" href="struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9">VmaStatInfo</a></li> <li>unusedRangeSizeAvg : <a class="el" href="struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc">VmaStatInfo</a></li> -<li>unusedRangeSizeMax : <a class="el" href="struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b">VmaPoolStats</a>, <a class="el" href="struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4">VmaStatInfo</a></li> +<li>unusedRangeSizeMax : <a class="el" href="struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4">VmaStatInfo</a></li> <li>unusedRangeSizeMin : <a class="el" href="struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4">VmaStatInfo</a></li> <li>unusedSize : <a class="el" href="struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8">VmaPoolStats</a></li> <li>usage : <a class="el" href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo</a>, <a class="el" href="struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6">VmaBudget</a></li> diff --git a/docs/html/functions_vars.html b/docs/html/functions_vars.html index c1cac30..292254b 100644 --- a/docs/html/functions_vars.html +++ b/docs/html/functions_vars.html @@ -99,8 +99,7 @@ $(function() { <h3><a id="index_f" name="index_f"></a>- f -</h3><ul> -<li>flags : <a class="el" href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo</a>, <a class="el" href="struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346">VmaAllocatorCreateInfo</a>, <a class="el" href="struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9">VmaDefragmentationInfo2</a>, <a class="el" href="struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446">VmaPoolCreateInfo</a>, <a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a">VmaRecordSettings</a>, <a class="el" href="struct_vma_virtual_allocation_create_info.html#ab10e16956cc4bf20ced9de77d1129ea4">VmaVirtualAllocationCreateInfo</a>, <a class="el" href="struct_vma_virtual_block_create_info.html#a5838b15c053a0370420e4e1d82d09c09">VmaVirtualBlockCreateInfo</a></li> -<li>frameInUseCount : <a class="el" href="struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7">VmaAllocatorCreateInfo</a>, <a class="el" href="struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa">VmaPoolCreateInfo</a></li> +<li>flags : <a class="el" href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo</a>, <a class="el" href="struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346">VmaAllocatorCreateInfo</a>, <a class="el" href="struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9">VmaDefragmentationInfo2</a>, <a class="el" href="struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446">VmaPoolCreateInfo</a>, <a class="el" href="struct_vma_virtual_allocation_create_info.html#ab10e16956cc4bf20ced9de77d1129ea4">VmaVirtualAllocationCreateInfo</a>, <a class="el" href="struct_vma_virtual_block_create_info.html#a5838b15c053a0370420e4e1d82d09c09">VmaVirtualBlockCreateInfo</a></li> </ul> @@ -138,7 +137,6 @@ $(function() { <li>pAllocations : <a class="el" href="struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32">VmaDefragmentationInfo2</a></li> <li>pAllocationsChanged : <a class="el" href="struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc">VmaDefragmentationInfo2</a></li> <li>pDeviceMemoryCallbacks : <a class="el" href="struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e">VmaAllocatorCreateInfo</a></li> -<li>pFilePath : <a class="el" href="struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d">VmaRecordSettings</a></li> <li>pfnAllocate : <a class="el" href="struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb">VmaDeviceMemoryCallbacks</a></li> <li>pfnFree : <a class="el" href="struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c">VmaDeviceMemoryCallbacks</a></li> <li>pHeapSizeLimit : <a class="el" href="struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b">VmaAllocatorCreateInfo</a></li> @@ -149,7 +147,6 @@ $(function() { <li>pool : <a class="el" href="struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150">VmaAllocationCreateInfo</a></li> <li>poolCount : <a class="el" href="struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d">VmaDefragmentationInfo2</a></li> <li>pPools : <a class="el" href="struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b">VmaDefragmentationInfo2</a></li> -<li>pRecordSettings : <a class="el" href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee">VmaAllocatorCreateInfo</a></li> <li>preferredFlags : <a class="el" href="struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d">VmaAllocationCreateInfo</a></li> <li>preferredLargeHeapBlockSize : <a class="el" href="struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a">VmaAllocatorCreateInfo</a></li> <li>priority : <a class="el" href="struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7">VmaAllocationCreateInfo</a>, <a class="el" href="struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274">VmaPoolCreateInfo</a></li> @@ -178,7 +175,7 @@ $(function() { <li>unusedBytes : <a class="el" href="struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669">VmaStatInfo</a></li> <li>unusedRangeCount : <a class="el" href="struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4">VmaPoolStats</a>, <a class="el" href="struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9">VmaStatInfo</a></li> <li>unusedRangeSizeAvg : <a class="el" href="struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc">VmaStatInfo</a></li> -<li>unusedRangeSizeMax : <a class="el" href="struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b">VmaPoolStats</a>, <a class="el" href="struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4">VmaStatInfo</a></li> +<li>unusedRangeSizeMax : <a class="el" href="struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4">VmaStatInfo</a></li> <li>unusedRangeSizeMin : <a class="el" href="struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4">VmaStatInfo</a></li> <li>unusedSize : <a class="el" href="struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8">VmaPoolStats</a></li> <li>usage : <a class="el" href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo</a>, <a class="el" href="struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6">VmaBudget</a></li> diff --git a/docs/html/general_considerations.html b/docs/html/general_considerations.html index da746e1..d18fcd9 100644 --- a/docs/html/general_considerations.html +++ b/docs/html/general_considerations.html @@ -75,7 +75,7 @@ Thread safety</h1> <li>The library has no global state, so separate <a class="el" href="struct_vma_allocator.html" title="Represents main object of this library initialized.">VmaAllocator</a> objects can be used independently. There should be no need to create multiple such objects though - one per <code>VkDevice</code> is enough.</li> <li>By default, all calls to functions that take <a class="el" href="struct_vma_allocator.html" title="Represents main object of this library initialized.">VmaAllocator</a> 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 <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a>.</li> <li>When the allocator is created with <a class="el" href="vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d" title="Allocator and all objects created from it will not be synchronized internally, so you must guarantee ...">VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT</a> flag, calls to functions that take such <a class="el" href="struct_vma_allocator.html" title="Represents main object of this library initialized.">VmaAllocator</a> object must be synchronized externally.</li> -<li>Access to a <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> object must be externally synchronized. For example, you must not call <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> and <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069" title="Maps memory represented by given allocation and returns pointer to it.">vmaMapMemory()</a> from different threads at the same time if you pass the same <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> object to these functions.</li> +<li>Access to a <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> object must be externally synchronized. For example, you must not call <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a> and <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069" title="Maps memory represented by given allocation and returns pointer to it.">vmaMapMemory()</a> from different threads at the same time if you pass the same <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> object to these functions.</li> <li><a class="el" href="struct_vma_virtual_block.html" title="Handle to a virtual block object that allows to use core allocation algorithm without allocating any ...">VmaVirtualBlock</a> is also not safe to be used from multiple threads simultaneously.</li> </ul> <h1><a class="anchor" id="general_considerations_validation_layer_warnings"></a> @@ -91,8 +91,7 @@ Validation layer warnings</h1> </ul> </li> <li><em>Non-linear image 0xebc91 is aliased with linear buffer 0xeb8e4 which may indicate a bug.</em><ul> -<li>It happens when you use lost allocations, and a new image or buffer is created in place of an existing object that became lost.</li> -<li>It may happen also when you use <a class="el" href="defragmentation.html">defragmentation</a>.</li> +<li>It may happen when you use <a class="el" href="defragmentation.html">defragmentation</a>.</li> </ul> </li> </ul> @@ -103,7 +102,6 @@ Allocation algorithm</h1> <li>Try to find free range of memory in existing blocks.</li> <li>If failed, try to create a new block of <code>VkDeviceMemory</code>, with preferred block size.</li> <li>If failed, try to create such block with size/2, size/4, size/8.</li> -<li>If failed and <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e">VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT</a> flag was specified, try to find space in existing blocks, possilby making some other allocations lost.</li> <li>If failed, try to allocate separate <code>VkDeviceMemory</code> for this allocation, just like when you use <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f" title="Set this flag if the allocation should have its own memory block.">VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT</a>.</li> <li>If failed, choose other memory type that meets the requirements specified in <a class="el" href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a> and go to point 1.</li> <li>If failed, return <code>VK_ERROR_OUT_OF_DEVICE_MEMORY</code>.</li> diff --git a/docs/html/globals.html b/docs/html/globals.html index a755c83..823372f 100644 --- a/docs/html/globals.html +++ b/docs/html/globals.html @@ -73,13 +73,13 @@ $(function() { <h3><a id="index_v" name="index_v"></a>- v -</h3><ul> <li>VK_ERROR_UNKNOWN : <a class="el" href="vk__mem__alloc_8h.html#a162894cbe84f7d76632eb9af1e4b3558">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597afb0ee060cd733aaa5e249704ff589ad6">vk_mem_alloc.h</a></li> -<li>VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">vk_mem_alloc.h</a></li> -<li>VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_DONT_BIND_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_MAPPED_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff">vk_mem_alloc.h</a></li> +<li>VMA_ALLOCATION_CREATE_RESERVED_1_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad7e8035e8edecd8dfa1f32a194bdf103">vk_mem_alloc.h</a></li> +<li>VMA_ALLOCATION_CREATE_RESERVED_2_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae9290dbcf5817e7616d5802e2aa251e7">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a839826775c62319466441f86496f036d">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_STRATEGY_MASK : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e">vk_mem_alloc.h</a></li> @@ -117,9 +117,6 @@ $(function() { <li>VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM : <a class="el" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec">vk_mem_alloc.h</a></li> <li>VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT : <a class="el" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2">vk_mem_alloc.h</a></li> <li>VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT : <a class="el" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726">vk_mem_alloc.h</a></li> -<li>VMA_RECORD_FLAG_BITS_MAX_ENUM : <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e">vk_mem_alloc.h</a></li> -<li>VMA_RECORD_FLUSH_AFTER_CALL_BIT : <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7">vk_mem_alloc.h</a></li> -<li>VMA_RECORDING_ENABLED : <a class="el" href="vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c">vk_mem_alloc.h</a></li> <li>VMA_STATS_STRING_ENABLED : <a class="el" href="vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1">vk_mem_alloc.h</a></li> <li>VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM : <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9">vk_mem_alloc.h</a></li> <li>VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK : <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3">vk_mem_alloc.h</a></li> @@ -160,7 +157,6 @@ $(function() { <li>vmaCreateBuffer() : <a class="el" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vk_mem_alloc.h</a></li> <li>vmaCreateBufferWithAlignment() : <a class="el" href="vk__mem__alloc_8h.html#aa06a690013a0d01e60894ac378083834">vk_mem_alloc.h</a></li> <li>vmaCreateImage() : <a class="el" href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73">vk_mem_alloc.h</a></li> -<li>vmaCreateLostAllocation() : <a class="el" href="vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1">vk_mem_alloc.h</a></li> <li>vmaCreatePool() : <a class="el" href="vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50">vk_mem_alloc.h</a></li> <li>vmaCreateVirtualBlock() : <a class="el" href="vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b">vk_mem_alloc.h</a></li> <li>vmaDefragment() : <a class="el" href="vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac">vk_mem_alloc.h</a></li> @@ -202,23 +198,18 @@ $(function() { <li>vmaInvalidateAllocation() : <a class="el" href="vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae">vk_mem_alloc.h</a></li> <li>vmaInvalidateAllocations() : <a class="el" href="vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5">vk_mem_alloc.h</a></li> <li>vmaIsVirtualBlockEmpty() : <a class="el" href="vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1">vk_mem_alloc.h</a></li> -<li>vmaMakePoolAllocationsLost() : <a class="el" href="vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024">vk_mem_alloc.h</a></li> <li>vmaMapMemory() : <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069">vk_mem_alloc.h</a></li> <li>VmaMemoryUsage : <a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc">vk_mem_alloc.h</a></li> <li>VmaPoolCreateFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7">vk_mem_alloc.h</a></li> <li>VmaPoolCreateFlags : <a class="el" href="vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a">vk_mem_alloc.h</a></li> <li>VmaPoolCreateInfo : <a class="el" href="vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67">vk_mem_alloc.h</a></li> <li>VmaPoolStats : <a class="el" href="vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1">vk_mem_alloc.h</a></li> -<li>VmaRecordFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2">vk_mem_alloc.h</a></li> -<li>VmaRecordFlags : <a class="el" href="vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828">vk_mem_alloc.h</a></li> -<li>VmaRecordSettings : <a class="el" href="vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc">vk_mem_alloc.h</a></li> <li>vmaSetAllocationUserData() : <a class="el" href="vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f">vk_mem_alloc.h</a></li> <li>vmaSetCurrentFrameIndex() : <a class="el" href="vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236">vk_mem_alloc.h</a></li> <li>vmaSetPoolName() : <a class="el" href="vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58">vk_mem_alloc.h</a></li> <li>vmaSetVirtualAllocationUserData() : <a class="el" href="vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9">vk_mem_alloc.h</a></li> <li>VmaStatInfo : <a class="el" href="vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878">vk_mem_alloc.h</a></li> <li>VmaStats : <a class="el" href="vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034">vk_mem_alloc.h</a></li> -<li>vmaTouchAllocation() : <a class="el" href="vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a">vk_mem_alloc.h</a></li> <li>vmaUnmapMemory() : <a class="el" href="vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45">vk_mem_alloc.h</a></li> <li>vmaVirtualAllocate() : <a class="el" href="vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2">vk_mem_alloc.h</a></li> <li>VmaVirtualAllocationCreateFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6">vk_mem_alloc.h</a></li> diff --git a/docs/html/globals_defs.html b/docs/html/globals_defs.html index 0a62a21..e546396 100644 --- a/docs/html/globals_defs.html +++ b/docs/html/globals_defs.html @@ -68,7 +68,6 @@ $(function() { <li>VMA_BUFFER_DEVICE_ADDRESS : <a class="el" href="vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10">vk_mem_alloc.h</a></li> <li>VMA_DEDICATED_ALLOCATION : <a class="el" href="vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4">vk_mem_alloc.h</a></li> <li>VMA_MEMORY_BUDGET : <a class="el" href="vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a">vk_mem_alloc.h</a></li> -<li>VMA_RECORDING_ENABLED : <a class="el" href="vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c">vk_mem_alloc.h</a></li> <li>VMA_STATS_STRING_ENABLED : <a class="el" href="vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1">vk_mem_alloc.h</a></li> </ul> </div><!-- contents --> diff --git a/docs/html/globals_enum.html b/docs/html/globals_enum.html index c15060c..81938ad 100644 --- a/docs/html/globals_enum.html +++ b/docs/html/globals_enum.html @@ -68,7 +68,6 @@ $(function() { <li>VmaDefragmentationFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50c">vk_mem_alloc.h</a></li> <li>VmaMemoryUsage : <a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc">vk_mem_alloc.h</a></li> <li>VmaPoolCreateFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7">vk_mem_alloc.h</a></li> -<li>VmaRecordFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2">vk_mem_alloc.h</a></li> <li>VmaVirtualAllocationCreateFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6">vk_mem_alloc.h</a></li> <li>VmaVirtualBlockCreateFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bca">vk_mem_alloc.h</a></li> </ul> diff --git a/docs/html/globals_eval.html b/docs/html/globals_eval.html index fde4df2..ec29b6a 100644 --- a/docs/html/globals_eval.html +++ b/docs/html/globals_eval.html @@ -66,13 +66,13 @@ $(function() { <h3><a id="index_v" name="index_v"></a>- v -</h3><ul> <li>VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597afb0ee060cd733aaa5e249704ff589ad6">vk_mem_alloc.h</a></li> -<li>VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">vk_mem_alloc.h</a></li> -<li>VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_DONT_BIND_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_MAPPED_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff">vk_mem_alloc.h</a></li> +<li>VMA_ALLOCATION_CREATE_RESERVED_1_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad7e8035e8edecd8dfa1f32a194bdf103">vk_mem_alloc.h</a></li> +<li>VMA_ALLOCATION_CREATE_RESERVED_2_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae9290dbcf5817e7616d5802e2aa251e7">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a839826775c62319466441f86496f036d">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777">vk_mem_alloc.h</a></li> <li>VMA_ALLOCATION_CREATE_STRATEGY_MASK : <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e">vk_mem_alloc.h</a></li> @@ -106,8 +106,6 @@ $(function() { <li>VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM : <a class="el" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec">vk_mem_alloc.h</a></li> <li>VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT : <a class="el" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2">vk_mem_alloc.h</a></li> <li>VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT : <a class="el" href="vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726">vk_mem_alloc.h</a></li> -<li>VMA_RECORD_FLAG_BITS_MAX_ENUM : <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e">vk_mem_alloc.h</a></li> -<li>VMA_RECORD_FLUSH_AFTER_CALL_BIT : <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7">vk_mem_alloc.h</a></li> <li>VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM : <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9">vk_mem_alloc.h</a></li> <li>VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK : <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3">vk_mem_alloc.h</a></li> <li>VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT : <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9aa0c32667ba2deaa9cdeac6149ec47a">vk_mem_alloc.h</a></li> diff --git a/docs/html/globals_func.html b/docs/html/globals_func.html index c8ba547..80ad5d8 100644 --- a/docs/html/globals_func.html +++ b/docs/html/globals_func.html @@ -85,7 +85,6 @@ $(function() { <li>vmaCreateBuffer() : <a class="el" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vk_mem_alloc.h</a></li> <li>vmaCreateBufferWithAlignment() : <a class="el" href="vk__mem__alloc_8h.html#aa06a690013a0d01e60894ac378083834">vk_mem_alloc.h</a></li> <li>vmaCreateImage() : <a class="el" href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73">vk_mem_alloc.h</a></li> -<li>vmaCreateLostAllocation() : <a class="el" href="vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1">vk_mem_alloc.h</a></li> <li>vmaCreatePool() : <a class="el" href="vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50">vk_mem_alloc.h</a></li> <li>vmaCreateVirtualBlock() : <a class="el" href="vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b">vk_mem_alloc.h</a></li> <li>vmaDefragment() : <a class="el" href="vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac">vk_mem_alloc.h</a></li> @@ -119,13 +118,11 @@ $(function() { <li>vmaInvalidateAllocation() : <a class="el" href="vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae">vk_mem_alloc.h</a></li> <li>vmaInvalidateAllocations() : <a class="el" href="vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5">vk_mem_alloc.h</a></li> <li>vmaIsVirtualBlockEmpty() : <a class="el" href="vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1">vk_mem_alloc.h</a></li> -<li>vmaMakePoolAllocationsLost() : <a class="el" href="vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024">vk_mem_alloc.h</a></li> <li>vmaMapMemory() : <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069">vk_mem_alloc.h</a></li> <li>vmaSetAllocationUserData() : <a class="el" href="vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f">vk_mem_alloc.h</a></li> <li>vmaSetCurrentFrameIndex() : <a class="el" href="vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236">vk_mem_alloc.h</a></li> <li>vmaSetPoolName() : <a class="el" href="vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58">vk_mem_alloc.h</a></li> <li>vmaSetVirtualAllocationUserData() : <a class="el" href="vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9">vk_mem_alloc.h</a></li> -<li>vmaTouchAllocation() : <a class="el" href="vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a">vk_mem_alloc.h</a></li> <li>vmaUnmapMemory() : <a class="el" href="vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45">vk_mem_alloc.h</a></li> <li>vmaVirtualAllocate() : <a class="el" href="vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2">vk_mem_alloc.h</a></li> <li>vmaVirtualFree() : <a class="el" href="vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639">vk_mem_alloc.h</a></li> diff --git a/docs/html/globals_type.html b/docs/html/globals_type.html index 3db9cb3..7f308d8 100644 --- a/docs/html/globals_type.html +++ b/docs/html/globals_type.html @@ -93,9 +93,6 @@ $(function() { <li>VmaPoolCreateFlags : <a class="el" href="vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a">vk_mem_alloc.h</a></li> <li>VmaPoolCreateInfo : <a class="el" href="vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67">vk_mem_alloc.h</a></li> <li>VmaPoolStats : <a class="el" href="vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1">vk_mem_alloc.h</a></li> -<li>VmaRecordFlagBits : <a class="el" href="vk__mem__alloc_8h.html#acd24d5eb58abff7e1f43cb32a1ba1413">vk_mem_alloc.h</a></li> -<li>VmaRecordFlags : <a class="el" href="vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828">vk_mem_alloc.h</a></li> -<li>VmaRecordSettings : <a class="el" href="vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc">vk_mem_alloc.h</a></li> <li>VmaStatInfo : <a class="el" href="vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878">vk_mem_alloc.h</a></li> <li>VmaStats : <a class="el" href="vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034">vk_mem_alloc.h</a></li> <li>VmaVirtualAllocationCreateFlagBits : <a class="el" href="vk__mem__alloc_8h.html#a936815e64946a6b6d812d08d10184c23">vk_mem_alloc.h</a></li> diff --git a/docs/html/index.html b/docs/html/index.html index d453eb4..12026e0 100644 --- a/docs/html/index.html +++ b/docs/html/index.html @@ -119,7 +119,6 @@ Table of contents</h1> <li><a class="el" href="defragmentation.html#defragmentation_custom_algorithm">Writing custom allocation algorithm</a></li> </ul> </li> -<li><a class="el" href="lost_allocations.html">Lost allocations</a></li> <li><a class="el" href="statistics.html">Statistics</a><ul> <li><a class="el" href="statistics.html#statistics_numeric_statistics">Numeric statistics</a></li> <li><a class="el" href="statistics.html#statistics_json_dump">JSON dump</a></li> @@ -137,7 +136,6 @@ Table of contents</h1> <li><a class="el" href="debugging_memory_usage.html#debugging_memory_usage_corruption_detection">Corruption detection</a></li> </ul> </li> -<li><a class="el" href="record_and_replay.html">Record and replay</a></li> <li><a class="el" href="opengl_interop.html">OpenGL Interop</a></li> </ul> </li> diff --git a/docs/html/memory_mapping.html b/docs/html/memory_mapping.html index b11328a..b8f7fe4 100644 --- a/docs/html/memory_mapping.html +++ b/docs/html/memory_mapping.html @@ -116,14 +116,14 @@ Persistently mapped memory</h1> <div class="line"> </div> <div class="line"><span class="comment">// Buffer is already mapped. You can access its memory.</span></div> <div class="line">memcpy(allocInfo.<a class="code hl_variable" href="struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2">pMappedData</a>, &constantBufferData, <span class="keyword">sizeof</span>(constantBufferData));</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1098</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1106</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_add09658ac14fe290ace25470ddd6d41b"><div class="ttname"><a href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo::flags</a></div><div class="ttdeci">VmaAllocationCreateFlags flags</div><div class="ttdoc">Use VmaAllocationCreateFlagBits enum.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1100</div></div> -<div class="ttc" id="astruct_vma_allocation_info_html"><div class="ttname"><a href="struct_vma_allocation_info.html">VmaAllocationInfo</a></div><div class="ttdoc">Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1247</div></div> -<div class="ttc" id="astruct_vma_allocation_info_html_a5eeffbe2d2f30f53370ff14aefbadbe2"><div class="ttname"><a href="struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2">VmaAllocationInfo::pMappedData</a></div><div class="ttdeci">void * pMappedData</div><div class="ttdoc">Pointer to the beginning of this allocation as mapped data.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1291</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5">VMA_MEMORY_USAGE_CPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_CPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:468</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1014</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1022</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_add09658ac14fe290ace25470ddd6d41b"><div class="ttname"><a href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">VmaAllocationCreateInfo::flags</a></div><div class="ttdeci">VmaAllocationCreateFlags flags</div><div class="ttdoc">Use VmaAllocationCreateFlagBits enum.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1016</div></div> +<div class="ttc" id="astruct_vma_allocation_info_html"><div class="ttname"><a href="struct_vma_allocation_info.html">VmaAllocationInfo</a></div><div class="ttdoc">Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1142</div></div> +<div class="ttc" id="astruct_vma_allocation_info_html_a5eeffbe2d2f30f53370ff14aefbadbe2"><div class="ttname"><a href="struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2">VmaAllocationInfo::pMappedData</a></div><div class="ttdeci">void * pMappedData</div><div class="ttdoc">Pointer to the beginning of this allocation as mapped data.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1184</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5">VMA_MEMORY_USAGE_CPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_CPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:444</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_ac72ee55598617e8eecca384e746bab51"><div class="ttname"><a href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a></div><div class="ttdeci">VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f"><div class="ttname"><a href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">VMA_ALLOCATION_CREATE_MAPPED_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATION_CREATE_MAPPED_BIT</div><div class="ttdoc">Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:534</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f"><div class="ttname"><a href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">VMA_ALLOCATION_CREATE_MAPPED_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATION_CREATE_MAPPED_BIT</div><div class="ttdoc">Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:508</div></div> </div><!-- fragment --><p >There are some exceptions though, when you should consider mapping memory only for a short period of time:</p> <ul> <li>When operating system is Windows 7 or 8.x (Windows 10 is not affected because it uses WDDM2), device is discrete AMD GPU, and memory type is the special 256 MiB pool of <code>DEVICE_LOCAL + HOST_VISIBLE</code> memory (selected when you use <a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67">VMA_MEMORY_USAGE_CPU_TO_GPU</a>), then whenever a memory block allocated from this memory type stays mapped for the time of any call to <code>vkQueueSubmit()</code> or <code>vkQueuePresentKHR()</code>, this block is migrated by WDDM to system RAM, which degrades performance. It doesn't matter if that particular memory block is actually used by the command buffer being submitted.</li> @@ -166,9 +166,9 @@ Finding out if memory is mappable</h1> <div class="line"> <span class="comment">// Allocation ended up in non-mappable memory.</span></div> <div class="line"> <span class="comment">// You need to create CPU-side buffer in VMA_MEMORY_USAGE_CPU_ONLY and make a transfer.</span></div> <div class="line">}</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_a7fe8d81a1ad10b2a2faacacee5b15d6d"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d">VmaAllocationCreateInfo::preferredFlags</a></div><div class="ttdeci">VkMemoryPropertyFlags preferredFlags</div><div class="ttdoc">Flags that preferably should be set in a memory type chosen for an allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1116</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_a7fe8d81a1ad10b2a2faacacee5b15d6d"><div class="ttname"><a href="struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d">VmaAllocationCreateInfo::preferredFlags</a></div><div class="ttdeci">VkMemoryPropertyFlags preferredFlags</div><div class="ttdoc">Flags that preferably should be set in a memory type chosen for an allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1032</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a571e87dd38e552249b56b1b0b982fad1"><div class="ttname"><a href="vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1">vmaGetAllocationMemoryProperties</a></div><div class="ttdeci">void vmaGetAllocationMemoryProperties(VmaAllocator allocator, VmaAllocation allocation, VkMemoryPropertyFlags *pFlags)</div><div class="ttdoc">Given an allocation, returns Property Flags of its memory type.</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:458</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:434</div></div> </div><!-- fragment --><p >You can even use <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f" title="Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.">VMA_ALLOCATION_CREATE_MAPPED_BIT</a> flag while creating allocations that are not necessarily <code>HOST_VISIBLE</code> (e.g. using <a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a>). If the allocation ends up in memory type that is <code>HOST_VISIBLE</code>, it will be persistently mapped and you can use it directly. If not, the flag is just ignored. Example:</p> <div class="fragment"><div class="line">VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO };</div> <div class="line">bufCreateInfo.size = <span class="keyword">sizeof</span>(ConstantBuffer);</div> diff --git a/docs/html/quick_start.html b/docs/html/quick_start.html index 21a5414..b01d280 100644 --- a/docs/html/quick_start.html +++ b/docs/html/quick_start.html @@ -104,11 +104,11 @@ Initialization</h1> <div class="line"> </div> <div class="line"><a class="code hl_struct" href="struct_vma_allocator.html">VmaAllocator</a> allocator;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb">vmaCreateAllocator</a>(&allocatorInfo, &allocator);</div> -<div class="ttc" id="astruct_vma_allocator_create_info_html"><div class="ttname"><a href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></div><div class="ttdoc">Description of a Allocator to be created.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:914</div></div> -<div class="ttc" id="astruct_vma_allocator_create_info_html_a08230f04ae6ccf8a78150a9e829a7156"><div class="ttname"><a href="struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156">VmaAllocatorCreateInfo::physicalDevice</a></div><div class="ttdeci">VkPhysicalDevice physicalDevice</div><div class="ttdoc">Vulkan physical device.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:919</div></div> -<div class="ttc" id="astruct_vma_allocator_create_info_html_a70dd42e29b1df1d1b9b61532ae0b370b"><div class="ttname"><a href="struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b">VmaAllocatorCreateInfo::instance</a></div><div class="ttdeci">VkInstance instance</div><div class="ttdoc">Handle to Vulkan instance object.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:988</div></div> -<div class="ttc" id="astruct_vma_allocator_create_info_html_ad924ddd77b04039c88d0c09b0ffcd500"><div class="ttname"><a href="struct_vma_allocator_create_info.html#ad924ddd77b04039c88d0c09b0ffcd500">VmaAllocatorCreateInfo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdoc">Vulkan device.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:922</div></div> -<div class="ttc" id="astruct_vma_allocator_create_info_html_ae0ffc55139b54520a6bb704b29ffc285"><div class="ttname"><a href="struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285">VmaAllocatorCreateInfo::vulkanApiVersion</a></div><div class="ttdeci">uint32_t vulkanApiVersion</div><div class="ttdoc">Optional. The highest version of Vulkan that the application is designed to use.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:997</div></div> +<div class="ttc" id="astruct_vma_allocator_create_info_html"><div class="ttname"><a href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></div><div class="ttdoc">Description of a Allocator to be created.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:854</div></div> +<div class="ttc" id="astruct_vma_allocator_create_info_html_a08230f04ae6ccf8a78150a9e829a7156"><div class="ttname"><a href="struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156">VmaAllocatorCreateInfo::physicalDevice</a></div><div class="ttdeci">VkPhysicalDevice physicalDevice</div><div class="ttdoc">Vulkan physical device.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:859</div></div> +<div class="ttc" id="astruct_vma_allocator_create_info_html_a70dd42e29b1df1d1b9b61532ae0b370b"><div class="ttname"><a href="struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b">VmaAllocatorCreateInfo::instance</a></div><div class="ttdeci">VkInstance instance</div><div class="ttdoc">Handle to Vulkan instance object.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:907</div></div> +<div class="ttc" id="astruct_vma_allocator_create_info_html_ad924ddd77b04039c88d0c09b0ffcd500"><div class="ttname"><a href="struct_vma_allocator_create_info.html#ad924ddd77b04039c88d0c09b0ffcd500">VmaAllocatorCreateInfo::device</a></div><div class="ttdeci">VkDevice device</div><div class="ttdoc">Vulkan device.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:862</div></div> +<div class="ttc" id="astruct_vma_allocator_create_info_html_ae0ffc55139b54520a6bb704b29ffc285"><div class="ttname"><a href="struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285">VmaAllocatorCreateInfo::vulkanApiVersion</a></div><div class="ttdeci">uint32_t vulkanApiVersion</div><div class="ttdoc">Optional. The highest version of Vulkan that the application is designed to use.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:916</div></div> <div class="ttc" id="astruct_vma_allocator_html"><div class="ttname"><a href="struct_vma_allocator.html">VmaAllocator</a></div><div class="ttdoc">Represents main object of this library initialized.</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a200692051ddb34240248234f5f4c17bb"><div class="ttname"><a href="vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb">vmaCreateAllocator</a></div><div class="ttdeci">VkResult vmaCreateAllocator(const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator)</div><div class="ttdoc">Creates Allocator object.</div></div> </div><!-- fragment --><p >Only members <code>physicalDevice</code>, <code>device</code>, <code>instance</code> are required. However, you should inform the library which Vulkan version do you use by setting <a class="el" href="struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285" title="Optional. The highest version of Vulkan that the application is designed to use.">VmaAllocatorCreateInfo::vulkanApiVersion</a> and which extensions did you enable by setting <a class="el" href="struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346" title="Flags for created allocator. Use VmaAllocatorCreateFlagBits enum.">VmaAllocatorCreateInfo::flags</a> (like <a class="el" href="vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca5f1b28b0414319d1687e1f2b30ab0089">VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT</a> for VK_KHR_buffer_device_address). Otherwise, VMA would use only features of Vulkan 1.0 core with no extensions.</p> @@ -130,10 +130,10 @@ Resource allocation</h1> <div class="line">VkBuffer buffer;</div> <div class="line"><a class="code hl_struct" href="struct_vma_allocation.html">VmaAllocation</a> allocation;</div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a>(allocator, &bufferInfo, &allocInfo, &buffer, &allocation, <span class="keyword">nullptr</span>);</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1098</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1106</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1014</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1022</div></div> <div class="ttc" id="astruct_vma_allocation_html"><div class="ttname"><a href="struct_vma_allocation.html">VmaAllocation</a></div><div class="ttdoc">Represents single memory allocation.</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:458</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:434</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_ac72ee55598617e8eecca384e746bab51"><div class="ttname"><a href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a></div><div class="ttdeci">VkResult vmaCreateBuffer(VmaAllocator allocator, const VkBufferCreateInfo *pBufferCreateInfo, const VmaAllocationCreateInfo *pAllocationCreateInfo, VkBuffer *pBuffer, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)</div></div> </div><!-- fragment --><p >Don't forget to destroy your objects when no longer needed:</p> <div class="fragment"><div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77">vmaDestroyBuffer</a>(allocator, buffer, allocation);</div> diff --git a/docs/html/resource_aliasing.html b/docs/html/resource_aliasing.html index c8f3459..9bfa0cb 100644 --- a/docs/html/resource_aliasing.html +++ b/docs/html/resource_aliasing.html @@ -137,12 +137,12 @@ $(function() { <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f">vmaFreeMemory</a>(allocator, alloc);</div> <div class="line">vkDestroyImage(allocator, img2, <span class="keyword">nullptr</span>);</div> <div class="line">vkDestroyImage(allocator, img1, <span class="keyword">nullptr</span>);</div> -<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1098</div></div> -<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1106</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html"><div class="ttname"><a href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a></div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1014</div></div> +<div class="ttc" id="astruct_vma_allocation_create_info_html_accb8b06b1f677d858cb9af20705fa910"><div class="ttname"><a href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">VmaAllocationCreateInfo::usage</a></div><div class="ttdeci">VmaMemoryUsage usage</div><div class="ttdoc">Intended usage of memory.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1022</div></div> <div class="ttc" id="astruct_vma_allocation_html"><div class="ttname"><a href="struct_vma_allocation.html">VmaAllocation</a></div><div class="ttdoc">Represents single memory allocation.</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a3d3ca45799923aa5d138e9e5f9eb2da5"><div class="ttname"><a href="vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5">vmaBindImageMemory</a></div><div class="ttdeci">VkResult vmaBindImageMemory(VmaAllocator allocator, VmaAllocation allocation, VkImage image)</div><div class="ttdoc">Binds image to allocation.</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a5fea5518972ae9094b1526cbcb19b05f"><div class="ttname"><a href="vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f">vmaFreeMemory</a></div><div class="ttdeci">void vmaFreeMemory(VmaAllocator allocator, const VmaAllocation allocation)</div><div class="ttdoc">Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(),...</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:458</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7"><div class="ttname"><a href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a></div><div class="ttdeci">@ VMA_MEMORY_USAGE_GPU_ONLY</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:434</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_abf28077dbf82d0908b8acbe8ee8dd9b8"><div class="ttname"><a href="vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8">vmaAllocateMemory</a></div><div class="ttdeci">VkResult vmaAllocateMemory(VmaAllocator allocator, const VkMemoryRequirements *pVkMemoryRequirements, const VmaAllocationCreateInfo *pCreateInfo, VmaAllocation *pAllocation, VmaAllocationInfo *pAllocationInfo)</div><div class="ttdoc">General purpose memory allocation.</div></div> </div><!-- fragment --><p >Remember that using resources that alias in memory requires proper synchronization. You need to issue a memory barrier to make sure commands that use <code>img1</code> and <code>img2</code> 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 <code>img1</code> and then want to use <code>img2</code>, you need to issue an image memory barrier for <code>img2</code> with <code>oldLayout</code> = <code>VK_IMAGE_LAYOUT_UNDEFINED</code>.</p> <p >Additional considerations:</p> diff --git a/docs/html/search/all_10.js b/docs/html/search/all_10.js index 025dded..59679bd 100644 --- a/docs/html/search/all_10.js +++ b/docs/html/search/all_10.js @@ -1,11 +1,188 @@ var searchData= [ - ['unusedbytes_0',['unusedBytes',['../struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669',1,'VmaStatInfo']]], - ['unusedrangecount_1',['unusedRangeCount',['../struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9',1,'VmaStatInfo::unusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]], - ['unusedrangesizeavg_2',['unusedRangeSizeAvg',['../struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc',1,'VmaStatInfo']]], - ['unusedrangesizemax_3',['unusedRangeSizeMax',['../struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4',1,'VmaStatInfo::unusedRangeSizeMax()'],['../struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b',1,'VmaPoolStats::unusedRangeSizeMax()']]], - ['unusedrangesizemin_4',['unusedRangeSizeMin',['../struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4',1,'VmaStatInfo']]], - ['unusedsize_5',['unusedSize',['../struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8',1,'VmaPoolStats']]], - ['usage_6',['usage',['../struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6',1,'VmaBudget::usage()'],['../struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910',1,'VmaAllocationCreateInfo::usage()']]], - ['usedbytes_7',['usedBytes',['../struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a',1,'VmaStatInfo']]] + ['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_5ferror_5funknown_2',['VK_ERROR_UNKNOWN',['../vk__mem__alloc_8h.html#a162894cbe84f7d76632eb9af1e4b3558',1,'vk_mem_alloc.h']]], + ['vk_5fkhr_5fdedicated_5fallocation_3',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]], + ['vk_5fmem_5falloc_2eh_4',['vk_mem_alloc.h',['../vk__mem__alloc_8h.html',1,'']]], + ['vkallocatememory_5',['vkAllocateMemory',['../struct_vma_vulkan_functions.html#a2943bf99dfd784a0e8f599d987e22e6c',1,'VmaVulkanFunctions']]], + ['vkbindbuffermemory_6',['vkBindBufferMemory',['../struct_vma_vulkan_functions.html#a94fc4f3a605d9880bb3c0ba2c2fc80b2',1,'VmaVulkanFunctions']]], + ['vkbindbuffermemory2khr_7',['vkBindBufferMemory2KHR',['../struct_vma_vulkan_functions.html#a0c4907235aab9df2767b79836afa2dc9',1,'VmaVulkanFunctions']]], + ['vkbindimagememory_8',['vkBindImageMemory',['../struct_vma_vulkan_functions.html#a1338d96a128a5ade648b8d934907c637',1,'VmaVulkanFunctions']]], + ['vkbindimagememory2khr_9',['vkBindImageMemory2KHR',['../struct_vma_vulkan_functions.html#ab95aaa73ab8a3fe9fd3daaaec4e0b2bf',1,'VmaVulkanFunctions']]], + ['vkcmdcopybuffer_10',['vkCmdCopyBuffer',['../struct_vma_vulkan_functions.html#ae5c0db8c89a3b82593dc16aa6a49fa3a',1,'VmaVulkanFunctions']]], + ['vkcreatebuffer_11',['vkCreateBuffer',['../struct_vma_vulkan_functions.html#ae8084315a25006271a2edfc3a447519f',1,'VmaVulkanFunctions']]], + ['vkcreateimage_12',['vkCreateImage',['../struct_vma_vulkan_functions.html#a23ebe70be515b9b5010a1d691200e325',1,'VmaVulkanFunctions']]], + ['vkdestroybuffer_13',['vkDestroyBuffer',['../struct_vma_vulkan_functions.html#a7e054606faddb07f0e8556f3ed317d45',1,'VmaVulkanFunctions']]], + ['vkdestroyimage_14',['vkDestroyImage',['../struct_vma_vulkan_functions.html#a90b898227039b1dcb3520f6e91f09ffa',1,'VmaVulkanFunctions']]], + ['vkflushmappedmemoryranges_15',['vkFlushMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a33c322f4c4ad2810f8a9c97a277572f9',1,'VmaVulkanFunctions']]], + ['vkfreememory_16',['vkFreeMemory',['../struct_vma_vulkan_functions.html#a4c658701778564d62034255b5dda91b4',1,'VmaVulkanFunctions']]], + ['vkgetbuffermemoryrequirements_17',['vkGetBufferMemoryRequirements',['../struct_vma_vulkan_functions.html#a5b92901df89a4194b0d12f6071d4d143',1,'VmaVulkanFunctions']]], + ['vkgetbuffermemoryrequirements2khr_18',['vkGetBufferMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9d8d1b05d2b1e7e1d9b27f6f585acf9c',1,'VmaVulkanFunctions']]], + ['vkgetdeviceprocaddr_19',['vkGetDeviceProcAddr',['../struct_vma_vulkan_functions.html#ac383ab9af127e5e136622fa4ebea9e57',1,'VmaVulkanFunctions']]], + ['vkgetimagememoryrequirements_20',['vkGetImageMemoryRequirements',['../struct_vma_vulkan_functions.html#a475f6f49f8debe4d10800592606d53f4',1,'VmaVulkanFunctions']]], + ['vkgetimagememoryrequirements2khr_21',['vkGetImageMemoryRequirements2KHR',['../struct_vma_vulkan_functions.html#a9cdcdc1e2b2ea7c571f7d27e30ba6875',1,'VmaVulkanFunctions']]], + ['vkgetinstanceprocaddr_22',['vkGetInstanceProcAddr',['../struct_vma_vulkan_functions.html#a3eafa102f5f8915f093f40675636b849',1,'VmaVulkanFunctions']]], + ['vkgetphysicaldevicememoryproperties_23',['vkGetPhysicalDeviceMemoryProperties',['../struct_vma_vulkan_functions.html#a60d25c33bba06bb8592e6875cbaa9830',1,'VmaVulkanFunctions']]], + ['vkgetphysicaldevicememoryproperties2khr_24',['vkGetPhysicalDeviceMemoryProperties2KHR',['../struct_vma_vulkan_functions.html#a0d992896e6ffcf92b9d7ea049fa5c445',1,'VmaVulkanFunctions']]], + ['vkgetphysicaldeviceproperties_25',['vkGetPhysicalDeviceProperties',['../struct_vma_vulkan_functions.html#a77b7a74082823e865dd6546623468f96',1,'VmaVulkanFunctions']]], + ['vkinvalidatemappedmemoryranges_26',['vkInvalidateMappedMemoryRanges',['../struct_vma_vulkan_functions.html#a5c1093bc32386a8060c37c9f282078a1',1,'VmaVulkanFunctions']]], + ['vkmapmemory_27',['vkMapMemory',['../struct_vma_vulkan_functions.html#ab5c1f38dea3a2cf00dc9eb4f57218c49',1,'VmaVulkanFunctions']]], + ['vkunmapmemory_28',['vkUnmapMemory',['../struct_vma_vulkan_functions.html#acc798589736f0becb317fc2196c1d8b9',1,'VmaVulkanFunctions']]], + ['vma_5fallocation_5fcreate_5fcan_5falias_5fbit_29',['VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597afb0ee060cd733aaa5e249704ff589ad6',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fdedicated_5fmemory_5fbit_30',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_31',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_32',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fmapped_5fbit_33',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_34',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5freserved_5f1_5fbit_35',['VMA_ALLOCATION_CREATE_RESERVED_1_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad7e8035e8edecd8dfa1f32a194bdf103',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5freserved_5f2_5fbit_36',['VMA_ALLOCATION_CREATE_RESERVED_2_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae9290dbcf5817e7616d5802e2aa251e7',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_37',['VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a839826775c62319466441f86496f036d',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5ffirst_5ffit_5fbit_38',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fmask_39',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_40',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a621b704103eb3360230c860acf36e706',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_41',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8af1210cf591784afa026d94998f735d',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_42',['VMA_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a0729e932b7ea170e3a128cad96c5cf6d',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fstrategy_5fworst_5ffit_5fbit_43',['VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad242a04f802e25fef0b880afe8bb0a62',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fupper_5faddress_5fbit_44',['VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a42ba3a2d2c7117953210b7c3ef8da0df',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fuser_5fdata_5fcopy_5fstring_5fbit_45',['VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fwithin_5fbudget_5fbit_46',['VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5famd_5fdevice_5fcoherent_5fmemory_5fbit_47',['VMA_ALLOCATOR_CREATE_AMD_DEVICE_COHERENT_MEMORY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca2acce4886d8078552efa38878413970f',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fbuffer_5fdevice_5faddress_5fbit_48',['VMA_ALLOCATOR_CREATE_BUFFER_DEVICE_ADDRESS_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca5f1b28b0414319d1687e1f2b30ab0089',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fext_5fmemory_5fbudget_5fbit_49',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4d4687863f7bd4b418c6006dc04400b0',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fext_5fmemory_5fpriority_5fbit_50',['VMA_ALLOCATOR_CREATE_EXT_MEMORY_PRIORITY_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7caffdd7a5169be3dbd7cbf6b3619e4f78a',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fexternally_5fsynchronized_5fbit_51',['VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca4816ddaed324ba110172ca608a20f29d',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fflag_5fbits_5fmax_5fenum_52',['VMA_ALLOCATOR_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cae4d5ad929caba5f23eb502b13bd5286c',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fkhr_5fbind_5fmemory2_5fbit_53',['VMA_ALLOCATOR_CREATE_KHR_BIND_MEMORY2_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7ca8fb75bf07cd184ab903596295e863dee',1,'vk_mem_alloc.h']]], + ['vma_5fallocator_5fcreate_5fkhr_5fdedicated_5fallocation_5fbit_54',['VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878',1,'vk_mem_alloc.h']]], + ['vma_5fbind_5fmemory2_55',['VMA_BIND_MEMORY2',['../vk__mem__alloc_8h.html#a88bef97f86d70a34a4c0746e09a2680d',1,'vk_mem_alloc.h']]], + ['vma_5fbuffer_5fdevice_5faddress_56',['VMA_BUFFER_DEVICE_ADDRESS',['../vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10',1,'vk_mem_alloc.h']]], + ['vma_5fdedicated_5fallocation_57',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fflag_5fbits_5fmax_5fenum_58',['VMA_DEFRAGMENTATION_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50cab87ec33154803bfeb5ac2b379f1d6a97',1,'vk_mem_alloc.h']]], + ['vma_5fdefragmentation_5fflag_5fincremental_59',['VMA_DEFRAGMENTATION_FLAG_INCREMENTAL',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50ca31af49446af2459284a568ce2f3fdd33',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fbudget_60',['VMA_MEMORY_BUDGET',['../vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fcpu_5fcopy_61',['VMA_MEMORY_USAGE_CPU_COPY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca416a444d4d0fc20067c3f76f32ff2500',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fcpu_5fonly_62',['VMA_MEMORY_USAGE_CPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fcpu_5fto_5fgpu_63',['VMA_MEMORY_USAGE_CPU_TO_GPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fgpu_5flazily_5fallocated_64',['VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca835333d9072db63a653818030e17614d',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fgpu_5fonly_65',['VMA_MEMORY_USAGE_GPU_ONLY',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fgpu_5fto_5fcpu_66',['VMA_MEMORY_USAGE_GPU_TO_CPU',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca7b586d2fdaf82a463b58f581ed72be27',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5fmax_5fenum_67',['VMA_MEMORY_USAGE_MAX_ENUM',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]], + ['vma_5fmemory_5fusage_5funknown_68',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5falgorithm_5fmask_69',['VMA_POOL_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7af4d270f8f42517a0f70037ceb6ac1d9c',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5fbuddy_5falgorithm_5fbit_70',['VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a97a0dc38e5161b780594d998d313d35e',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_71',['VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5fignore_5fbuffer_5fimage_5fgranularity_5fbit_72',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]], + ['vma_5fpool_5fcreate_5flinear_5falgorithm_5fbit_73',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]], + ['vma_5fstats_5fstring_5fenabled_74',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_75',['VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmask_76',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_77',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9aa0c32667ba2deaa9cdeac6149ec47a',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_78',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ae2a9591a62b5e3b1bdcbc81c6188a1bf',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_79',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a562d10a46012719d33167d3dc5dbbf9b',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fupper_5faddress_5fbit_80',['VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9524a329a55b5ec390d57d90b67ad78e',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5falgorithm_5fmask_81',['VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaaf9487467136e1a9e371894dc3a7c4844',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5fbuddy_5falgorithm_5fbit_82',['VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa923116612509e26bf84982b9baf25c63',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5fflag_5fbits_5fmax_5fenum_83',['VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa5fc0d333c3d5687a8bbf57df9b377a87',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5flinear_5falgorithm_5fbit_84',['VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96',1,'vk_mem_alloc.h']]], + ['vmaallocatememory_85',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]], + ['vmaallocatememoryforbuffer_86',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]], + ['vmaallocatememoryforimage_87',['vmaAllocateMemoryForImage',['../vk__mem__alloc_8h.html#a0faa3f9e5fb233d29d1e00390650febb',1,'vk_mem_alloc.h']]], + ['vmaallocatememorypages_88',['vmaAllocateMemoryPages',['../vk__mem__alloc_8h.html#ad37e82e492b3de38fc3f4cffd9ad0ae1',1,'vk_mem_alloc.h']]], + ['vmaallocation_89',['VmaAllocation',['../struct_vma_allocation.html',1,'']]], + ['vmaallocationcreateflagbits_90',['VmaAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a4fceecc301f4064dc808d3cd6c038941',1,'VmaAllocationCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597',1,'VmaAllocationCreateFlagBits(): vk_mem_alloc.h']]], + ['vmaallocationcreateflags_91',['VmaAllocationCreateFlags',['../vk__mem__alloc_8h.html#a5225e5e11f8376f6a31a1791f3d6e817',1,'vk_mem_alloc.h']]], + ['vmaallocationcreateinfo_92',['VmaAllocationCreateInfo',['../struct_vma_allocation_create_info.html',1,'VmaAllocationCreateInfo'],['../vk__mem__alloc_8h.html#a3bf110892ea2fb4649fedb68488d026a',1,'VmaAllocationCreateInfo(): vk_mem_alloc.h']]], + ['vmaallocationinfo_93',['VmaAllocationInfo',['../struct_vma_allocation_info.html',1,'VmaAllocationInfo'],['../vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50',1,'VmaAllocationInfo(): vk_mem_alloc.h']]], + ['vmaallocator_94',['VmaAllocator',['../struct_vma_allocator.html',1,'']]], + ['vmaallocatorcreateflagbits_95',['VmaAllocatorCreateFlagBits',['../vk__mem__alloc_8h.html#afd73b95e737ee7e76f827cb5472f559f',1,'VmaAllocatorCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7c',1,'VmaAllocatorCreateFlagBits(): vk_mem_alloc.h']]], + ['vmaallocatorcreateflags_96',['VmaAllocatorCreateFlags',['../vk__mem__alloc_8h.html#acfe6863e160722c2c1bbcf7573fddc4d',1,'vk_mem_alloc.h']]], + ['vmaallocatorcreateinfo_97',['VmaAllocatorCreateInfo',['../struct_vma_allocator_create_info.html',1,'VmaAllocatorCreateInfo'],['../vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a',1,'VmaAllocatorCreateInfo(): vk_mem_alloc.h']]], + ['vmaallocatorinfo_98',['VmaAllocatorInfo',['../struct_vma_allocator_info.html',1,'VmaAllocatorInfo'],['../vk__mem__alloc_8h.html#a1988031b0223fdbd564250fa1edd942c',1,'VmaAllocatorInfo(): vk_mem_alloc.h']]], + ['vmabegindefragmentationpass_99',['vmaBeginDefragmentationPass',['../vk__mem__alloc_8h.html#ac0f01545b6262f7d4d128fc8f8e5c77b',1,'vk_mem_alloc.h']]], + ['vmabindbuffermemory_100',['vmaBindBufferMemory',['../vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470',1,'vk_mem_alloc.h']]], + ['vmabindbuffermemory2_101',['vmaBindBufferMemory2',['../vk__mem__alloc_8h.html#a927c944f45e0f2941182abb6f608e64a',1,'vk_mem_alloc.h']]], + ['vmabindimagememory_102',['vmaBindImageMemory',['../vk__mem__alloc_8h.html#a3d3ca45799923aa5d138e9e5f9eb2da5',1,'vk_mem_alloc.h']]], + ['vmabindimagememory2_103',['vmaBindImageMemory2',['../vk__mem__alloc_8h.html#aa8251ee81b0045a443e35b8e8aa021bc',1,'vk_mem_alloc.h']]], + ['vmabudget_104',['VmaBudget',['../struct_vma_budget.html',1,'VmaBudget'],['../vk__mem__alloc_8h.html#aa078667e71b1ef24e87a6a30d128381d',1,'VmaBudget(): vk_mem_alloc.h']]], + ['vmabuildstatsstring_105',['vmaBuildStatsString',['../vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0',1,'vk_mem_alloc.h']]], + ['vmabuildvirtualblockstatsstring_106',['vmaBuildVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a52d810e1222c592e5d80556ad005f1e6',1,'vk_mem_alloc.h']]], + ['vmacalculatestats_107',['vmaCalculateStats',['../vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3',1,'vk_mem_alloc.h']]], + ['vmacalculatevirtualblockstats_108',['vmaCalculateVirtualBlockStats',['../vk__mem__alloc_8h.html#a95169b4730e94757897470086ec2768a',1,'vk_mem_alloc.h']]], + ['vmacheckcorruption_109',['vmaCheckCorruption',['../vk__mem__alloc_8h.html#a49329a7f030dafcf82f7b73334c22e98',1,'vk_mem_alloc.h']]], + ['vmacheckpoolcorruption_110',['vmaCheckPoolCorruption',['../vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89',1,'vk_mem_alloc.h']]], + ['vmaclearvirtualblock_111',['vmaClearVirtualBlock',['../vk__mem__alloc_8h.html#a5eda6f55919fb05bd2f56a112590c571',1,'vk_mem_alloc.h']]], + ['vmacreateallocator_112',['vmaCreateAllocator',['../vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb',1,'vk_mem_alloc.h']]], + ['vmacreatebuffer_113',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]], + ['vmacreatebufferwithalignment_114',['vmaCreateBufferWithAlignment',['../vk__mem__alloc_8h.html#aa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]], + ['vmacreateimage_115',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]], + ['vmacreatepool_116',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], + ['vmacreatevirtualblock_117',['vmaCreateVirtualBlock',['../vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], + ['vmadefragment_118',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]], + ['vmadefragmentationbegin_119',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]], + ['vmadefragmentationcontext_120',['VmaDefragmentationContext',['../struct_vma_defragmentation_context.html',1,'']]], + ['vmadefragmentationend_121',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]], + ['vmadefragmentationflagbits_122',['VmaDefragmentationFlagBits',['../vk__mem__alloc_8h.html#a13415cc0b443353a7b5abda300b833fc',1,'VmaDefragmentationFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50c',1,'VmaDefragmentationFlagBits(): vk_mem_alloc.h']]], + ['vmadefragmentationflags_123',['VmaDefragmentationFlags',['../vk__mem__alloc_8h.html#a88a77cef37e5d3c4fc9eb328885d048d',1,'vk_mem_alloc.h']]], + ['vmadefragmentationinfo_124',['VmaDefragmentationInfo',['../struct_vma_defragmentation_info.html',1,'VmaDefragmentationInfo'],['../vk__mem__alloc_8h.html#a2bf47f96bf92bed2a49461bd9af3acfa',1,'VmaDefragmentationInfo(): vk_mem_alloc.h']]], + ['vmadefragmentationinfo2_125',['VmaDefragmentationInfo2',['../struct_vma_defragmentation_info2.html',1,'VmaDefragmentationInfo2'],['../vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937',1,'VmaDefragmentationInfo2(): vk_mem_alloc.h']]], + ['vmadefragmentationpassinfo_126',['VmaDefragmentationPassInfo',['../struct_vma_defragmentation_pass_info.html',1,'VmaDefragmentationPassInfo'],['../vk__mem__alloc_8h.html#a72aebd522242d56abea67b4f47f6549e',1,'VmaDefragmentationPassInfo(): vk_mem_alloc.h']]], + ['vmadefragmentationpassmoveinfo_127',['VmaDefragmentationPassMoveInfo',['../struct_vma_defragmentation_pass_move_info.html',1,'VmaDefragmentationPassMoveInfo'],['../vk__mem__alloc_8h.html#ad6799e8e2b1527abfc84d33bc44aeaf5',1,'VmaDefragmentationPassMoveInfo(): vk_mem_alloc.h']]], + ['vmadefragmentationstats_128',['VmaDefragmentationStats',['../struct_vma_defragmentation_stats.html',1,'VmaDefragmentationStats'],['../vk__mem__alloc_8h.html#ad94034192259c2e34a4d1c5e27810403',1,'VmaDefragmentationStats(): vk_mem_alloc.h']]], + ['vmadestroyallocator_129',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], + ['vmadestroybuffer_130',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], + ['vmadestroyimage_131',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], + ['vmadestroypool_132',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], + ['vmadestroyvirtualblock_133',['vmaDestroyVirtualBlock',['../vk__mem__alloc_8h.html#a3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], + ['vmadevicememorycallbacks_134',['VmaDeviceMemoryCallbacks',['../struct_vma_device_memory_callbacks.html',1,'VmaDeviceMemoryCallbacks'],['../vk__mem__alloc_8h.html#a77692d3c8770ea8882d573206bd27b2b',1,'VmaDeviceMemoryCallbacks(): vk_mem_alloc.h']]], + ['vmaenddefragmentationpass_135',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindex_136',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforbufferinfo_137',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforimageinfo_138',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], + ['vmaflushallocation_139',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], + ['vmaflushallocations_140',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], + ['vmafreememory_141',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]], + ['vmafreememorypages_142',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], + ['vmafreestatsstring_143',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], + ['vmafreevirtualblockstatsstring_144',['vmaFreeVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], + ['vmagetallocationinfo_145',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], + ['vmagetallocationmemoryproperties_146',['vmaGetAllocationMemoryProperties',['../vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], + ['vmagetallocatorinfo_147',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], + ['vmagetheapbudgets_148',['vmaGetHeapBudgets',['../vk__mem__alloc_8h.html#a9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], + ['vmagetmemoryproperties_149',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], + ['vmagetmemorytypeproperties_150',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], + ['vmagetphysicaldeviceproperties_151',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], + ['vmagetpoolname_152',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], + ['vmagetpoolstats_153',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]], + ['vmagetvirtualallocationinfo_154',['vmaGetVirtualAllocationInfo',['../vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocation_155',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocations_156',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], + ['vmaisvirtualblockempty_157',['vmaIsVirtualBlockEmpty',['../vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], + ['vmamapmemory_158',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], + ['vmamemoryusage_159',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc',1,'VmaMemoryUsage(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a806e8499dde802e59eb72a1dc811c35f',1,'VmaMemoryUsage(): vk_mem_alloc.h']]], + ['vmapool_160',['VmaPool',['../struct_vma_pool.html',1,'']]], + ['vmapoolcreateflagbits_161',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a4d4f2efc2509157a9e4ecd4fd7942303',1,'VmaPoolCreateFlagBits(): vk_mem_alloc.h']]], + ['vmapoolcreateflags_162',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]], + ['vmapoolcreateinfo_163',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'VmaPoolCreateInfo'],['../vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67',1,'VmaPoolCreateInfo(): vk_mem_alloc.h']]], + ['vmapoolstats_164',['VmaPoolStats',['../vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1',1,'VmaPoolStats(): vk_mem_alloc.h'],['../struct_vma_pool_stats.html',1,'VmaPoolStats']]], + ['vmasetallocationuserdata_165',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], + ['vmasetcurrentframeindex_166',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], + ['vmasetpoolname_167',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], + ['vmasetvirtualallocationuserdata_168',['vmaSetVirtualAllocationUserData',['../vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9',1,'vk_mem_alloc.h']]], + ['vmastatinfo_169',['VmaStatInfo',['../struct_vma_stat_info.html',1,'VmaStatInfo'],['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'VmaStatInfo(): vk_mem_alloc.h']]], + ['vmastats_170',['VmaStats',['../struct_vma_stats.html',1,'VmaStats'],['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'VmaStats(): vk_mem_alloc.h']]], + ['vmaunmapmemory_171',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], + ['vmavirtualallocate_172',['vmaVirtualAllocate',['../vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2',1,'vk_mem_alloc.h']]], + ['vmavirtualallocationcreateflagbits_173',['VmaVirtualAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6',1,'VmaVirtualAllocationCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a936815e64946a6b6d812d08d10184c23',1,'VmaVirtualAllocationCreateFlagBits(): vk_mem_alloc.h']]], + ['vmavirtualallocationcreateflags_174',['VmaVirtualAllocationCreateFlags',['../vk__mem__alloc_8h.html#ae96ffc099bf898257fb19e9410ed08a7',1,'vk_mem_alloc.h']]], + ['vmavirtualallocationcreateinfo_175',['VmaVirtualAllocationCreateInfo',['../struct_vma_virtual_allocation_create_info.html',1,'VmaVirtualAllocationCreateInfo'],['../vk__mem__alloc_8h.html#ac3c90d80bedc6847a41b82d0e2158c9e',1,'VmaVirtualAllocationCreateInfo(): vk_mem_alloc.h']]], + ['vmavirtualallocationinfo_176',['VmaVirtualAllocationInfo',['../struct_vma_virtual_allocation_info.html',1,'VmaVirtualAllocationInfo'],['../vk__mem__alloc_8h.html#a75bc33ff7cf18c98e101f570dc2a5ebc',1,'VmaVirtualAllocationInfo(): vk_mem_alloc.h']]], + ['vmavirtualblock_177',['VmaVirtualBlock',['../struct_vma_virtual_block.html',1,'']]], + ['vmavirtualblockcreateflagbits_178',['VmaVirtualBlockCreateFlagBits',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bca',1,'VmaVirtualBlockCreateFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#a0860ba1c0a67178fae4aecb63a78573e',1,'VmaVirtualBlockCreateFlagBits(): vk_mem_alloc.h']]], + ['vmavirtualblockcreateflags_179',['VmaVirtualBlockCreateFlags',['../vk__mem__alloc_8h.html#a4e49c2f0ab7f6b4868833e5bac78d91e',1,'vk_mem_alloc.h']]], + ['vmavirtualblockcreateinfo_180',['VmaVirtualBlockCreateInfo',['../struct_vma_virtual_block_create_info.html',1,'VmaVirtualBlockCreateInfo'],['../vk__mem__alloc_8h.html#a4753d42d40217a3a652a3cdf253ad773',1,'VmaVirtualBlockCreateInfo(): vk_mem_alloc.h']]], + ['vmavirtualfree_181',['vmaVirtualFree',['../vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639',1,'vk_mem_alloc.h']]], + ['vmavulkanfunctions_182',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'VmaVulkanFunctions(): vk_mem_alloc.h'],['../struct_vma_vulkan_functions.html',1,'VmaVulkanFunctions']]], + ['vulkan_20memory_20allocator_183',['Vulkan Memory Allocator',['../index.html',1,'']]], + ['vulkanapiversion_184',['vulkanApiVersion',['../struct_vma_allocator_create_info.html#ae0ffc55139b54520a6bb704b29ffc285',1,'VmaAllocatorCreateInfo']]] ]; diff --git a/docs/html/search/all_5.js b/docs/html/search/all_5.js index 4c9ae19..0bcc998 100644 --- a/docs/html/search/all_5.js +++ b/docs/html/search/all_5.js @@ -1,5 +1,4 @@ var searchData= [ - ['flags_0',['flags',['../struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a',1,'VmaRecordSettings::flags()'],['../struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346',1,'VmaAllocatorCreateInfo::flags()'],['../struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b',1,'VmaAllocationCreateInfo::flags()'],['../struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446',1,'VmaPoolCreateInfo::flags()'],['../struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9',1,'VmaDefragmentationInfo2::flags()'],['../struct_vma_virtual_block_create_info.html#a5838b15c053a0370420e4e1d82d09c09',1,'VmaVirtualBlockCreateInfo::flags()'],['../struct_vma_virtual_allocation_create_info.html#ab10e16956cc4bf20ced9de77d1129ea4',1,'VmaVirtualAllocationCreateInfo::flags()']]], - ['frameinusecount_1',['frameInUseCount',['../struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7',1,'VmaAllocatorCreateInfo::frameInUseCount()'],['../struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa',1,'VmaPoolCreateInfo::frameInUseCount()']]] + ['flags_0',['flags',['../struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346',1,'VmaAllocatorCreateInfo::flags()'],['../struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b',1,'VmaAllocationCreateInfo::flags()'],['../struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446',1,'VmaPoolCreateInfo::flags()'],['../struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9',1,'VmaDefragmentationInfo2::flags()'],['../struct_vma_virtual_block_create_info.html#a5838b15c053a0370420e4e1d82d09c09',1,'VmaVirtualBlockCreateInfo::flags()'],['../struct_vma_virtual_allocation_create_info.html#ab10e16956cc4bf20ced9de77d1129ea4',1,'VmaVirtualAllocationCreateInfo::flags()']]] ]; diff --git a/docs/html/search/all_8.js b/docs/html/search/all_8.js index f78b393..f57997b 100644 --- a/docs/html/search/all_8.js +++ b/docs/html/search/all_8.js @@ -1,4 +1,19 @@ var searchData= [ - ['lost_20allocations_0',['Lost allocations',['../lost_allocations.html',1,'index']]] + ['maxallocationstomove_0',['maxAllocationsToMove',['../struct_vma_defragmentation_info.html#aa7c7304e13c71f604c907196c4e28fbc',1,'VmaDefragmentationInfo']]], + ['maxblockcount_1',['maxBlockCount',['../struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c',1,'VmaPoolCreateInfo']]], + ['maxbytestomove_2',['maxBytesToMove',['../struct_vma_defragmentation_info.html#acb311c940a777270e67e1b81c5ab6a1d',1,'VmaDefragmentationInfo']]], + ['maxcpuallocationstomove_3',['maxCpuAllocationsToMove',['../struct_vma_defragmentation_info2.html#a94c2c7223d52878445a8cccce396b671',1,'VmaDefragmentationInfo2']]], + ['maxcpubytestomove_4',['maxCpuBytesToMove',['../struct_vma_defragmentation_info2.html#af78e1ea40c22d85137b65f6b384a4d0a',1,'VmaDefragmentationInfo2']]], + ['maxgpuallocationstomove_5',['maxGpuAllocationsToMove',['../struct_vma_defragmentation_info2.html#a40d53d33e71ba0b66f844ed63c05a3f6',1,'VmaDefragmentationInfo2']]], + ['maxgpubytestomove_6',['maxGpuBytesToMove',['../struct_vma_defragmentation_info2.html#a4ddbc898d0afe1518f863a3763628f08',1,'VmaDefragmentationInfo2']]], + ['memory_7',['memory',['../struct_vma_defragmentation_pass_move_info.html#a06eb0c8690aa0d3478a036753492e769',1,'VmaDefragmentationPassMoveInfo']]], + ['memory_20mapping_8',['Memory mapping',['../memory_mapping.html',1,'index']]], + ['memoryheap_9',['memoryHeap',['../struct_vma_stats.html#a0e6611508c29a187f0fd14ff1a0329c0',1,'VmaStats']]], + ['memorytype_10',['memoryType',['../struct_vma_stats.html#a13e3caf754be79352c42408756309331',1,'VmaStats::memoryType()'],['../struct_vma_allocation_info.html#a7f6b0aa58c135e488e6b40a388dad9d5',1,'VmaAllocationInfo::memoryType()']]], + ['memorytypebits_11',['memoryTypeBits',['../struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055',1,'VmaAllocationCreateInfo']]], + ['memorytypeindex_12',['memoryTypeIndex',['../struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319',1,'VmaPoolCreateInfo']]], + ['minallocationalignment_13',['minAllocationAlignment',['../struct_vma_pool_create_info.html#ade3eca546f0c6ab4e8fbf20eb6d854cb',1,'VmaPoolCreateInfo']]], + ['minblockcount_14',['minBlockCount',['../struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae',1,'VmaPoolCreateInfo']]], + ['movecount_15',['moveCount',['../struct_vma_defragmentation_pass_info.html#ac1086e657ba995f8d1f4e49b83dcfb6c',1,'VmaDefragmentationPassInfo']]] ]; diff --git a/docs/html/search/all_9.js b/docs/html/search/all_9.js index f57997b..1a6f3c7 100644 --- a/docs/html/search/all_9.js +++ b/docs/html/search/all_9.js @@ -1,19 +1,5 @@ var searchData= [ - ['maxallocationstomove_0',['maxAllocationsToMove',['../struct_vma_defragmentation_info.html#aa7c7304e13c71f604c907196c4e28fbc',1,'VmaDefragmentationInfo']]], - ['maxblockcount_1',['maxBlockCount',['../struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c',1,'VmaPoolCreateInfo']]], - ['maxbytestomove_2',['maxBytesToMove',['../struct_vma_defragmentation_info.html#acb311c940a777270e67e1b81c5ab6a1d',1,'VmaDefragmentationInfo']]], - ['maxcpuallocationstomove_3',['maxCpuAllocationsToMove',['../struct_vma_defragmentation_info2.html#a94c2c7223d52878445a8cccce396b671',1,'VmaDefragmentationInfo2']]], - ['maxcpubytestomove_4',['maxCpuBytesToMove',['../struct_vma_defragmentation_info2.html#af78e1ea40c22d85137b65f6b384a4d0a',1,'VmaDefragmentationInfo2']]], - ['maxgpuallocationstomove_5',['maxGpuAllocationsToMove',['../struct_vma_defragmentation_info2.html#a40d53d33e71ba0b66f844ed63c05a3f6',1,'VmaDefragmentationInfo2']]], - ['maxgpubytestomove_6',['maxGpuBytesToMove',['../struct_vma_defragmentation_info2.html#a4ddbc898d0afe1518f863a3763628f08',1,'VmaDefragmentationInfo2']]], - ['memory_7',['memory',['../struct_vma_defragmentation_pass_move_info.html#a06eb0c8690aa0d3478a036753492e769',1,'VmaDefragmentationPassMoveInfo']]], - ['memory_20mapping_8',['Memory mapping',['../memory_mapping.html',1,'index']]], - ['memoryheap_9',['memoryHeap',['../struct_vma_stats.html#a0e6611508c29a187f0fd14ff1a0329c0',1,'VmaStats']]], - ['memorytype_10',['memoryType',['../struct_vma_stats.html#a13e3caf754be79352c42408756309331',1,'VmaStats::memoryType()'],['../struct_vma_allocation_info.html#a7f6b0aa58c135e488e6b40a388dad9d5',1,'VmaAllocationInfo::memoryType()']]], - ['memorytypebits_11',['memoryTypeBits',['../struct_vma_allocation_create_info.html#a3bf940c0271d85d6ba32a4d820075055',1,'VmaAllocationCreateInfo']]], - ['memorytypeindex_12',['memoryTypeIndex',['../struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319',1,'VmaPoolCreateInfo']]], - ['minallocationalignment_13',['minAllocationAlignment',['../struct_vma_pool_create_info.html#ade3eca546f0c6ab4e8fbf20eb6d854cb',1,'VmaPoolCreateInfo']]], - ['minblockcount_14',['minBlockCount',['../struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae',1,'VmaPoolCreateInfo']]], - ['movecount_15',['moveCount',['../struct_vma_defragmentation_pass_info.html#ac1086e657ba995f8d1f4e49b83dcfb6c',1,'VmaDefragmentationPassInfo']]] + ['offset_0',['offset',['../struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268',1,'VmaAllocationInfo::offset()'],['../struct_vma_defragmentation_pass_move_info.html#a8ab4508bc03625b0653c880576be96c6',1,'VmaDefragmentationPassMoveInfo::offset()']]], + ['opengl_20interop_1',['OpenGL Interop',['../opengl_interop.html',1,'index']]] ]; diff --git a/docs/html/search/all_a.js b/docs/html/search/all_a.js index 1a6f3c7..f0a2911 100644 --- a/docs/html/search/all_a.js +++ b/docs/html/search/all_a.js @@ -1,5 +1,25 @@ var searchData= [ - ['offset_0',['offset',['../struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268',1,'VmaAllocationInfo::offset()'],['../struct_vma_defragmentation_pass_move_info.html#a8ab4508bc03625b0653c880576be96c6',1,'VmaDefragmentationPassMoveInfo::offset()']]], - ['opengl_20interop_1',['OpenGL Interop',['../opengl_interop.html',1,'index']]] + ['pallocationcallbacks_0',['pAllocationCallbacks',['../struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d',1,'VmaAllocatorCreateInfo::pAllocationCallbacks()'],['../struct_vma_virtual_block_create_info.html#a290283bf915c257d24584872d793ad30',1,'VmaVirtualBlockCreateInfo::pAllocationCallbacks()']]], + ['pallocations_1',['pAllocations',['../struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32',1,'VmaDefragmentationInfo2']]], + ['pallocationschanged_2',['pAllocationsChanged',['../struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc',1,'VmaDefragmentationInfo2']]], + ['pdevicememorycallbacks_3',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]], + ['pfn_5fvmaallocatedevicememoryfunction_4',['PFN_vmaAllocateDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a7e1ed85f7799600b03ad51a77acc21f3',1,'vk_mem_alloc.h']]], + ['pfn_5fvmafreedevicememoryfunction_5',['PFN_vmaFreeDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a154ccaaf53dc2c36378f80f0c4f3679b',1,'vk_mem_alloc.h']]], + ['pfnallocate_6',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]], + ['pfnfree_7',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]], + ['pheapsizelimit_8',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]], + ['physicaldevice_9',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo::physicalDevice()'],['../struct_vma_allocator_info.html#aba2b703f96e51d567717e1fb2935b47a',1,'VmaAllocatorInfo::physicalDevice()']]], + ['pmappeddata_10',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]], + ['pmemoryallocatenext_11',['pMemoryAllocateNext',['../struct_vma_pool_create_info.html#af0f8c58f51a2a7a0a389dc79565044d7',1,'VmaPoolCreateInfo']]], + ['pmoves_12',['pMoves',['../struct_vma_defragmentation_pass_info.html#acbd42d4a3357999da130a95cd99a3792',1,'VmaDefragmentationPassInfo']]], + ['pool_13',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]], + ['poolcount_14',['poolCount',['../struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d',1,'VmaDefragmentationInfo2']]], + ['ppools_15',['pPools',['../struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b',1,'VmaDefragmentationInfo2']]], + ['preferredflags_16',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]], + ['preferredlargeheapblocksize_17',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]], + ['priority_18',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority()'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority()']]], + ['ptypeexternalmemoryhandletypes_19',['pTypeExternalMemoryHandleTypes',['../struct_vma_allocator_create_info.html#ae8f0db05e5cb4c43d7713bf4a49a736b',1,'VmaAllocatorCreateInfo']]], + ['puserdata_20',['pUserData',['../struct_vma_device_memory_callbacks.html#a24052de0937ddd54015a2df0363903c6',1,'VmaDeviceMemoryCallbacks::pUserData()'],['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()'],['../struct_vma_virtual_allocation_create_info.html#a015f8544ca51a7350f7434d42d0587bb',1,'VmaVirtualAllocationCreateInfo::pUserData()'],['../struct_vma_virtual_allocation_info.html#a41d5cb09357656411653d82fee436f45',1,'VmaVirtualAllocationInfo::pUserData()']]], + ['pvulkanfunctions_21',['pVulkanFunctions',['../struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd',1,'VmaAllocatorCreateInfo']]] ]; diff --git a/docs/html/search/all_b.js b/docs/html/search/all_b.js index 3aa705f..813ffa8 100644 --- a/docs/html/search/all_b.js +++ b/docs/html/search/all_b.js @@ -1,27 +1,4 @@ var searchData= [ - ['pallocationcallbacks_0',['pAllocationCallbacks',['../struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d',1,'VmaAllocatorCreateInfo::pAllocationCallbacks()'],['../struct_vma_virtual_block_create_info.html#a290283bf915c257d24584872d793ad30',1,'VmaVirtualBlockCreateInfo::pAllocationCallbacks()']]], - ['pallocations_1',['pAllocations',['../struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32',1,'VmaDefragmentationInfo2']]], - ['pallocationschanged_2',['pAllocationsChanged',['../struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc',1,'VmaDefragmentationInfo2']]], - ['pdevicememorycallbacks_3',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]], - ['pfilepath_4',['pFilePath',['../struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d',1,'VmaRecordSettings']]], - ['pfn_5fvmaallocatedevicememoryfunction_5',['PFN_vmaAllocateDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a7e1ed85f7799600b03ad51a77acc21f3',1,'vk_mem_alloc.h']]], - ['pfn_5fvmafreedevicememoryfunction_6',['PFN_vmaFreeDeviceMemoryFunction',['../vk__mem__alloc_8h.html#a154ccaaf53dc2c36378f80f0c4f3679b',1,'vk_mem_alloc.h']]], - ['pfnallocate_7',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]], - ['pfnfree_8',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]], - ['pheapsizelimit_9',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]], - ['physicaldevice_10',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo::physicalDevice()'],['../struct_vma_allocator_info.html#aba2b703f96e51d567717e1fb2935b47a',1,'VmaAllocatorInfo::physicalDevice()']]], - ['pmappeddata_11',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]], - ['pmemoryallocatenext_12',['pMemoryAllocateNext',['../struct_vma_pool_create_info.html#af0f8c58f51a2a7a0a389dc79565044d7',1,'VmaPoolCreateInfo']]], - ['pmoves_13',['pMoves',['../struct_vma_defragmentation_pass_info.html#acbd42d4a3357999da130a95cd99a3792',1,'VmaDefragmentationPassInfo']]], - ['pool_14',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]], - ['poolcount_15',['poolCount',['../struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d',1,'VmaDefragmentationInfo2']]], - ['ppools_16',['pPools',['../struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b',1,'VmaDefragmentationInfo2']]], - ['precordsettings_17',['pRecordSettings',['../struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee',1,'VmaAllocatorCreateInfo']]], - ['preferredflags_18',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]], - ['preferredlargeheapblocksize_19',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]], - ['priority_20',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority()'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority()']]], - ['ptypeexternalmemoryhandletypes_21',['pTypeExternalMemoryHandleTypes',['../struct_vma_allocator_create_info.html#ae8f0db05e5cb4c43d7713bf4a49a736b',1,'VmaAllocatorCreateInfo']]], - ['puserdata_22',['pUserData',['../struct_vma_device_memory_callbacks.html#a24052de0937ddd54015a2df0363903c6',1,'VmaDeviceMemoryCallbacks::pUserData()'],['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()'],['../struct_vma_virtual_allocation_create_info.html#a015f8544ca51a7350f7434d42d0587bb',1,'VmaVirtualAllocationCreateInfo::pUserData()'],['../struct_vma_virtual_allocation_info.html#a41d5cb09357656411653d82fee436f45',1,'VmaVirtualAllocationInfo::pUserData()']]], - ['pvulkanfunctions_23',['pVulkanFunctions',['../struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd',1,'VmaAllocatorCreateInfo']]] + ['quick_20start_0',['Quick start',['../quick_start.html',1,'index']]] ]; diff --git a/docs/html/search/all_c.js b/docs/html/search/all_c.js index 813ffa8..8ba2438 100644 --- a/docs/html/search/all_c.js +++ b/docs/html/search/all_c.js @@ -1,4 +1,6 @@ var searchData= [ - ['quick_20start_0',['Quick start',['../quick_start.html',1,'index']]] + ['recommended_20usage_20patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], + ['requiredflags_1',['requiredFlags',['../struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90',1,'VmaAllocationCreateInfo']]], + ['resource_20aliasing_20_28overlap_29_2',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]] ]; diff --git a/docs/html/search/all_d.js b/docs/html/search/all_d.js index 472b93b..4d46ccb 100644 --- a/docs/html/search/all_d.js +++ b/docs/html/search/all_d.js @@ -1,7 +1,6 @@ var searchData= [ - ['recommended_20usage_20patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], - ['record_20and_20replay_1',['Record and replay',['../record_and_replay.html',1,'index']]], - ['requiredflags_2',['requiredFlags',['../struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90',1,'VmaAllocationCreateInfo']]], - ['resource_20aliasing_20_28overlap_29_3',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]] + ['size_0',['size',['../struct_vma_pool_stats.html#a326807b2de2b0931cee4ed9a5f2e420c',1,'VmaPoolStats::size()'],['../struct_vma_allocation_info.html#aac76d113a6a5ccbb09fea00fb25fd18f',1,'VmaAllocationInfo::size()'],['../struct_vma_virtual_block_create_info.html#a670ab8c6a6e822f3c36781d79e8824e9',1,'VmaVirtualBlockCreateInfo::size()'],['../struct_vma_virtual_allocation_create_info.html#aae08752b86817abd0d944c6025dc603e',1,'VmaVirtualAllocationCreateInfo::size()'],['../struct_vma_virtual_allocation_info.html#afb6d6bd0a6813869ea0842048d40aa2b',1,'VmaVirtualAllocationInfo::size()']]], + ['statistics_1',['Statistics',['../statistics.html',1,'index']]], + ['staying_20within_20budget_2',['Staying within budget',['../staying_within_budget.html',1,'index']]] ]; diff --git a/docs/html/search/all_e.js b/docs/html/search/all_e.js index 4d46ccb..0114695 100644 --- a/docs/html/search/all_e.js +++ b/docs/html/search/all_e.js @@ -1,6 +1,4 @@ var searchData= [ - ['size_0',['size',['../struct_vma_pool_stats.html#a326807b2de2b0931cee4ed9a5f2e420c',1,'VmaPoolStats::size()'],['../struct_vma_allocation_info.html#aac76d113a6a5ccbb09fea00fb25fd18f',1,'VmaAllocationInfo::size()'],['../struct_vma_virtual_block_create_info.html#a670ab8c6a6e822f3c36781d79e8824e9',1,'VmaVirtualBlockCreateInfo::size()'],['../struct_vma_virtual_allocation_create_info.html#aae08752b86817abd0d944c6025dc603e',1,'VmaVirtualAllocationCreateInfo::size()'],['../struct_vma_virtual_allocation_info.html#afb6d6bd0a6813869ea0842048d40aa2b',1,'VmaVirtualAllocationInfo::size()']]], - ['statistics_1',['Statistics',['../statistics.html',1,'index']]], - ['staying_20within_20budget_2',['Staying within budget',['../staying_within_budget.html',1,'index']]] + ['total_0',['total',['../struct_vma_stats.html#a2e8f5b3353f2fefef3c27f29e245a1f9',1,'VmaStats']]] ]; diff --git a/docs/html/search/all_f.js b/docs/html/search/all_f.js index 0114695..0e382e2 100644 --- a/docs/html/search/all_f.js +++ b/docs/html/search/all_f.js @@ -1,4 +1,11 @@ var searchData= [ - ['total_0',['total',['../struct_vma_stats.html#a2e8f5b3353f2fefef3c27f29e245a1f9',1,'VmaStats']]] + ['unusedbytes_0',['unusedBytes',['../struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669',1,'VmaStatInfo']]], + ['unusedrangecount_1',['unusedRangeCount',['../struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9',1,'VmaStatInfo::unusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]], + ['unusedrangesizeavg_2',['unusedRangeSizeAvg',['../struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc',1,'VmaStatInfo']]], + ['unusedrangesizemax_3',['unusedRangeSizeMax',['../struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4',1,'VmaStatInfo']]], + ['unusedrangesizemin_4',['unusedRangeSizeMin',['../struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4',1,'VmaStatInfo']]], + ['unusedsize_5',['unusedSize',['../struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8',1,'VmaPoolStats']]], + ['usage_6',['usage',['../struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6',1,'VmaBudget::usage()'],['../struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910',1,'VmaAllocationCreateInfo::usage()']]], + ['usedbytes_7',['usedBytes',['../struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a',1,'VmaStatInfo']]] ]; diff --git a/docs/html/search/classes_0.js b/docs/html/search/classes_0.js index 9d96cc2..45a57db 100644 --- a/docs/html/search/classes_0.js +++ b/docs/html/search/classes_0.js @@ -17,12 +17,11 @@ var searchData= ['vmapool_14',['VmaPool',['../struct_vma_pool.html',1,'']]], ['vmapoolcreateinfo_15',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'']]], ['vmapoolstats_16',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'']]], - ['vmarecordsettings_17',['VmaRecordSettings',['../struct_vma_record_settings.html',1,'']]], - ['vmastatinfo_18',['VmaStatInfo',['../struct_vma_stat_info.html',1,'']]], - ['vmastats_19',['VmaStats',['../struct_vma_stats.html',1,'']]], - ['vmavirtualallocationcreateinfo_20',['VmaVirtualAllocationCreateInfo',['../struct_vma_virtual_allocation_create_info.html',1,'']]], - ['vmavirtualallocationinfo_21',['VmaVirtualAllocationInfo',['../struct_vma_virtual_allocation_info.html',1,'']]], - ['vmavirtualblock_22',['VmaVirtualBlock',['../struct_vma_virtual_block.html',1,'']]], - ['vmavirtualblockcreateinfo_23',['VmaVirtualBlockCreateInfo',['../struct_vma_virtual_block_create_info.html',1,'']]], - ['vmavulkanfunctions_24',['VmaVulkanFunctions',['../struct_vma_vulkan_functions.html',1,'']]] + ['vmastatinfo_17',['VmaStatInfo',['../struct_vma_stat_info.html',1,'']]], + ['vmastats_18',['VmaStats',['../struct_vma_stats.html',1,'']]], + ['vmavirtualallocationcreateinfo_19',['VmaVirtualAllocationCreateInfo',['../struct_vma_virtual_allocation_create_info.html',1,'']]], + ['vmavirtualallocationinfo_20',['VmaVirtualAllocationInfo',['../struct_vma_virtual_allocation_info.html',1,'']]], + ['vmavirtualblock_21',['VmaVirtualBlock',['../struct_vma_virtual_block.html',1,'']]], + ['vmavirtualblockcreateinfo_22',['VmaVirtualBlockCreateInfo',['../struct_vma_virtual_block_create_info.html',1,'']]], + ['vmavulkanfunctions_23',['VmaVulkanFunctions',['../struct_vma_vulkan_functions.html',1,'']]] ]; diff --git a/docs/html/search/defines_0.js b/docs/html/search/defines_0.js index 9f25a56..53d488c 100644 --- a/docs/html/search/defines_0.js +++ b/docs/html/search/defines_0.js @@ -5,6 +5,5 @@ var searchData= ['vma_5fbuffer_5fdevice_5faddress_2',['VMA_BUFFER_DEVICE_ADDRESS',['../vk__mem__alloc_8h.html#a7f9d5e71b70dd1a137c303a8a8262c10',1,'vk_mem_alloc.h']]], ['vma_5fdedicated_5fallocation_3',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]], ['vma_5fmemory_5fbudget_4',['VMA_MEMORY_BUDGET',['../vk__mem__alloc_8h.html#a05decf1cf4ebf767beba7acca6c1ec3a',1,'vk_mem_alloc.h']]], - ['vma_5frecording_5fenabled_5',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]], - ['vma_5fstats_5fstring_5fenabled_6',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]] + ['vma_5fstats_5fstring_5fenabled_5',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]] ]; diff --git a/docs/html/search/enums_0.js b/docs/html/search/enums_0.js index 8b8f792..6697dbd 100644 --- a/docs/html/search/enums_0.js +++ b/docs/html/search/enums_0.js @@ -5,7 +5,6 @@ var searchData= ['vmadefragmentationflagbits_2',['VmaDefragmentationFlagBits',['../vk__mem__alloc_8h.html#a6552a65b71d16f378c6994b3ceaef50c',1,'vk_mem_alloc.h']]], ['vmamemoryusage_3',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc',1,'vk_mem_alloc.h']]], ['vmapoolcreateflagbits_4',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'vk_mem_alloc.h']]], - ['vmarecordflagbits_5',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2',1,'vk_mem_alloc.h']]], - ['vmavirtualallocationcreateflagbits_6',['VmaVirtualAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6',1,'vk_mem_alloc.h']]], - ['vmavirtualblockcreateflagbits_7',['VmaVirtualBlockCreateFlagBits',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bca',1,'vk_mem_alloc.h']]] + ['vmavirtualallocationcreateflagbits_5',['VmaVirtualAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6',1,'vk_mem_alloc.h']]], + ['vmavirtualblockcreateflagbits_6',['VmaVirtualBlockCreateFlagBits',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bca',1,'vk_mem_alloc.h']]] ]; diff --git a/docs/html/search/enumvalues_0.js b/docs/html/search/enumvalues_0.js index 0e267dc..5f9dc1e 100644 --- a/docs/html/search/enumvalues_0.js +++ b/docs/html/search/enumvalues_0.js @@ -1,13 +1,13 @@ var searchData= [ ['vma_5fallocation_5fcreate_5fcan_5falias_5fbit_0',['VMA_ALLOCATION_CREATE_CAN_ALIAS_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597afb0ee060cd733aaa5e249704ff589ad6',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fcan_5fbecome_5flost_5fbit_1',['VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fcan_5fmake_5fother_5flost_5fbit_2',['VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fdedicated_5fmemory_5fbit_3',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_4',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_5',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fmapped_5fbit_6',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]], - ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_7',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fdedicated_5fmemory_5fbit_1',['VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fdont_5fbind_5fbit_2',['VMA_ALLOCATION_CREATE_DONT_BIND_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_3',['VMA_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae5633ec569f4899cf8f29e7385b2f882',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fmapped_5fbit_4',['VMA_ALLOCATION_CREATE_MAPPED_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5fnever_5fallocate_5fbit_5',['VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5freserved_5f1_5fbit_6',['VMA_ALLOCATION_CREATE_RESERVED_1_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad7e8035e8edecd8dfa1f32a194bdf103',1,'vk_mem_alloc.h']]], + ['vma_5fallocation_5fcreate_5freserved_5f2_5fbit_7',['VMA_ALLOCATION_CREATE_RESERVED_2_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae9290dbcf5817e7616d5802e2aa251e7',1,'vk_mem_alloc.h']]], ['vma_5fallocation_5fcreate_5fstrategy_5fbest_5ffit_5fbit_8',['VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a839826775c62319466441f86496f036d',1,'vk_mem_alloc.h']]], ['vma_5fallocation_5fcreate_5fstrategy_5ffirst_5ffit_5fbit_9',['VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a33eb2052674f3ad92386c714a65fb777',1,'vk_mem_alloc.h']]], ['vma_5fallocation_5fcreate_5fstrategy_5fmask_10',['VMA_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a8e16845d81ae3d27c47106d4770d5c7e',1,'vk_mem_alloc.h']]], @@ -41,16 +41,14 @@ var searchData= ['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum_38',['VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec',1,'vk_mem_alloc.h']]], ['vma_5fpool_5fcreate_5fignore_5fbuffer_5fimage_5fgranularity_5fbit_39',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]], ['vma_5fpool_5fcreate_5flinear_5falgorithm_5fbit_40',['VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a13c8a444197c67866be9cb05599fc726',1,'vk_mem_alloc.h']]], - ['vma_5frecord_5fflag_5fbits_5fmax_5fenum_41',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]], - ['vma_5frecord_5fflush_5fafter_5fcall_5fbit_42',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_43',['VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmask_44',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_45',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9aa0c32667ba2deaa9cdeac6149ec47a',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_46',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ae2a9591a62b5e3b1bdcbc81c6188a1bf',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_47',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a562d10a46012719d33167d3dc5dbbf9b',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fallocation_5fcreate_5fupper_5faddress_5fbit_48',['VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9524a329a55b5ec390d57d90b67ad78e',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fblock_5fcreate_5falgorithm_5fmask_49',['VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaaf9487467136e1a9e371894dc3a7c4844',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fblock_5fcreate_5fbuddy_5falgorithm_5fbit_50',['VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa923116612509e26bf84982b9baf25c63',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fblock_5fcreate_5fflag_5fbits_5fmax_5fenum_51',['VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa5fc0d333c3d5687a8bbf57df9b377a87',1,'vk_mem_alloc.h']]], - ['vma_5fvirtual_5fblock_5fcreate_5flinear_5falgorithm_5fbit_52',['VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96',1,'vk_mem_alloc.h']]] + ['vma_5fvirtual_5fallocation_5fcreate_5fflag_5fbits_5fmax_5fenum_41',['VMA_VIRTUAL_ALLOCATION_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac1163c03ea837fa663462dc286d6a1a9',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmask_42',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MASK',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ac5b5e45c335368d18df59c9f27df17e3',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ffragmentation_5fbit_43',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_FRAGMENTATION_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9aa0c32667ba2deaa9cdeac6149ec47a',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5fmemory_5fbit_44',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_MEMORY_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6ae2a9591a62b5e3b1bdcbc81c6188a1bf',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fstrategy_5fmin_5ftime_5fbit_45',['VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a562d10a46012719d33167d3dc5dbbf9b',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fallocation_5fcreate_5fupper_5faddress_5fbit_46',['VMA_VIRTUAL_ALLOCATION_CREATE_UPPER_ADDRESS_BIT',['../vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a9524a329a55b5ec390d57d90b67ad78e',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5falgorithm_5fmask_47',['VMA_VIRTUAL_BLOCK_CREATE_ALGORITHM_MASK',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaaf9487467136e1a9e371894dc3a7c4844',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5fbuddy_5falgorithm_5fbit_48',['VMA_VIRTUAL_BLOCK_CREATE_BUDDY_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa923116612509e26bf84982b9baf25c63',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5fflag_5fbits_5fmax_5fenum_49',['VMA_VIRTUAL_BLOCK_CREATE_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaa5fc0d333c3d5687a8bbf57df9b377a87',1,'vk_mem_alloc.h']]], + ['vma_5fvirtual_5fblock_5fcreate_5flinear_5falgorithm_5fbit_50',['VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT',['../vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96',1,'vk_mem_alloc.h']]] ]; diff --git a/docs/html/search/functions_0.js b/docs/html/search/functions_0.js index 793c21c..685cdbb 100644 --- a/docs/html/search/functions_0.js +++ b/docs/html/search/functions_0.js @@ -20,48 +20,45 @@ var searchData= ['vmacreatebuffer_17',['vmaCreateBuffer',['../vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51',1,'vk_mem_alloc.h']]], ['vmacreatebufferwithalignment_18',['vmaCreateBufferWithAlignment',['../vk__mem__alloc_8h.html#aa06a690013a0d01e60894ac378083834',1,'vk_mem_alloc.h']]], ['vmacreateimage_19',['vmaCreateImage',['../vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73',1,'vk_mem_alloc.h']]], - ['vmacreatelostallocation_20',['vmaCreateLostAllocation',['../vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1',1,'vk_mem_alloc.h']]], - ['vmacreatepool_21',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], - ['vmacreatevirtualblock_22',['vmaCreateVirtualBlock',['../vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], - ['vmadefragment_23',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]], - ['vmadefragmentationbegin_24',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]], - ['vmadefragmentationend_25',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]], - ['vmadestroyallocator_26',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], - ['vmadestroybuffer_27',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], - ['vmadestroyimage_28',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], - ['vmadestroypool_29',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], - ['vmadestroyvirtualblock_30',['vmaDestroyVirtualBlock',['../vk__mem__alloc_8h.html#a3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], - ['vmaenddefragmentationpass_31',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindex_32',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindexforbufferinfo_33',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], - ['vmafindmemorytypeindexforimageinfo_34',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], - ['vmaflushallocation_35',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], - ['vmaflushallocations_36',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], - ['vmafreememory_37',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]], - ['vmafreememorypages_38',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], - ['vmafreestatsstring_39',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], - ['vmafreevirtualblockstatsstring_40',['vmaFreeVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], - ['vmagetallocationinfo_41',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], - ['vmagetallocationmemoryproperties_42',['vmaGetAllocationMemoryProperties',['../vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], - ['vmagetallocatorinfo_43',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], - ['vmagetheapbudgets_44',['vmaGetHeapBudgets',['../vk__mem__alloc_8h.html#a9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], - ['vmagetmemoryproperties_45',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], - ['vmagetmemorytypeproperties_46',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], - ['vmagetphysicaldeviceproperties_47',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], - ['vmagetpoolname_48',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], - ['vmagetpoolstats_49',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]], - ['vmagetvirtualallocationinfo_50',['vmaGetVirtualAllocationInfo',['../vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e',1,'vk_mem_alloc.h']]], - ['vmainvalidateallocation_51',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], - ['vmainvalidateallocations_52',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], - ['vmaisvirtualblockempty_53',['vmaIsVirtualBlockEmpty',['../vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], - ['vmamakepoolallocationslost_54',['vmaMakePoolAllocationsLost',['../vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024',1,'vk_mem_alloc.h']]], - ['vmamapmemory_55',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], - ['vmasetallocationuserdata_56',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], - ['vmasetcurrentframeindex_57',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], - ['vmasetpoolname_58',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], - ['vmasetvirtualallocationuserdata_59',['vmaSetVirtualAllocationUserData',['../vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9',1,'vk_mem_alloc.h']]], - ['vmatouchallocation_60',['vmaTouchAllocation',['../vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a',1,'vk_mem_alloc.h']]], - ['vmaunmapmemory_61',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], - ['vmavirtualallocate_62',['vmaVirtualAllocate',['../vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2',1,'vk_mem_alloc.h']]], - ['vmavirtualfree_63',['vmaVirtualFree',['../vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639',1,'vk_mem_alloc.h']]] + ['vmacreatepool_20',['vmaCreatePool',['../vk__mem__alloc_8h.html#a5c8770ded7c59c8caac6de0c2cb00b50',1,'vk_mem_alloc.h']]], + ['vmacreatevirtualblock_21',['vmaCreateVirtualBlock',['../vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b',1,'vk_mem_alloc.h']]], + ['vmadefragment_22',['vmaDefragment',['../vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac',1,'vk_mem_alloc.h']]], + ['vmadefragmentationbegin_23',['vmaDefragmentationBegin',['../vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a',1,'vk_mem_alloc.h']]], + ['vmadefragmentationend_24',['vmaDefragmentationEnd',['../vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2',1,'vk_mem_alloc.h']]], + ['vmadestroyallocator_25',['vmaDestroyAllocator',['../vk__mem__alloc_8h.html#aa8d164061c88f22fb1fd3c8f3534bc1d',1,'vk_mem_alloc.h']]], + ['vmadestroybuffer_26',['vmaDestroyBuffer',['../vk__mem__alloc_8h.html#a0d9f4e4ba5bf9aab1f1c746387753d77',1,'vk_mem_alloc.h']]], + ['vmadestroyimage_27',['vmaDestroyImage',['../vk__mem__alloc_8h.html#ae50d2cb3b4a3bfd4dd40987234e50e7e',1,'vk_mem_alloc.h']]], + ['vmadestroypool_28',['vmaDestroyPool',['../vk__mem__alloc_8h.html#a5485779c8f1948238fc4e92232fa65e1',1,'vk_mem_alloc.h']]], + ['vmadestroyvirtualblock_29',['vmaDestroyVirtualBlock',['../vk__mem__alloc_8h.html#a3795f7783ae2c182cede067d656f66a5',1,'vk_mem_alloc.h']]], + ['vmaenddefragmentationpass_30',['vmaEndDefragmentationPass',['../vk__mem__alloc_8h.html#a1b9ffa538bed905af55c747cc48963bd',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindex_31',['vmaFindMemoryTypeIndex',['../vk__mem__alloc_8h.html#aef15a94b58fbcb0fe706d5720e84a74a',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforbufferinfo_32',['vmaFindMemoryTypeIndexForBufferInfo',['../vk__mem__alloc_8h.html#ae790ab9ffaf7667fb8f62523e6897888',1,'vk_mem_alloc.h']]], + ['vmafindmemorytypeindexforimageinfo_33',['vmaFindMemoryTypeIndexForImageInfo',['../vk__mem__alloc_8h.html#a088da83d8eaf3ce9056d9ea0b981d472',1,'vk_mem_alloc.h']]], + ['vmaflushallocation_34',['vmaFlushAllocation',['../vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f',1,'vk_mem_alloc.h']]], + ['vmaflushallocations_35',['vmaFlushAllocations',['../vk__mem__alloc_8h.html#ac3dd00da721875ed99fa8a881922bdfc',1,'vk_mem_alloc.h']]], + ['vmafreememory_36',['vmaFreeMemory',['../vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f',1,'vk_mem_alloc.h']]], + ['vmafreememorypages_37',['vmaFreeMemoryPages',['../vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e',1,'vk_mem_alloc.h']]], + ['vmafreestatsstring_38',['vmaFreeStatsString',['../vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288',1,'vk_mem_alloc.h']]], + ['vmafreevirtualblockstatsstring_39',['vmaFreeVirtualBlockStatsString',['../vk__mem__alloc_8h.html#a47fb8d8aa69df4a7c23a9719b4080623',1,'vk_mem_alloc.h']]], + ['vmagetallocationinfo_40',['vmaGetAllocationInfo',['../vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b',1,'vk_mem_alloc.h']]], + ['vmagetallocationmemoryproperties_41',['vmaGetAllocationMemoryProperties',['../vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1',1,'vk_mem_alloc.h']]], + ['vmagetallocatorinfo_42',['vmaGetAllocatorInfo',['../vk__mem__alloc_8h.html#afa02231a791b37255720d566a52683e7',1,'vk_mem_alloc.h']]], + ['vmagetheapbudgets_43',['vmaGetHeapBudgets',['../vk__mem__alloc_8h.html#a9f88db9d46a432c0ad7278cecbc5eaa7',1,'vk_mem_alloc.h']]], + ['vmagetmemoryproperties_44',['vmaGetMemoryProperties',['../vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19',1,'vk_mem_alloc.h']]], + ['vmagetmemorytypeproperties_45',['vmaGetMemoryTypeProperties',['../vk__mem__alloc_8h.html#a8701444752eb5de4464adb5a2b514bca',1,'vk_mem_alloc.h']]], + ['vmagetphysicaldeviceproperties_46',['vmaGetPhysicalDeviceProperties',['../vk__mem__alloc_8h.html#aecabf7b6e91ea87d0316fa0a9e014fe0',1,'vk_mem_alloc.h']]], + ['vmagetpoolname_47',['vmaGetPoolName',['../vk__mem__alloc_8h.html#af09b4e4eafdbee812e8d73ddf960f030',1,'vk_mem_alloc.h']]], + ['vmagetpoolstats_48',['vmaGetPoolStats',['../vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153',1,'vk_mem_alloc.h']]], + ['vmagetvirtualallocationinfo_49',['vmaGetVirtualAllocationInfo',['../vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocation_50',['vmaInvalidateAllocation',['../vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae',1,'vk_mem_alloc.h']]], + ['vmainvalidateallocations_51',['vmaInvalidateAllocations',['../vk__mem__alloc_8h.html#ab25b558d75f7378ec944a1522fdcc3c5',1,'vk_mem_alloc.h']]], + ['vmaisvirtualblockempty_52',['vmaIsVirtualBlockEmpty',['../vk__mem__alloc_8h.html#acd53b5b1d23f8fcbad692ccfdc1811f1',1,'vk_mem_alloc.h']]], + ['vmamapmemory_53',['vmaMapMemory',['../vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069',1,'vk_mem_alloc.h']]], + ['vmasetallocationuserdata_54',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]], + ['vmasetcurrentframeindex_55',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]], + ['vmasetpoolname_56',['vmaSetPoolName',['../vk__mem__alloc_8h.html#adbae3a0b4ab078024462fc85c37f3b58',1,'vk_mem_alloc.h']]], + ['vmasetvirtualallocationuserdata_57',['vmaSetVirtualAllocationUserData',['../vk__mem__alloc_8h.html#a4b96f835d38686df937e097a0c7db5e9',1,'vk_mem_alloc.h']]], + ['vmaunmapmemory_58',['vmaUnmapMemory',['../vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45',1,'vk_mem_alloc.h']]], + ['vmavirtualallocate_59',['vmaVirtualAllocate',['../vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2',1,'vk_mem_alloc.h']]], + ['vmavirtualfree_60',['vmaVirtualFree',['../vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639',1,'vk_mem_alloc.h']]] ]; diff --git a/docs/html/search/pages_5.js b/docs/html/search/pages_5.js index f78b393..665bff8 100644 --- a/docs/html/search/pages_5.js +++ b/docs/html/search/pages_5.js @@ -1,4 +1,4 @@ var searchData= [ - ['lost_20allocations_0',['Lost allocations',['../lost_allocations.html',1,'index']]] + ['memory_20mapping_0',['Memory mapping',['../memory_mapping.html',1,'index']]] ]; diff --git a/docs/html/search/pages_6.js b/docs/html/search/pages_6.js index 665bff8..12ce939 100644 --- a/docs/html/search/pages_6.js +++ b/docs/html/search/pages_6.js @@ -1,4 +1,4 @@ var searchData= [ - ['memory_20mapping_0',['Memory mapping',['../memory_mapping.html',1,'index']]] + ['opengl_20interop_0',['OpenGL Interop',['../opengl_interop.html',1,'index']]] ]; diff --git a/docs/html/search/pages_7.js b/docs/html/search/pages_7.js index 12ce939..813ffa8 100644 --- a/docs/html/search/pages_7.js +++ b/docs/html/search/pages_7.js @@ -1,4 +1,4 @@ var searchData= [ - ['opengl_20interop_0',['OpenGL Interop',['../opengl_interop.html',1,'index']]] + ['quick_20start_0',['Quick start',['../quick_start.html',1,'index']]] ]; diff --git a/docs/html/search/pages_8.js b/docs/html/search/pages_8.js index 813ffa8..1e5106f 100644 --- a/docs/html/search/pages_8.js +++ b/docs/html/search/pages_8.js @@ -1,4 +1,5 @@ var searchData= [ - ['quick_20start_0',['Quick start',['../quick_start.html',1,'index']]] + ['recommended_20usage_20patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], + ['resource_20aliasing_20_28overlap_29_1',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]] ]; diff --git a/docs/html/search/pages_9.js b/docs/html/search/pages_9.js index 7fed4f7..e35b6a0 100644 --- a/docs/html/search/pages_9.js +++ b/docs/html/search/pages_9.js @@ -1,6 +1,5 @@ var searchData= [ - ['recommended_20usage_20patterns_0',['Recommended usage patterns',['../usage_patterns.html',1,'index']]], - ['record_20and_20replay_1',['Record and replay',['../record_and_replay.html',1,'index']]], - ['resource_20aliasing_20_28overlap_29_2',['Resource aliasing (overlap)',['../resource_aliasing.html',1,'index']]] + ['statistics_0',['Statistics',['../statistics.html',1,'index']]], + ['staying_20within_20budget_1',['Staying within budget',['../staying_within_budget.html',1,'index']]] ]; diff --git a/docs/html/search/pages_a.js b/docs/html/search/pages_a.js index e35b6a0..6fb4603 100644 --- a/docs/html/search/pages_a.js +++ b/docs/html/search/pages_a.js @@ -1,5 +1,7 @@ var searchData= [ - ['statistics_0',['Statistics',['../statistics.html',1,'index']]], - ['staying_20within_20budget_1',['Staying within budget',['../staying_within_budget.html',1,'index']]] + ['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_5fkhr_5fdedicated_5fallocation_2',['VK_KHR_dedicated_allocation',['../vk_khr_dedicated_allocation.html',1,'index']]], + ['vulkan_20memory_20allocator_3',['Vulkan Memory Allocator',['../index.html',1,'']]] ]; diff --git a/docs/html/search/searchdata.js b/docs/html/search/searchdata.js index 5cd88d0..205f9b0 100644 --- a/docs/html/search/searchdata.js +++ b/docs/html/search/searchdata.js @@ -1,6 +1,6 @@ var indexSectionsWithContent = { - 0: "abcdefgilmopqrstuv", + 0: "abcdefgimopqrstuv", 1: "v", 2: "v", 3: "v", @@ -9,7 +9,7 @@ var indexSectionsWithContent = 6: "v", 7: "v", 8: "v", - 9: "acdeglmoqrsv" + 9: "acdegmoqrsv" }; var indexSectionNames = diff --git a/docs/html/search/typedefs_1.js b/docs/html/search/typedefs_1.js index d6b8534..372f76f 100644 --- a/docs/html/search/typedefs_1.js +++ b/docs/html/search/typedefs_1.js @@ -22,17 +22,14 @@ var searchData= ['vmapoolcreateflags_19',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]], ['vmapoolcreateinfo_20',['VmaPoolCreateInfo',['../vk__mem__alloc_8h.html#a1017aa83489c0eee8d2163d2bf253f67',1,'vk_mem_alloc.h']]], ['vmapoolstats_21',['VmaPoolStats',['../vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1',1,'vk_mem_alloc.h']]], - ['vmarecordflagbits_22',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#acd24d5eb58abff7e1f43cb32a1ba1413',1,'vk_mem_alloc.h']]], - ['vmarecordflags_23',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]], - ['vmarecordsettings_24',['VmaRecordSettings',['../vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc',1,'vk_mem_alloc.h']]], - ['vmastatinfo_25',['VmaStatInfo',['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'vk_mem_alloc.h']]], - ['vmastats_26',['VmaStats',['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'vk_mem_alloc.h']]], - ['vmavirtualallocationcreateflagbits_27',['VmaVirtualAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a936815e64946a6b6d812d08d10184c23',1,'vk_mem_alloc.h']]], - ['vmavirtualallocationcreateflags_28',['VmaVirtualAllocationCreateFlags',['../vk__mem__alloc_8h.html#ae96ffc099bf898257fb19e9410ed08a7',1,'vk_mem_alloc.h']]], - ['vmavirtualallocationcreateinfo_29',['VmaVirtualAllocationCreateInfo',['../vk__mem__alloc_8h.html#ac3c90d80bedc6847a41b82d0e2158c9e',1,'vk_mem_alloc.h']]], - ['vmavirtualallocationinfo_30',['VmaVirtualAllocationInfo',['../vk__mem__alloc_8h.html#a75bc33ff7cf18c98e101f570dc2a5ebc',1,'vk_mem_alloc.h']]], - ['vmavirtualblockcreateflagbits_31',['VmaVirtualBlockCreateFlagBits',['../vk__mem__alloc_8h.html#a0860ba1c0a67178fae4aecb63a78573e',1,'vk_mem_alloc.h']]], - ['vmavirtualblockcreateflags_32',['VmaVirtualBlockCreateFlags',['../vk__mem__alloc_8h.html#a4e49c2f0ab7f6b4868833e5bac78d91e',1,'vk_mem_alloc.h']]], - ['vmavirtualblockcreateinfo_33',['VmaVirtualBlockCreateInfo',['../vk__mem__alloc_8h.html#a4753d42d40217a3a652a3cdf253ad773',1,'vk_mem_alloc.h']]], - ['vmavulkanfunctions_34',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'vk_mem_alloc.h']]] + ['vmastatinfo_22',['VmaStatInfo',['../vk__mem__alloc_8h.html#aec5b57e29c97b5d69c6d5654d60df878',1,'vk_mem_alloc.h']]], + ['vmastats_23',['VmaStats',['../vk__mem__alloc_8h.html#a21813b2efdf3836767a9058cd8a94034',1,'vk_mem_alloc.h']]], + ['vmavirtualallocationcreateflagbits_24',['VmaVirtualAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#a936815e64946a6b6d812d08d10184c23',1,'vk_mem_alloc.h']]], + ['vmavirtualallocationcreateflags_25',['VmaVirtualAllocationCreateFlags',['../vk__mem__alloc_8h.html#ae96ffc099bf898257fb19e9410ed08a7',1,'vk_mem_alloc.h']]], + ['vmavirtualallocationcreateinfo_26',['VmaVirtualAllocationCreateInfo',['../vk__mem__alloc_8h.html#ac3c90d80bedc6847a41b82d0e2158c9e',1,'vk_mem_alloc.h']]], + ['vmavirtualallocationinfo_27',['VmaVirtualAllocationInfo',['../vk__mem__alloc_8h.html#a75bc33ff7cf18c98e101f570dc2a5ebc',1,'vk_mem_alloc.h']]], + ['vmavirtualblockcreateflagbits_28',['VmaVirtualBlockCreateFlagBits',['../vk__mem__alloc_8h.html#a0860ba1c0a67178fae4aecb63a78573e',1,'vk_mem_alloc.h']]], + ['vmavirtualblockcreateflags_29',['VmaVirtualBlockCreateFlags',['../vk__mem__alloc_8h.html#a4e49c2f0ab7f6b4868833e5bac78d91e',1,'vk_mem_alloc.h']]], + ['vmavirtualblockcreateinfo_30',['VmaVirtualBlockCreateInfo',['../vk__mem__alloc_8h.html#a4753d42d40217a3a652a3cdf253ad773',1,'vk_mem_alloc.h']]], + ['vmavulkanfunctions_31',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074',1,'vk_mem_alloc.h']]] ]; diff --git a/docs/html/search/variables_4.js b/docs/html/search/variables_4.js index 4c9ae19..0bcc998 100644 --- a/docs/html/search/variables_4.js +++ b/docs/html/search/variables_4.js @@ -1,5 +1,4 @@ var searchData= [ - ['flags_0',['flags',['../struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a',1,'VmaRecordSettings::flags()'],['../struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346',1,'VmaAllocatorCreateInfo::flags()'],['../struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b',1,'VmaAllocationCreateInfo::flags()'],['../struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446',1,'VmaPoolCreateInfo::flags()'],['../struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9',1,'VmaDefragmentationInfo2::flags()'],['../struct_vma_virtual_block_create_info.html#a5838b15c053a0370420e4e1d82d09c09',1,'VmaVirtualBlockCreateInfo::flags()'],['../struct_vma_virtual_allocation_create_info.html#ab10e16956cc4bf20ced9de77d1129ea4',1,'VmaVirtualAllocationCreateInfo::flags()']]], - ['frameinusecount_1',['frameInUseCount',['../struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7',1,'VmaAllocatorCreateInfo::frameInUseCount()'],['../struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa',1,'VmaPoolCreateInfo::frameInUseCount()']]] + ['flags_0',['flags',['../struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346',1,'VmaAllocatorCreateInfo::flags()'],['../struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b',1,'VmaAllocationCreateInfo::flags()'],['../struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446',1,'VmaPoolCreateInfo::flags()'],['../struct_vma_defragmentation_info2.html#a53e844ee5633e229cf6daf14b2d9fff9',1,'VmaDefragmentationInfo2::flags()'],['../struct_vma_virtual_block_create_info.html#a5838b15c053a0370420e4e1d82d09c09',1,'VmaVirtualBlockCreateInfo::flags()'],['../struct_vma_virtual_allocation_create_info.html#ab10e16956cc4bf20ced9de77d1129ea4',1,'VmaVirtualAllocationCreateInfo::flags()']]] ]; diff --git a/docs/html/search/variables_8.js b/docs/html/search/variables_8.js index ecc194e..2e46be0 100644 --- a/docs/html/search/variables_8.js +++ b/docs/html/search/variables_8.js @@ -4,22 +4,20 @@ var searchData= ['pallocations_1',['pAllocations',['../struct_vma_defragmentation_info2.html#ab6d288f29d028156cf73542d630a2e32',1,'VmaDefragmentationInfo2']]], ['pallocationschanged_2',['pAllocationsChanged',['../struct_vma_defragmentation_info2.html#a76d51a644dc7f5405d0cdd0025ecd0cc',1,'VmaDefragmentationInfo2']]], ['pdevicememorycallbacks_3',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]], - ['pfilepath_4',['pFilePath',['../struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d',1,'VmaRecordSettings']]], - ['pfnallocate_5',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]], - ['pfnfree_6',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]], - ['pheapsizelimit_7',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]], - ['physicaldevice_8',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo::physicalDevice()'],['../struct_vma_allocator_info.html#aba2b703f96e51d567717e1fb2935b47a',1,'VmaAllocatorInfo::physicalDevice()']]], - ['pmappeddata_9',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]], - ['pmemoryallocatenext_10',['pMemoryAllocateNext',['../struct_vma_pool_create_info.html#af0f8c58f51a2a7a0a389dc79565044d7',1,'VmaPoolCreateInfo']]], - ['pmoves_11',['pMoves',['../struct_vma_defragmentation_pass_info.html#acbd42d4a3357999da130a95cd99a3792',1,'VmaDefragmentationPassInfo']]], - ['pool_12',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]], - ['poolcount_13',['poolCount',['../struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d',1,'VmaDefragmentationInfo2']]], - ['ppools_14',['pPools',['../struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b',1,'VmaDefragmentationInfo2']]], - ['precordsettings_15',['pRecordSettings',['../struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee',1,'VmaAllocatorCreateInfo']]], - ['preferredflags_16',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]], - ['preferredlargeheapblocksize_17',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]], - ['priority_18',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority()'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority()']]], - ['ptypeexternalmemoryhandletypes_19',['pTypeExternalMemoryHandleTypes',['../struct_vma_allocator_create_info.html#ae8f0db05e5cb4c43d7713bf4a49a736b',1,'VmaAllocatorCreateInfo']]], - ['puserdata_20',['pUserData',['../struct_vma_device_memory_callbacks.html#a24052de0937ddd54015a2df0363903c6',1,'VmaDeviceMemoryCallbacks::pUserData()'],['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()'],['../struct_vma_virtual_allocation_create_info.html#a015f8544ca51a7350f7434d42d0587bb',1,'VmaVirtualAllocationCreateInfo::pUserData()'],['../struct_vma_virtual_allocation_info.html#a41d5cb09357656411653d82fee436f45',1,'VmaVirtualAllocationInfo::pUserData()']]], - ['pvulkanfunctions_21',['pVulkanFunctions',['../struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd',1,'VmaAllocatorCreateInfo']]] + ['pfnallocate_4',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]], + ['pfnfree_5',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]], + ['pheapsizelimit_6',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]], + ['physicaldevice_7',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo::physicalDevice()'],['../struct_vma_allocator_info.html#aba2b703f96e51d567717e1fb2935b47a',1,'VmaAllocatorInfo::physicalDevice()']]], + ['pmappeddata_8',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]], + ['pmemoryallocatenext_9',['pMemoryAllocateNext',['../struct_vma_pool_create_info.html#af0f8c58f51a2a7a0a389dc79565044d7',1,'VmaPoolCreateInfo']]], + ['pmoves_10',['pMoves',['../struct_vma_defragmentation_pass_info.html#acbd42d4a3357999da130a95cd99a3792',1,'VmaDefragmentationPassInfo']]], + ['pool_11',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]], + ['poolcount_12',['poolCount',['../struct_vma_defragmentation_info2.html#a7e70aa2a1081d849dcc7829b19d3ec9d',1,'VmaDefragmentationInfo2']]], + ['ppools_13',['pPools',['../struct_vma_defragmentation_info2.html#a3c9c6aa5c97d5670f8e362b3a6f3029b',1,'VmaDefragmentationInfo2']]], + ['preferredflags_14',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]], + ['preferredlargeheapblocksize_15',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]], + ['priority_16',['priority',['../struct_vma_allocation_create_info.html#a983d39e1a2e63649d78a960aa2fdd0f7',1,'VmaAllocationCreateInfo::priority()'],['../struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274',1,'VmaPoolCreateInfo::priority()']]], + ['ptypeexternalmemoryhandletypes_17',['pTypeExternalMemoryHandleTypes',['../struct_vma_allocator_create_info.html#ae8f0db05e5cb4c43d7713bf4a49a736b',1,'VmaAllocatorCreateInfo']]], + ['puserdata_18',['pUserData',['../struct_vma_device_memory_callbacks.html#a24052de0937ddd54015a2df0363903c6',1,'VmaDeviceMemoryCallbacks::pUserData()'],['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()'],['../struct_vma_virtual_allocation_create_info.html#a015f8544ca51a7350f7434d42d0587bb',1,'VmaVirtualAllocationCreateInfo::pUserData()'],['../struct_vma_virtual_allocation_info.html#a41d5cb09357656411653d82fee436f45',1,'VmaVirtualAllocationInfo::pUserData()']]], + ['pvulkanfunctions_19',['pVulkanFunctions',['../struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd',1,'VmaAllocatorCreateInfo']]] ]; diff --git a/docs/html/search/variables_c.js b/docs/html/search/variables_c.js index 025dded..0e382e2 100644 --- a/docs/html/search/variables_c.js +++ b/docs/html/search/variables_c.js @@ -3,7 +3,7 @@ var searchData= ['unusedbytes_0',['unusedBytes',['../struct_vma_stat_info.html#a1859d290aca2cd582d8dc25922092669',1,'VmaStatInfo']]], ['unusedrangecount_1',['unusedRangeCount',['../struct_vma_stat_info.html#ae06129c771bfebfd6468a7f4276502a9',1,'VmaStatInfo::unusedRangeCount()'],['../struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4',1,'VmaPoolStats::unusedRangeCount()']]], ['unusedrangesizeavg_2',['unusedRangeSizeAvg',['../struct_vma_stat_info.html#a2f9b3452af90c9768a30b7fb6ae194fc',1,'VmaStatInfo']]], - ['unusedrangesizemax_3',['unusedRangeSizeMax',['../struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4',1,'VmaStatInfo::unusedRangeSizeMax()'],['../struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b',1,'VmaPoolStats::unusedRangeSizeMax()']]], + ['unusedrangesizemax_3',['unusedRangeSizeMax',['../struct_vma_stat_info.html#a5ba1a2476c4d39b10f7e2f7ebbb72ac4',1,'VmaStatInfo']]], ['unusedrangesizemin_4',['unusedRangeSizeMin',['../struct_vma_stat_info.html#aedeba931324f16589cd2416c0d2dd0d4',1,'VmaStatInfo']]], ['unusedsize_5',['unusedSize',['../struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8',1,'VmaPoolStats']]], ['usage_6',['usage',['../struct_vma_budget.html#a84dd1ecca8b0110259eb206dbadb11f6',1,'VmaBudget::usage()'],['../struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910',1,'VmaAllocationCreateInfo::usage()']]], diff --git a/docs/html/statistics.html b/docs/html/statistics.html index dce719f..eec3ff4 100644 --- a/docs/html/statistics.html +++ b/docs/html/statistics.html @@ -74,7 +74,7 @@ $(function() { Numeric statistics</h1> <p >You can query for overall statistics of the allocator using function <a class="el" href="vk__mem__alloc_8h.html#a333b61c1788cb23559177531e6a93ca3" title="Retrieves statistics from current state of the Allocator.">vmaCalculateStats()</a>. Information are returned using structure <a class="el" href="struct_vma_stats.html" title="General statistics from current state of Allocator.">VmaStats</a>. It contains <a class="el" href="struct_vma_stat_info.html" title="Calculated statistics of memory usage in entire allocator.">VmaStatInfo</a> - number of allocated blocks, number of allocations (occupied ranges in these blocks), number of unused (free) ranges in these blocks, number of bytes used and unused (but still allocated from Vulkan) and other information. They are summed across memory heaps, memory types and total for whole allocator.</p> <p >You can query for statistics of a custom pool using function <a class="el" href="vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153" title="Retrieves statistics of existing VmaPool object.">vmaGetPoolStats()</a>. Information are returned using structure <a class="el" href="struct_vma_pool_stats.html" title="Describes parameter of existing VmaPool.">VmaPoolStats</a>.</p> -<p >You can query for information about specific allocation using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>. It fill structure <a class="el" href="struct_vma_allocation_info.html" title="Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().">VmaAllocationInfo</a>.</p> +<p >You can query for information about specific allocation using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>. It fill structure <a class="el" href="struct_vma_allocation_info.html" title="Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().">VmaAllocationInfo</a>.</p> <h1><a class="anchor" id="statistics_json_dump"></a> JSON dump</h1> <p >You can dump internal state of the allocator to a string in JSON format using function <a class="el" href="vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0" title="Builds and returns statistics as a null-terminated string in JSON format.">vmaBuildStatsString()</a>. The result is guaranteed to be correct JSON. It uses ANSI encoding. Any strings provided by user (see <a class="el" href="allocation_annotation.html#allocation_names">Allocation names</a>) 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 <a class="el" href="vk__mem__alloc_8h.html#a3104eb30d8122c84dd8541063f145288">vmaFreeStatsString()</a>.</p> diff --git a/docs/html/staying_within_budget.html b/docs/html/staying_within_budget.html index 01dfb8f..93fc8ec 100644 --- a/docs/html/staying_within_budget.html +++ b/docs/html/staying_within_budget.html @@ -91,7 +91,7 @@ Querying for budget</h1> Controlling memory usage</h1> <p >There are many ways in which you can try to stay within the budget.</p> <p >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.</p> -<p >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 <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d">VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT</a> flag. With it, the allocation is not made if it would exceed the budget or if the budget is already exceeded. Some other allocations become lost instead to make room for it, if the mechanism of <a class="el" href="lost_allocations.html">lost allocations</a> is used. If that is not possible, the allocation fails with <code>VK_ERROR_OUT_OF_DEVICE_MEMORY</code>. Example usage pattern may be to pass the <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d">VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT</a> 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).</p> +<p >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 <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d">VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT</a> flag. With it, the allocation is not made if it would exceed the budget or if the budget is already exceeded. The allocation then fails with <code>VK_ERROR_OUT_OF_DEVICE_MEMORY</code>. Example usage pattern may be to pass the <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ab8b1764f3e9022368e440c057783b92d">VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT</a> 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).</p> <p >Finally, you can also use <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff" title="Set this flag to only try to allocate from existing VkDeviceMemory blocks and never create new such b...">VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT</a> 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 <code>VK_ERROR_OUT_OF_DEVICE_MEMORY</code>. This also ensures that the function call is very fast because it never goes to Vulkan to obtain a new block.</p> <p >Please note that creating <a class="el" href="custom_memory_pools.html">Custom memory pools</a> with <a class="el" href="struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae" title="Minimum number of blocks to be always allocated in this pool, even if they stay empty.">VmaPoolCreateInfo::minBlockCount</a> set to more than 0 will try to allocate memory blocks without checking whether they fit within budget. </p> </div></div><!-- contents --> diff --git a/docs/html/struct_vma_allocation.html b/docs/html/struct_vma_allocation.html index e1618f1..8be447a 100644 --- a/docs/html/struct_vma_allocation.html +++ b/docs/html/struct_vma_allocation.html @@ -75,8 +75,7 @@ $(function() { <p >It may be either dedicated block of <code>VkDeviceMemory</code> or a specific region of a bigger block of this type plus unique offset.</p> <p >There are multiple ways to create such object. You need to fill structure <a class="el" href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a>. For more information see <a class="el" href="choosing_memory_type.html">Choosing memory type</a>.</p> <p >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.</p> -<p >The object also remembers its size and some other information. To retrieve this information, use function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> and inspect returned structure <a class="el" href="struct_vma_allocation_info.html" title="Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().">VmaAllocationInfo</a>.</p> -<p >Some kinds allocations can be in lost state. For more information, see <a class="el" href="lost_allocations.html">Lost allocations</a>. </p> +<p >The object also remembers its size and some other information. To retrieve this information, use function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a> and inspect returned structure <a class="el" href="struct_vma_allocation_info.html" title="Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().">VmaAllocationInfo</a>. </p> </div><hr/>The documentation for this struct was generated from the following file:<ul> <li>D:/PROJECTS/Vulkan Memory Allocator/REPO/include/<a class="el" href="vk__mem__alloc_8h.html">vk_mem_alloc.h</a></li> </ul> diff --git a/docs/html/struct_vma_allocation_info.html b/docs/html/struct_vma_allocation_info.html index b83d3fa..287aa44 100644 --- a/docs/html/struct_vma_allocation_info.html +++ b/docs/html/struct_vma_allocation_info.html @@ -69,7 +69,7 @@ $(function() { </div><!--header--> <div class="contents"> -<p>Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>. +<p>Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>. <a href="struct_vma_allocation_info.html#details">More...</a></p> <p><code>#include <vk_mem_alloc.h></code></p> @@ -96,7 +96,7 @@ Public Attributes</h2></td></tr> <tr class="separator:adc507656149c04de7ed95d0042ba2a13"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> -<div class="textblock"><p >Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>. </p> +<div class="textblock"><p >Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>. </p> </div><h2 class="groupheader">Member Data Documentation</h2> <a id="ae0bfb7dfdf79a76ffefc9a94677a2f67" name="ae0bfb7dfdf79a76ffefc9a94677a2f67"></a> <h2 class="memtitle"><span class="permalink"><a href="#ae0bfb7dfdf79a76ffefc9a94677a2f67">◆ </a></span>deviceMemory</h2> @@ -112,8 +112,7 @@ Public Attributes</h2></td></tr> <p>Handle to Vulkan memory object. </p> <p >Same memory object can be shared by multiple allocations.</p> -<p >It can change after call to <a class="el" href="vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac" title="Deprecated. Compacts memory by moving allocations.">vmaDefragment()</a> if this allocation is passed to the function, or if allocation is lost.</p> -<p >If the allocation is lost, it is equal to <code>VK_NULL_HANDLE</code>. </p> +<p >It can change after call to <a class="el" href="vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac" title="Deprecated. Compacts memory by moving allocations.">vmaDefragment()</a> if this allocation is passed to the function. </p> </div> </div> @@ -148,7 +147,7 @@ Public Attributes</h2></td></tr> <p>Offset in <code>VkDeviceMemory</code> object to the beginning of this allocation, in bytes. <code>(deviceMemory, offset)</code> pair is unique to this allocation. </p> <p >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 <a class="el" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer()</a>, <a class="el" href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73" title="Function similar to vmaCreateBuffer().">vmaCreateImage()</a>, functions that operate on these resources refer to the beginning of the buffer or image, not entire device memory block. Functions like <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069" title="Maps memory represented by given allocation and returns pointer to it.">vmaMapMemory()</a>, <a class="el" href="vk__mem__alloc_8h.html#a6b0929b914b60cf2d45cac4bf3547470" title="Binds buffer to allocation.">vmaBindBufferMemory()</a> also refer to the beginning of the allocation and apply this offset automatically.</p> -<p >It can change after call to <a class="el" href="vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac" title="Deprecated. Compacts memory by moving allocations.">vmaDefragment()</a> if this allocation is passed to the function, or if allocation is lost. </p> +<p >It can change after call to <a class="el" href="vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac" title="Deprecated. Compacts memory by moving allocations.">vmaDefragment()</a> if this allocation is passed to the function. </p> </div> </div> @@ -200,7 +199,7 @@ Public Attributes</h2></td></tr> </div><div class="memdoc"> <p>Size of this allocation, in bytes. </p> -<p >It never changes, unless allocation is lost.</p> +<p >It never changes.</p> <dl class="section note"><dt>Note</dt><dd>Allocation size returned in this variable may be greater than the size requested for the resource e.g. as <code>VkBufferCreateInfo::size</code>. Whole size of the allocation is accessible for operations on memory e.g. using a pointer after mapping with <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069" title="Maps memory represented by given allocation and returns pointer to it.">vmaMapMemory()</a>, but operations on the resource e.g. using <code>vkCmdCopyBuffer</code> must be limited to the size of the resource. </dd></dl> </div> diff --git a/docs/html/struct_vma_allocator_create_info-members.html b/docs/html/struct_vma_allocator_create_info-members.html index 46bc817..000625c 100644 --- a/docs/html/struct_vma_allocator_create_info-members.html +++ b/docs/html/struct_vma_allocator_create_info-members.html @@ -70,13 +70,11 @@ $(function() { <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#ad924ddd77b04039c88d0c09b0ffcd500">device</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a392ea2ecbaff93f91a7c49f735ad4346">flags</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7">frameInUseCount</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> - <tr class="odd"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b">instance</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d">pAllocationCallbacks</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> - <tr class="odd"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e">pDeviceMemoryCallbacks</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b">pHeapSizeLimit</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> - <tr class="odd"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156">physicalDevice</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee">pRecordSettings</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> + <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b">instance</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> + <tr class="odd"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d">pAllocationCallbacks</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> + <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e">pDeviceMemoryCallbacks</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> + <tr class="odd"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b">pHeapSizeLimit</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> + <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156">physicalDevice</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a">preferredLargeHeapBlockSize</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#ae8f0db05e5cb4c43d7713bf4a49a736b">pTypeExternalMemoryHandleTypes</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd">pVulkanFunctions</a></td><td class="entry"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td><td class="entry"></td></tr> diff --git a/docs/html/struct_vma_allocator_create_info.html b/docs/html/struct_vma_allocator_create_info.html index 35045b5..4b9bd9b 100644 --- a/docs/html/struct_vma_allocator_create_info.html +++ b/docs/html/struct_vma_allocator_create_info.html @@ -94,18 +94,12 @@ Public Attributes</h2></td></tr> <tr class="memitem:af1380969b5e1ea4c3184a877892d260e"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="struct_vma_device_memory_callbacks.html">VmaDeviceMemoryCallbacks</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e">pDeviceMemoryCallbacks</a></td></tr> <tr class="memdesc:af1380969b5e1ea4c3184a877892d260e"><td class="mdescLeft"> </td><td class="mdescRight">Informative callbacks for <code>vkAllocateMemory</code>, <code>vkFreeMemory</code>. Optional. <a href="struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e">More...</a><br /></td></tr> <tr class="separator:af1380969b5e1ea4c3184a877892d260e"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a21ea188dd212b8171cb9ecbed4a2a3a7"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7">frameInUseCount</a></td></tr> -<tr class="memdesc:a21ea188dd212b8171cb9ecbed4a2a3a7"><td class="mdescLeft"> </td><td class="mdescRight">Maximum number of additional frames that are in use at the same time as current frame. <a href="struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7">More...</a><br /></td></tr> -<tr class="separator:a21ea188dd212b8171cb9ecbed4a2a3a7"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a31c192aa6cbffa33279f6d9f0c47c44b"><td class="memItemLeft" align="right" valign="top">const VkDeviceSize * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b">pHeapSizeLimit</a></td></tr> <tr class="memdesc:a31c192aa6cbffa33279f6d9f0c47c44b"><td class="mdescLeft"> </td><td class="mdescRight">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. <a href="struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b">More...</a><br /></td></tr> <tr class="separator:a31c192aa6cbffa33279f6d9f0c47c44b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a3dc197be3227da7338b1643f70db36bd"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="struct_vma_vulkan_functions.html">VmaVulkanFunctions</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd">pVulkanFunctions</a></td></tr> <tr class="memdesc:a3dc197be3227da7338b1643f70db36bd"><td class="mdescLeft"> </td><td class="mdescRight">Pointers to Vulkan functions. Can be null. <a href="struct_vma_allocator_create_info.html#a3dc197be3227da7338b1643f70db36bd">More...</a><br /></td></tr> <tr class="separator:a3dc197be3227da7338b1643f70db36bd"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ace2aa4877b16a42b0b7673d4e26000ee"><td class="memItemLeft" align="right" valign="top">const <a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee">pRecordSettings</a></td></tr> -<tr class="memdesc:ace2aa4877b16a42b0b7673d4e26000ee"><td class="mdescLeft"> </td><td class="mdescRight">Parameters for recording of VMA calls. Can be null. <a href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee">More...</a><br /></td></tr> -<tr class="separator:ace2aa4877b16a42b0b7673d4e26000ee"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a70dd42e29b1df1d1b9b61532ae0b370b"><td class="memItemLeft" align="right" valign="top">VkInstance </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b">instance</a></td></tr> <tr class="memdesc:a70dd42e29b1df1d1b9b61532ae0b370b"><td class="mdescLeft"> </td><td class="mdescRight">Handle to Vulkan instance object. <a href="struct_vma_allocator_create_info.html#a70dd42e29b1df1d1b9b61532ae0b370b">More...</a><br /></td></tr> <tr class="separator:a70dd42e29b1df1d1b9b61532ae0b370b"><td class="memSeparator" colspan="2"> </td></tr> @@ -150,25 +144,6 @@ Public Attributes</h2></td></tr> <p>Flags for created allocator. Use <a class="el" href="vk__mem__alloc_8h.html#afd73b95e737ee7e76f827cb5472f559f" title="Flags for created VmaAllocator.">VmaAllocatorCreateFlagBits</a> enum. </p> -</div> -</div> -<a id="a21ea188dd212b8171cb9ecbed4a2a3a7" name="a21ea188dd212b8171cb9ecbed4a2a3a7"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a21ea188dd212b8171cb9ecbed4a2a3a7">◆ </a></span>frameInUseCount</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">uint32_t VmaAllocatorCreateInfo::frameInUseCount</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Maximum number of additional frames that are in use at the same time as current frame. </p> -<p >This value is used only when you make allocations with VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT flag. Such allocation cannot become lost if allocation.lastUseFrameIndex >= allocator.currentFrameIndex - frameInUseCount.</p> -<p >For example, if you double-buffer your command buffers, so resources used for rendering in previous frame may still be in use by the GPU at the moment you allocate resources needed for the current frame, set this value to 1.</p> -<p >If you want to allow any allocations other than used in the current frame to become lost, set this value to 0. </p> - </div> </div> <a id="a70dd42e29b1df1d1b9b61532ae0b370b" name="a70dd42e29b1df1d1b9b61532ae0b370b"></a> @@ -261,23 +236,6 @@ Public Attributes</h2></td></tr> <p>Vulkan physical device. </p> <p >It must be valid throughout whole lifetime of created allocator. </p> -</div> -</div> -<a id="ace2aa4877b16a42b0b7673d4e26000ee" name="ace2aa4877b16a42b0b7673d4e26000ee"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ace2aa4877b16a42b0b7673d4e26000ee">◆ </a></span>pRecordSettings</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">const <a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a>* VmaAllocatorCreateInfo::pRecordSettings</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Parameters for recording of VMA calls. Can be null. </p> -<p >If not null, it enables recording of calls to VMA functions to a file. If support for recording is not enabled using <code>VMA_RECORDING_ENABLED</code> macro, creation of the allocator object fails with <code>VK_ERROR_FEATURE_NOT_PRESENT</code>. </p> - </div> </div> <a id="a8e4714298e3121cdd8b214a1ae7a637a" name="a8e4714298e3121cdd8b214a1ae7a637a"></a> diff --git a/docs/html/struct_vma_budget.html b/docs/html/struct_vma_budget.html index 87b0cbc..7a58a47 100644 --- a/docs/html/struct_vma_budget.html +++ b/docs/html/struct_vma_budget.html @@ -105,8 +105,7 @@ Public Attributes</h2></td></tr> </div><div class="memdoc"> <p>Sum size of all allocations created in particular heap, in bytes. </p> -<p >Usually less or equal than <code>blockBytes</code>. Difference <code>blockBytes - allocationBytes</code> is the amount of memory allocated but unused - available for new allocations or wasted due to fragmentation.</p> -<p >It might be greater than <code>blockBytes</code> if there are some allocations in lost state, as they account to this value as well. </p> +<p >Usually less or equal than <code>blockBytes</code>. Difference <code>blockBytes - allocationBytes</code> is the amount of memory allocated but unused - available for new allocations or wasted due to fragmentation. </p> </div> </div> diff --git a/docs/html/struct_vma_defragmentation_info2.html b/docs/html/struct_vma_defragmentation_info2.html index c9e667c..58177a3 100644 --- a/docs/html/struct_vma_defragmentation_info2.html +++ b/docs/html/struct_vma_defragmentation_info2.html @@ -245,7 +245,7 @@ Public Attributes</h2></td></tr> </div><div class="memdoc"> <p>Pointer to array of allocations that can be defragmented. </p> -<p >The array should have <code>allocationCount</code> elements. The array should not contain nulls. Elements in the array should be unique - same allocation cannot occur twice. It is safe to pass allocations that are in the lost state - they are ignored. All allocations not present in this array are considered non-moveable during this defragmentation. </p> +<p >The array should have <code>allocationCount</code> elements. The array should not contain nulls. Elements in the array should be unique - same allocation cannot occur twice. All allocations not present in this array are considered non-moveable during this defragmentation. </p> </div> </div> @@ -295,7 +295,7 @@ Public Attributes</h2></td></tr> </div><div class="memdoc"> <p>Either null or pointer to array of pools to be defragmented. </p> -<p >All the allocations in the specified pools can be moved during defragmentation and there is no way to check if they were really moved as in <code>pAllocationsChanged</code>, so you must query all the allocations in all these pools for new <code>VkDeviceMemory</code> and offset using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> if you might need to recreate buffers and images bound to them.</p> +<p >All the allocations in the specified pools can be moved during defragmentation and there is no way to check if they were really moved as in <code>pAllocationsChanged</code>, so you must query all the allocations in all these pools for new <code>VkDeviceMemory</code> and offset using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a> if you might need to recreate buffers and images bound to them.</p> <p >The array should have <code>poolCount</code> elements. The array should not contain nulls. Elements in the array should be unique - same pool cannot occur twice.</p> <p >Using this array is equivalent to specifying all allocations from the pools in <code>pAllocations</code>. It might be more efficient. </p> diff --git a/docs/html/struct_vma_pool_create_info-members.html b/docs/html/struct_vma_pool_create_info-members.html index d1fa9e7..af7975d 100644 --- a/docs/html/struct_vma_pool_create_info-members.html +++ b/docs/html/struct_vma_pool_create_info-members.html @@ -70,13 +70,12 @@ $(function() { <table class="directory"> <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#aa4265160536cdb9be821b7686c16c676">blockSize</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#a8405139f63d078340ae74513a59f5446">flags</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa">frameInUseCount</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> - <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c">maxBlockCount</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319">memoryTypeIndex</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> - <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#ade3eca546f0c6ab4e8fbf20eb6d854cb">minAllocationAlignment</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae">minBlockCount</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> - <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#af0f8c58f51a2a7a0a389dc79565044d7">pMemoryAllocateNext</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274">priority</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> + <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c">maxBlockCount</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> + <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#a596fa76b685d3f1f688f84a709a5b319">memoryTypeIndex</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> + <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#ade3eca546f0c6ab4e8fbf20eb6d854cb">minAllocationAlignment</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> + <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#ad8006fb803185c0a699d30f3e9a865ae">minBlockCount</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> + <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#af0f8c58f51a2a7a0a389dc79565044d7">pMemoryAllocateNext</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> + <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274">priority</a></td><td class="entry"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/html/struct_vma_pool_create_info.html b/docs/html/struct_vma_pool_create_info.html index eba902e..03c156d 100644 --- a/docs/html/struct_vma_pool_create_info.html +++ b/docs/html/struct_vma_pool_create_info.html @@ -91,9 +91,6 @@ Public Attributes</h2></td></tr> <tr class="memitem:ae41142f2834fcdc82baa4883c187b75c"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c">maxBlockCount</a></td></tr> <tr class="memdesc:ae41142f2834fcdc82baa4883c187b75c"><td class="mdescLeft"> </td><td class="mdescRight">Maximum number of blocks that can be allocated in this pool. Optional. <a href="struct_vma_pool_create_info.html#ae41142f2834fcdc82baa4883c187b75c">More...</a><br /></td></tr> <tr class="separator:ae41142f2834fcdc82baa4883c187b75c"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a9437e43ffbb644dbbf7fc4e50cfad6aa"><td class="memItemLeft" align="right" valign="top">uint32_t </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa">frameInUseCount</a></td></tr> -<tr class="memdesc:a9437e43ffbb644dbbf7fc4e50cfad6aa"><td class="mdescLeft"> </td><td class="mdescRight">Maximum number of additional frames that are in use at the same time as current frame. <a href="struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa">More...</a><br /></td></tr> -<tr class="separator:a9437e43ffbb644dbbf7fc4e50cfad6aa"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a16e686c688f6725f119ebf6e24ab5274"><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274">priority</a></td></tr> <tr class="memdesc:a16e686c688f6725f119ebf6e24ab5274"><td class="mdescLeft"> </td><td class="mdescRight">A floating-point value between 0 and 1, indicating the priority of the allocations in this pool relative to other memory allocations. <a href="struct_vma_pool_create_info.html#a16e686c688f6725f119ebf6e24ab5274">More...</a><br /></td></tr> <tr class="separator:a16e686c688f6725f119ebf6e24ab5274"><td class="memSeparator" colspan="2"> </td></tr> @@ -139,25 +136,6 @@ Public Attributes</h2></td></tr> <p>Use combination of <a class="el" href="vk__mem__alloc_8h.html#a4d4f2efc2509157a9e4ecd4fd7942303" title="Flags to be passed as VmaPoolCreateInfo::flags.">VmaPoolCreateFlagBits</a>. </p> -</div> -</div> -<a id="a9437e43ffbb644dbbf7fc4e50cfad6aa" name="a9437e43ffbb644dbbf7fc4e50cfad6aa"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a9437e43ffbb644dbbf7fc4e50cfad6aa">◆ </a></span>frameInUseCount</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">uint32_t VmaPoolCreateInfo::frameInUseCount</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Maximum number of additional frames that are in use at the same time as current frame. </p> -<p >This value is used only when you make allocations with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a> flag. Such allocation cannot become lost if allocation.lastUseFrameIndex >= allocator.currentFrameIndex - frameInUseCount.</p> -<p >For example, if you double-buffer your command buffers, so resources used for rendering in previous frame may still be in use by the GPU at the moment you allocate resources needed for the current frame, set this value to 1.</p> -<p >If you want to allow any allocations other than used in the current frame to become lost, set this value to 0. </p> - </div> </div> <a id="ae41142f2834fcdc82baa4883c187b75c" name="ae41142f2834fcdc82baa4883c187b75c"></a> diff --git a/docs/html/struct_vma_pool_stats-members.html b/docs/html/struct_vma_pool_stats-members.html index 0e79b96..0597048 100644 --- a/docs/html/struct_vma_pool_stats-members.html +++ b/docs/html/struct_vma_pool_stats-members.html @@ -72,8 +72,7 @@ $(function() { <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_stats.html#aa0b5cb45cef6f18571cefb03b9a230e7">blockCount</a></td><td class="entry"><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a></td><td class="entry"></td></tr> <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_stats.html#a326807b2de2b0931cee4ed9a5f2e420c">size</a></td><td class="entry"><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a></td><td class="entry"></td></tr> <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4">unusedRangeCount</a></td><td class="entry"><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a></td><td class="entry"></td></tr> - <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b">unusedRangeSizeMax</a></td><td class="entry"><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a></td><td class="entry"></td></tr> - <tr class="odd"><td class="entry"><a class="el" href="struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8">unusedSize</a></td><td class="entry"><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a></td><td class="entry"></td></tr> + <tr class="even"><td class="entry"><a class="el" href="struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8">unusedSize</a></td><td class="entry"><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a></td><td class="entry"></td></tr> </table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/html/struct_vma_pool_stats.html b/docs/html/struct_vma_pool_stats.html index 1801053..b60aab0 100644 --- a/docs/html/struct_vma_pool_stats.html +++ b/docs/html/struct_vma_pool_stats.html @@ -83,14 +83,11 @@ Public Attributes</h2></td></tr> <tr class="memdesc:ad7c54874724fce7b06aba526202d82a8"><td class="mdescLeft"> </td><td class="mdescRight">Total number of bytes in the pool not used by any <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a>. <a href="struct_vma_pool_stats.html#ad7c54874724fce7b06aba526202d82a8">More...</a><br /></td></tr> <tr class="separator:ad7c54874724fce7b06aba526202d82a8"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad1924eb54fffa45e9e0e65670c8fe5eb"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_pool_stats.html#ad1924eb54fffa45e9e0e65670c8fe5eb">allocationCount</a></td></tr> -<tr class="memdesc:ad1924eb54fffa45e9e0e65670c8fe5eb"><td class="mdescLeft"> </td><td class="mdescRight">Number of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects created from this pool that were not destroyed or lost. <a href="struct_vma_pool_stats.html#ad1924eb54fffa45e9e0e65670c8fe5eb">More...</a><br /></td></tr> +<tr class="memdesc:ad1924eb54fffa45e9e0e65670c8fe5eb"><td class="mdescLeft"> </td><td class="mdescRight">Number of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects created from this pool that were not destroyed. <a href="struct_vma_pool_stats.html#ad1924eb54fffa45e9e0e65670c8fe5eb">More...</a><br /></td></tr> <tr class="separator:ad1924eb54fffa45e9e0e65670c8fe5eb"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ae4f3546ffa4d1e598b64d8e6134854f4"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4">unusedRangeCount</a></td></tr> <tr class="memdesc:ae4f3546ffa4d1e598b64d8e6134854f4"><td class="mdescLeft"> </td><td class="mdescRight">Number of continuous memory ranges in the pool not used by any <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a>. <a href="struct_vma_pool_stats.html#ae4f3546ffa4d1e598b64d8e6134854f4">More...</a><br /></td></tr> <tr class="separator:ae4f3546ffa4d1e598b64d8e6134854f4"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ab4c8f52dd42ab01998f60f0b6acc722b"><td class="memItemLeft" align="right" valign="top">VkDeviceSize </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b">unusedRangeSizeMax</a></td></tr> -<tr class="memdesc:ab4c8f52dd42ab01998f60f0b6acc722b"><td class="mdescLeft"> </td><td class="mdescRight">Size of the largest continuous free memory region available for new allocation. <a href="struct_vma_pool_stats.html#ab4c8f52dd42ab01998f60f0b6acc722b">More...</a><br /></td></tr> -<tr class="separator:ab4c8f52dd42ab01998f60f0b6acc722b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa0b5cb45cef6f18571cefb03b9a230e7"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_pool_stats.html#aa0b5cb45cef6f18571cefb03b9a230e7">blockCount</a></td></tr> <tr class="memdesc:aa0b5cb45cef6f18571cefb03b9a230e7"><td class="mdescLeft"> </td><td class="mdescRight">Number of <code>VkDeviceMemory</code> blocks allocated for this pool. <a href="struct_vma_pool_stats.html#aa0b5cb45cef6f18571cefb03b9a230e7">More...</a><br /></td></tr> <tr class="separator:aa0b5cb45cef6f18571cefb03b9a230e7"><td class="memSeparator" colspan="2"> </td></tr> @@ -110,7 +107,7 @@ Public Attributes</h2></td></tr> </table> </div><div class="memdoc"> -<p>Number of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects created from this pool that were not destroyed or lost. </p> +<p>Number of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects created from this pool that were not destroyed. </p> </div> </div> @@ -160,23 +157,6 @@ Public Attributes</h2></td></tr> <p>Number of continuous memory ranges in the pool not used by any <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a>. </p> -</div> -</div> -<a id="ab4c8f52dd42ab01998f60f0b6acc722b" name="ab4c8f52dd42ab01998f60f0b6acc722b"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ab4c8f52dd42ab01998f60f0b6acc722b">◆ </a></span>unusedRangeSizeMax</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">VkDeviceSize VmaPoolStats::unusedRangeSizeMax</td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Size of the largest continuous free memory region available for new allocation. </p> -<p >Making a new allocation of that size is not guaranteed to succeed because of possible additional margin required to respect alignment and buffer/image granularity. </p> - </div> </div> <a id="ad7c54874724fce7b06aba526202d82a8" name="ad7c54874724fce7b06aba526202d82a8"></a> diff --git a/docs/html/usage_patterns.html b/docs/html/usage_patterns.html index 990991f..188db8b 100644 --- a/docs/html/usage_patterns.html +++ b/docs/html/usage_patterns.html @@ -75,7 +75,7 @@ Common mistakes</h1> <p ><b>Use of CPU_TO_GPU instead of CPU_ONLY memory</b></p> <p ><a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca9066b52c5a7079bb74a69aaf8b92ff67">VMA_MEMORY_USAGE_CPU_TO_GPU</a> is recommended only for resources that will be mapped and written by the CPU, as well as read directly by the GPU - like some buffers or textures updated every frame (dynamic). If you create a staging copy of a resource to be written by CPU and then used as a source of transfer to another resource placed in the GPU memory, that staging resource should be created with <a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5">VMA_MEMORY_USAGE_CPU_ONLY</a>. Please read the descriptions of these enums carefully for details.</p> <p ><b>Unnecessary use of custom pools</b></p> -<p ><a class="el" href="custom_memory_pools.html">Custom memory pools</a> may be useful for special purposes - when you want to keep certain type of resources separate e.g. to reserve minimum amount of memory for them, limit maximum amount of memory they can occupy, or make some of them push out the other through the mechanism of <a class="el" href="lost_allocations.html">Lost allocations</a>. For most resources this is not needed and so it is not recommended to create <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a> objects and allocations out of them. Allocating from the default pool is sufficient.</p> +<p ><a class="el" href="custom_memory_pools.html">Custom memory pools</a> may be useful for special purposes - when you want to keep certain type of resources separate e.g. to reserve minimum amount of memory for them or limit maximum amount of memory they can occupy. For most resources this is not needed and so it is not recommended to create <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a> objects and allocations out of them. Allocating from the default pool is sufficient.</p> <h1><a class="anchor" id="usage_patterns_simple"></a> Simple patterns</h1> <h2><a class="anchor" id="usage_patterns_simple_render_targets"></a> diff --git a/docs/html/virtual_allocator.html b/docs/html/virtual_allocator.html index 27b5541..4fe2641 100644 --- a/docs/html/virtual_allocator.html +++ b/docs/html/virtual_allocator.html @@ -83,8 +83,8 @@ Creating virtual block</h1> <div class="line"> </div> <div class="line"><a class="code hl_struct" href="struct_vma_virtual_block.html">VmaVirtualBlock</a> block;</div> <div class="line">VkResult res = <a class="code hl_function" href="vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b">vmaCreateVirtualBlock</a>(&blockCreateInfo, &block);</div> -<div class="ttc" id="astruct_vma_virtual_block_create_info_html"><div class="ttname"><a href="struct_vma_virtual_block_create_info.html">VmaVirtualBlockCreateInfo</a></div><div class="ttdoc">Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1426</div></div> -<div class="ttc" id="astruct_vma_virtual_block_create_info_html_a670ab8c6a6e822f3c36781d79e8824e9"><div class="ttname"><a href="struct_vma_virtual_block_create_info.html#a670ab8c6a6e822f3c36781d79e8824e9">VmaVirtualBlockCreateInfo::size</a></div><div class="ttdeci">VkDeviceSize size</div><div class="ttdoc">Total size of the virtual block.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1432</div></div> +<div class="ttc" id="astruct_vma_virtual_block_create_info_html"><div class="ttname"><a href="struct_vma_virtual_block_create_info.html">VmaVirtualBlockCreateInfo</a></div><div class="ttdoc">Parameters of created VmaVirtualBlock object to be passed to vmaCreateVirtualBlock().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1318</div></div> +<div class="ttc" id="astruct_vma_virtual_block_create_info_html_a670ab8c6a6e822f3c36781d79e8824e9"><div class="ttname"><a href="struct_vma_virtual_block_create_info.html#a670ab8c6a6e822f3c36781d79e8824e9">VmaVirtualBlockCreateInfo::size</a></div><div class="ttdeci">VkDeviceSize size</div><div class="ttdoc">Total size of the virtual block.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1324</div></div> <div class="ttc" id="astruct_vma_virtual_block_html"><div class="ttname"><a href="struct_vma_virtual_block.html">VmaVirtualBlock</a></div><div class="ttdoc">Handle to a virtual block object that allows to use core allocation algorithm without allocating any ...</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_ab585754076877265fdae33e5c40ef13b"><div class="ttname"><a href="vk__mem__alloc_8h.html#ab585754076877265fdae33e5c40ef13b">vmaCreateVirtualBlock</a></div><div class="ttdeci">VkResult vmaCreateVirtualBlock(const VmaVirtualBlockCreateInfo *pCreateInfo, VmaVirtualBlock *pVirtualBlock)</div><div class="ttdoc">Creates new VmaVirtualBlock object.</div></div> </div><!-- fragment --><h1><a class="anchor" id="virtual_allocator_making_virtual_allocations"></a> @@ -109,8 +109,8 @@ Making virtual allocations</h1> <div class="line">{</div> <div class="line"> <span class="comment">// Allocation failed - no space for it could be found. Handle this error!</span></div> <div class="line">}</div> -<div class="ttc" id="astruct_vma_virtual_allocation_create_info_html"><div class="ttname"><a href="struct_vma_virtual_allocation_create_info.html">VmaVirtualAllocationCreateInfo</a></div><div class="ttdoc">Parameters of created virtual allocation to be passed to vmaVirtualAllocate().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1447</div></div> -<div class="ttc" id="astruct_vma_virtual_allocation_create_info_html_aae08752b86817abd0d944c6025dc603e"><div class="ttname"><a href="struct_vma_virtual_allocation_create_info.html#aae08752b86817abd0d944c6025dc603e">VmaVirtualAllocationCreateInfo::size</a></div><div class="ttdeci">VkDeviceSize size</div><div class="ttdoc">Size of the allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1452</div></div> +<div class="ttc" id="astruct_vma_virtual_allocation_create_info_html"><div class="ttname"><a href="struct_vma_virtual_allocation_create_info.html">VmaVirtualAllocationCreateInfo</a></div><div class="ttdoc">Parameters of created virtual allocation to be passed to vmaVirtualAllocate().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1339</div></div> +<div class="ttc" id="astruct_vma_virtual_allocation_create_info_html_aae08752b86817abd0d944c6025dc603e"><div class="ttname"><a href="struct_vma_virtual_allocation_create_info.html#aae08752b86817abd0d944c6025dc603e">VmaVirtualAllocationCreateInfo::size</a></div><div class="ttdeci">VkDeviceSize size</div><div class="ttdoc">Size of the allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1344</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a1c15925e6745dacee0cfc877fffecec2"><div class="ttname"><a href="vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2">vmaVirtualAllocate</a></div><div class="ttdeci">VkResult vmaVirtualAllocate(VmaVirtualBlock virtualBlock, const VmaVirtualAllocationCreateInfo *pCreateInfo, VkDeviceSize *pOffset)</div><div class="ttdoc">Allocates new virtual allocation inside given VmaVirtualBlock.</div></div> </div><!-- fragment --><h1><a class="anchor" id="virtual_allocator_deallocation"></a> Deallocation</h1> @@ -137,8 +137,8 @@ Allocation parameters</h1> <div class="line"><span class="keyword">delete</span> (CustomAllocData*)allocInfo.<a class="code hl_variable" href="struct_vma_virtual_allocation_info.html#a41d5cb09357656411653d82fee436f45">pUserData</a>;</div> <div class="line"> </div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a13f01c44b3c1a06e695f1f5d24b80639">vmaVirtualFree</a>(block, allocOffset);</div> -<div class="ttc" id="astruct_vma_virtual_allocation_info_html"><div class="ttname"><a href="struct_vma_virtual_allocation_info.html">VmaVirtualAllocationInfo</a></div><div class="ttdoc">Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1470</div></div> -<div class="ttc" id="astruct_vma_virtual_allocation_info_html_a41d5cb09357656411653d82fee436f45"><div class="ttname"><a href="struct_vma_virtual_allocation_info.html#a41d5cb09357656411653d82fee436f45">VmaVirtualAllocationInfo::pUserData</a></div><div class="ttdeci">void * pUserData</div><div class="ttdoc">Custom pointer associated with the allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1480</div></div> +<div class="ttc" id="astruct_vma_virtual_allocation_info_html"><div class="ttname"><a href="struct_vma_virtual_allocation_info.html">VmaVirtualAllocationInfo</a></div><div class="ttdoc">Parameters of an existing virtual allocation, returned by vmaGetVirtualAllocationInfo().</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1362</div></div> +<div class="ttc" id="astruct_vma_virtual_allocation_info_html_a41d5cb09357656411653d82fee436f45"><div class="ttname"><a href="struct_vma_virtual_allocation_info.html#a41d5cb09357656411653d82fee436f45">VmaVirtualAllocationInfo::pUserData</a></div><div class="ttdeci">void * pUserData</div><div class="ttdoc">Custom pointer associated with the allocation.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1372</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_ab5fcb961ffea69023e7e0ea100bdad8e"><div class="ttname"><a href="vk__mem__alloc_8h.html#ab5fcb961ffea69023e7e0ea100bdad8e">vmaGetVirtualAllocationInfo</a></div><div class="ttdeci">void vmaGetVirtualAllocationInfo(VmaVirtualBlock virtualBlock, VkDeviceSize offset, VmaVirtualAllocationInfo *pVirtualAllocInfo)</div><div class="ttdoc">Returns information about a specific virtual allocation within a virtual block, like its size and pUs...</div></div> </div><!-- fragment --><h1><a class="anchor" id="virtual_allocator_alignment_and_units"></a> Alignment and units</h1> @@ -149,7 +149,7 @@ Alignment and units</h1> <div class="line"> </div> <div class="line">VkDeviceSize allocOffset;</div> <div class="line">res = <a class="code hl_function" href="vk__mem__alloc_8h.html#a1c15925e6745dacee0cfc877fffecec2">vmaVirtualAllocate</a>(block, &allocCreateInfo, &allocOffset);</div> -<div class="ttc" id="astruct_vma_virtual_allocation_create_info_html_a9d19709872fc1904a105079e1c885821"><div class="ttname"><a href="struct_vma_virtual_allocation_create_info.html#a9d19709872fc1904a105079e1c885821">VmaVirtualAllocationCreateInfo::alignment</a></div><div class="ttdeci">VkDeviceSize alignment</div><div class="ttdoc">Required alignment of the allocation. Optional.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1457</div></div> +<div class="ttc" id="astruct_vma_virtual_allocation_create_info_html_a9d19709872fc1904a105079e1c885821"><div class="ttname"><a href="struct_vma_virtual_allocation_create_info.html#a9d19709872fc1904a105079e1c885821">VmaVirtualAllocationCreateInfo::alignment</a></div><div class="ttdeci">VkDeviceSize alignment</div><div class="ttdoc">Required alignment of the allocation. Optional.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1349</div></div> </div><!-- fragment --><p >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 <code>sizeof(MyDataStruct)</code>, 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:</p> <ul> <li><a class="el" href="struct_vma_virtual_block_create_info.html#a670ab8c6a6e822f3c36781d79e8824e9" title="Total size of the virtual block.">VmaVirtualBlockCreateInfo::size</a></li> @@ -163,16 +163,16 @@ Statistics</h1> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a95169b4730e94757897470086ec2768a">vmaCalculateVirtualBlockStats</a>(block, &statInfo);</div> <div class="line">printf(<span class="stringliteral">"My virtual block has %llu bytes used by %u virtual allocations\n"</span>,</div> <div class="line"> statInfo.<a class="code hl_variable" href="struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a">usedBytes</a>, statInfo.<a class="code hl_variable" href="struct_vma_stat_info.html#a537741e4d5cdddc1c0ab95ec650afaff">allocationCount</a>);</div> -<div class="ttc" id="astruct_vma_stat_info_html"><div class="ttname"><a href="struct_vma_stat_info.html">VmaStatInfo</a></div><div class="ttdoc">Calculated statistics of memory usage in entire allocator.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1034</div></div> -<div class="ttc" id="astruct_vma_stat_info_html_a537741e4d5cdddc1c0ab95ec650afaff"><div class="ttname"><a href="struct_vma_stat_info.html#a537741e4d5cdddc1c0ab95ec650afaff">VmaStatInfo::allocationCount</a></div><div class="ttdeci">uint32_t allocationCount</div><div class="ttdoc">Number of VmaAllocation allocation objects allocated.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1038</div></div> -<div class="ttc" id="astruct_vma_stat_info_html_ab0c6c73837e5a70c749fbd4f6064895a"><div class="ttname"><a href="struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a">VmaStatInfo::usedBytes</a></div><div class="ttdeci">VkDeviceSize usedBytes</div><div class="ttdoc">Total number of bytes occupied by all allocations.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:1042</div></div> +<div class="ttc" id="astruct_vma_stat_info_html"><div class="ttname"><a href="struct_vma_stat_info.html">VmaStatInfo</a></div><div class="ttdoc">Calculated statistics of memory usage in entire allocator.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:953</div></div> +<div class="ttc" id="astruct_vma_stat_info_html_a537741e4d5cdddc1c0ab95ec650afaff"><div class="ttname"><a href="struct_vma_stat_info.html#a537741e4d5cdddc1c0ab95ec650afaff">VmaStatInfo::allocationCount</a></div><div class="ttdeci">uint32_t allocationCount</div><div class="ttdoc">Number of VmaAllocation allocation objects allocated.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:957</div></div> +<div class="ttc" id="astruct_vma_stat_info_html_ab0c6c73837e5a70c749fbd4f6064895a"><div class="ttname"><a href="struct_vma_stat_info.html#ab0c6c73837e5a70c749fbd4f6064895a">VmaStatInfo::usedBytes</a></div><div class="ttdeci">VkDeviceSize usedBytes</div><div class="ttdoc">Total number of bytes occupied by all allocations.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:961</div></div> <div class="ttc" id="avk__mem__alloc_8h_html_a95169b4730e94757897470086ec2768a"><div class="ttname"><a href="vk__mem__alloc_8h.html#a95169b4730e94757897470086ec2768a">vmaCalculateVirtualBlockStats</a></div><div class="ttdeci">void vmaCalculateVirtualBlockStats(VmaVirtualBlock virtualBlock, VmaStatInfo *pStatInfo)</div><div class="ttdoc">Calculates and returns statistics about virtual allocations and memory usage in given VmaVirtualBlock...</div></div> </div><!-- fragment --><p >You can also request a full list of allocations and free regions as a string in JSON format by calling <a class="el" href="vk__mem__alloc_8h.html#a52d810e1222c592e5d80556ad005f1e6" title="Builds and returns a null-terminated string in JSON format with information about given VmaVirtualBlo...">vmaBuildVirtualBlockStatsString()</a>. Returned string must be later freed using <a class="el" href="vk__mem__alloc_8h.html#a47fb8d8aa69df4a7c23a9719b4080623" title="Frees a string returned by vmaBuildVirtualBlockStatsString().">vmaFreeVirtualBlockStatsString()</a>. The format of this string differs from the one returned by the main Vulkan allocator, but it is similar.</p> <h1><a class="anchor" id="virtual_allocator_additional_considerations"></a> Additional considerations</h1> <p >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.</p> <p >Alternative allocation algorithms are supported, just like in custom pools of the real GPU memory. See enum <a class="el" href="vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bca" title="Flags to be passed as VmaVirtualBlockCreateInfo::flags.">VmaVirtualBlockCreateFlagBits</a> to learn how to specify them (e.g. <a class="el" href="vk__mem__alloc_8h.html#a88bcf8c1cd3bb1610ff7343811c65bcaae6423e2fa2f3c9211b21c819e3f10f96" title="Enables alternative, linear allocation algorithm in this virtual block.">VMA_VIRTUAL_BLOCK_CREATE_LINEAR_ALGORITHM_BIT</a>). You can find their description in chapter <a class="el" href="custom_memory_pools.html">Custom memory pools</a>. Allocation strategies are also supported. See enum <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6" title="Flags to be passed as VmaVirtualAllocationCreateInfo::flags.">VmaVirtualAllocationCreateFlagBits</a> to learn how to specify them (e.g. <a class="el" href="vk__mem__alloc_8h.html#a2e9c64d405b14156fea7e10c4ad06cb6a562d10a46012719d33167d3dc5dbbf9b" title="Allocation strategy that tries to minimize allocation time.">VMA_VIRTUAL_ALLOCATION_CREATE_STRATEGY_MIN_TIME_BIT</a>).</p> -<p >Following features are supported only by the allocator of the real GPU memory and not by virtual allocations: buffer-image granularity, <a class="el" href="lost_allocations.html">Lost allocations</a>, <code>VMA_DEBUG_MARGIN</code>, <code>VMA_MIN_ALIGNMENT</code>. </p> +<p >Following features are supported only by the allocator of the real GPU memory and not by virtual allocations: buffer-image granularity, <code>VMA_DEBUG_MARGIN</code>, <code>VMA_MIN_ALIGNMENT</code>. </p> </div></div><!-- contents --> </div><!-- PageDoc --> <!-- start footer part --> diff --git a/docs/html/vk__mem__alloc_8h.html b/docs/html/vk__mem__alloc_8h.html index 745937a..f73790b 100644 --- a/docs/html/vk__mem__alloc_8h.html +++ b/docs/html/vk__mem__alloc_8h.html @@ -85,9 +85,6 @@ Classes</h2></td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_vulkan_functions.html">VmaVulkanFunctions</a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Pointers to some Vulkan functions - a subset used by the library. <a href="struct_vma_vulkan_functions.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a></td></tr> -<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Parameters for recording calls to VMA functions. To be used in <a class="el" href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee" title="Parameters for recording of VMA calls. Can be null.">VmaAllocatorCreateInfo::pRecordSettings</a>. <a href="struct_vma_record_settings.html#details">More...</a><br /></td></tr> -<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Description of a Allocator to be created. <a href="struct_vma_allocator_create_info.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> @@ -112,7 +109,7 @@ Classes</h2></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Describes parameter of existing <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a>. <a href="struct_vma_pool_stats.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_allocation_info.html">VmaAllocationInfo</a></td></tr> -<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>. <a href="struct_vma_allocation_info.html#details">More...</a><br /></td></tr> +<tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>. <a href="struct_vma_allocation_info.html#details">More...</a><br /></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct  </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_defragmentation_info2.html">VmaDefragmentationInfo2</a></td></tr> <tr class="memdesc:"><td class="mdescLeft"> </td><td class="mdescRight">Parameters for defragmentation. <a href="struct_vma_defragmentation_info2.html#details">More...</a><br /></td></tr> @@ -140,8 +137,6 @@ Classes</h2></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="define-members" name="define-members"></a> Macros</h2></td></tr> -<tr class="memitem:a1f0c126759fc96ccb6e2d23c101d770c"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c">VMA_RECORDING_ENABLED</a>   0</td></tr> -<tr class="separator:a1f0c126759fc96ccb6e2d23c101d770c"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a162894cbe84f7d76632eb9af1e4b3558"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a162894cbe84f7d76632eb9af1e4b3558">VK_ERROR_UNKNOWN</a>   ((VkResult)-13)</td></tr> <tr class="separator:a162894cbe84f7d76632eb9af1e4b3558"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af7b860e63b96d11e44ae8587ba06bbf4"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4">VMA_DEDICATED_ALLOCATION</a>   0</td></tr> @@ -162,11 +157,6 @@ Typedefs</h2></td></tr> <tr class="separator:afd73b95e737ee7e76f827cb5472f559f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:acfe6863e160722c2c1bbcf7573fddc4d"><td class="memItemLeft" align="right" valign="top">typedef VkFlags </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#acfe6863e160722c2c1bbcf7573fddc4d">VmaAllocatorCreateFlags</a></td></tr> <tr class="separator:acfe6863e160722c2c1bbcf7573fddc4d"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:acd24d5eb58abff7e1f43cb32a1ba1413"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2">VmaRecordFlagBits</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#acd24d5eb58abff7e1f43cb32a1ba1413">VmaRecordFlagBits</a></td></tr> -<tr class="memdesc:acd24d5eb58abff7e1f43cb32a1ba1413"><td class="mdescLeft"> </td><td class="mdescRight">Flags to be used in <a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a" title="Flags for recording. Use VmaRecordFlagBits enum.">VmaRecordSettings::flags</a>. <a href="vk__mem__alloc_8h.html#acd24d5eb58abff7e1f43cb32a1ba1413">More...</a><br /></td></tr> -<tr class="separator:acd24d5eb58abff7e1f43cb32a1ba1413"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:af3929a1a4547c592fc0b0e55ef452828"><td class="memItemLeft" align="right" valign="top">typedef VkFlags </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828">VmaRecordFlags</a></td></tr> -<tr class="separator:af3929a1a4547c592fc0b0e55ef452828"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a806e8499dde802e59eb72a1dc811c35f"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc">VmaMemoryUsage</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a806e8499dde802e59eb72a1dc811c35f">VmaMemoryUsage</a></td></tr> <tr class="separator:a806e8499dde802e59eb72a1dc811c35f"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a4fceecc301f4064dc808d3cd6c038941"><td class="memItemLeft" align="right" valign="top">typedef enum <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597">VmaAllocationCreateFlagBits</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a4fceecc301f4064dc808d3cd6c038941">VmaAllocationCreateFlagBits</a></td></tr> @@ -209,9 +199,6 @@ Typedefs</h2></td></tr> <tr class="memitem:abb0a8e3b5040d847571cca6c7f9a8074"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_vma_vulkan_functions.html">VmaVulkanFunctions</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074">VmaVulkanFunctions</a></td></tr> <tr class="memdesc:abb0a8e3b5040d847571cca6c7f9a8074"><td class="mdescLeft"> </td><td class="mdescRight">Pointers to some Vulkan functions - a subset used by the library. <a href="vk__mem__alloc_8h.html#abb0a8e3b5040d847571cca6c7f9a8074">More...</a><br /></td></tr> <tr class="separator:abb0a8e3b5040d847571cca6c7f9a8074"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a16e21c877101493fce582664cd8754fc"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc">VmaRecordSettings</a></td></tr> -<tr class="memdesc:a16e21c877101493fce582664cd8754fc"><td class="mdescLeft"> </td><td class="mdescRight">Parameters for recording calls to VMA functions. To be used in <a class="el" href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee" title="Parameters for recording of VMA calls. Can be null.">VmaAllocatorCreateInfo::pRecordSettings</a>. <a href="vk__mem__alloc_8h.html#a16e21c877101493fce582664cd8754fc">More...</a><br /></td></tr> -<tr class="separator:a16e21c877101493fce582664cd8754fc"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aad9652301d33759b83e52d4f3605a14a"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a">VmaAllocatorCreateInfo</a></td></tr> <tr class="memdesc:aad9652301d33759b83e52d4f3605a14a"><td class="mdescLeft"> </td><td class="mdescRight">Description of a Allocator to be created. <a href="vk__mem__alloc_8h.html#aad9652301d33759b83e52d4f3605a14a">More...</a><br /></td></tr> <tr class="separator:aad9652301d33759b83e52d4f3605a14a"><td class="memSeparator" colspan="2"> </td></tr> @@ -236,7 +223,7 @@ Typedefs</h2></td></tr> <tr class="memdesc:a4759a2d9f99c19ba7627553c847132f1"><td class="mdescLeft"> </td><td class="mdescRight">Describes parameter of existing <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a>. <a href="vk__mem__alloc_8h.html#a4759a2d9f99c19ba7627553c847132f1">More...</a><br /></td></tr> <tr class="separator:a4759a2d9f99c19ba7627553c847132f1"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a1cf7774606721026a68aabe3af2e5b50"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_vma_allocation_info.html">VmaAllocationInfo</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50">VmaAllocationInfo</a></td></tr> -<tr class="memdesc:a1cf7774606721026a68aabe3af2e5b50"><td class="mdescLeft"> </td><td class="mdescRight">Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>. <a href="vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50">More...</a><br /></td></tr> +<tr class="memdesc:a1cf7774606721026a68aabe3af2e5b50"><td class="mdescLeft"> </td><td class="mdescRight">Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>. <a href="vk__mem__alloc_8h.html#a1cf7774606721026a68aabe3af2e5b50">More...</a><br /></td></tr> <tr class="separator:a1cf7774606721026a68aabe3af2e5b50"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad6daeffaa670ce6d11a203a6224c9937"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="struct_vma_defragmentation_info2.html">VmaDefragmentationInfo2</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937">VmaDefragmentationInfo2</a></td></tr> <tr class="memdesc:ad6daeffaa670ce6d11a203a6224c9937"><td class="mdescLeft"> </td><td class="mdescRight">Parameters for defragmentation. <a href="vk__mem__alloc_8h.html#ad6daeffaa670ce6d11a203a6224c9937">More...</a><br /></td></tr> @@ -278,11 +265,6 @@ Enumerations</h2></td></tr> }</td></tr> <tr class="memdesc:a4f87c9100d154a65a4ad495f7763cf7c"><td class="mdescLeft"> </td><td class="mdescRight">Flags for created <a class="el" href="struct_vma_allocator.html" title="Represents main object of this library initialized.">VmaAllocator</a>. <a href="vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7c">More...</a><br /></td></tr> <tr class="separator:a4f87c9100d154a65a4ad495f7763cf7c"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a4dd2c44642312a147a4e93373a6e64d2"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2">VmaRecordFlagBits</a> { <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7">VMA_RECORD_FLUSH_AFTER_CALL_BIT</a> = 0x00000001 -, <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e">VMA_RECORD_FLAG_BITS_MAX_ENUM</a> = 0x7FFFFFFF - }</td></tr> -<tr class="memdesc:a4dd2c44642312a147a4e93373a6e64d2"><td class="mdescLeft"> </td><td class="mdescRight">Flags to be used in <a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a" title="Flags for recording. Use VmaRecordFlagBits enum.">VmaRecordSettings::flags</a>. <a href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2">More...</a><br /></td></tr> -<tr class="separator:a4dd2c44642312a147a4e93373a6e64d2"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa5846affa1e9da3800e3e78fae2305cc"><td class="memItemLeft" align="right" valign="top">enum  </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc">VmaMemoryUsage</a> { <br />   <a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd">VMA_MEMORY_USAGE_UNKNOWN</a> = 0 , <a class="el" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccac6b5dc1432d88647aa4cd456246eadf7">VMA_MEMORY_USAGE_GPU_ONLY</a> = 1 @@ -300,9 +282,9 @@ Enumerations</h2></td></tr>   <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a3fc311d855c2ff53f1090ef5c722b38f">VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT</a> = 0x00000001 , <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a89759603401014eb325eb22a3839f2ff">VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT</a> = 0x00000002 , <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">VMA_ALLOCATION_CREATE_MAPPED_BIT</a> = 0x00000004 -, <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a> = 0x00000008 +, <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ad7e8035e8edecd8dfa1f32a194bdf103">VMA_ALLOCATION_CREATE_RESERVED_1_BIT</a> = 0x00000008 , <br /> -  <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e">VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT</a> = 0x00000010 +  <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597ae9290dbcf5817e7616d5802e2aa251e7">VMA_ALLOCATION_CREATE_RESERVED_2_BIT</a> = 0x00000010 , <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520">VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT</a> = 0x00000020 , <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a42ba3a2d2c7117953210b7c3ef8da0df">VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT</a> = 0x00000040 , <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a2310568c62208af432724305fe29ccea">VMA_ALLOCATION_CREATE_DONT_BIND_BIT</a> = 0x00000080 @@ -404,9 +386,6 @@ Functions</h2></td></tr> <tr class="memitem:ae8bf76997b234ef68aad922616df4153"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153">vmaGetPoolStats</a> (<a class="el" href="struct_vma_allocator.html">VmaAllocator</a> allocator, <a class="el" href="struct_vma_pool.html">VmaPool</a> pool, <a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a> *pPoolStats)</td></tr> <tr class="memdesc:ae8bf76997b234ef68aad922616df4153"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves statistics of existing <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a> object. <a href="vk__mem__alloc_8h.html#ae8bf76997b234ef68aad922616df4153">More...</a><br /></td></tr> <tr class="separator:ae8bf76997b234ef68aad922616df4153"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a736bd6cbda886f36c891727e73bd4024"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024">vmaMakePoolAllocationsLost</a> (<a class="el" href="struct_vma_allocator.html">VmaAllocator</a> allocator, <a class="el" href="struct_vma_pool.html">VmaPool</a> pool, size_t *pLostAllocationCount)</td></tr> -<tr class="memdesc:a736bd6cbda886f36c891727e73bd4024"><td class="mdescLeft"> </td><td class="mdescRight">Marks all allocations in given pool as lost if they are not used in current frame or <a class="el" href="struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa" title="Maximum number of additional frames that are in use at the same time as current frame.">VmaPoolCreateInfo::frameInUseCount</a> back from now. <a href="vk__mem__alloc_8h.html#a736bd6cbda886f36c891727e73bd4024">More...</a><br /></td></tr> -<tr class="separator:a736bd6cbda886f36c891727e73bd4024"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:ad535935619c7a549bf837e1bb0068f89"><td class="memItemLeft" align="right" valign="top">VkResult </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89">vmaCheckPoolCorruption</a> (<a class="el" href="struct_vma_allocator.html">VmaAllocator</a> allocator, <a class="el" href="struct_vma_pool.html">VmaPool</a> pool)</td></tr> <tr class="memdesc:ad535935619c7a549bf837e1bb0068f89"><td class="mdescLeft"> </td><td class="mdescRight">Checks magic number in margins around all allocations in given memory pool in search for corruptions. <a href="vk__mem__alloc_8h.html#ad535935619c7a549bf837e1bb0068f89">More...</a><br /></td></tr> <tr class="separator:ad535935619c7a549bf837e1bb0068f89"><td class="memSeparator" colspan="2"> </td></tr> @@ -434,17 +413,11 @@ Functions</h2></td></tr> <tr class="memdesc:a834b1e4aef395c0a1d56a28e69a4a17e"><td class="mdescLeft"> </td><td class="mdescRight">Frees memory and destroys multiple allocations. <a href="vk__mem__alloc_8h.html#a834b1e4aef395c0a1d56a28e69a4a17e">More...</a><br /></td></tr> <tr class="separator:a834b1e4aef395c0a1d56a28e69a4a17e"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a86dd08aba8633bfa4ad0df2e76481d8b"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">vmaGetAllocationInfo</a> (<a class="el" href="struct_vma_allocator.html">VmaAllocator</a> allocator, <a class="el" href="struct_vma_allocation.html">VmaAllocation</a> allocation, <a class="el" href="struct_vma_allocation_info.html">VmaAllocationInfo</a> *pAllocationInfo)</td></tr> -<tr class="memdesc:a86dd08aba8633bfa4ad0df2e76481d8b"><td class="mdescLeft"> </td><td class="mdescRight">Returns current information about specified allocation and atomically marks it as used in current frame. <a href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">More...</a><br /></td></tr> +<tr class="memdesc:a86dd08aba8633bfa4ad0df2e76481d8b"><td class="mdescLeft"> </td><td class="mdescRight">Returns current information about specified allocation. <a href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b">More...</a><br /></td></tr> <tr class="separator:a86dd08aba8633bfa4ad0df2e76481d8b"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a43d8ba9673c846f049089a5029d5c73a"><td class="memItemLeft" align="right" valign="top">VkBool32 </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a">vmaTouchAllocation</a> (<a class="el" href="struct_vma_allocator.html">VmaAllocator</a> allocator, <a class="el" href="struct_vma_allocation.html">VmaAllocation</a> allocation)</td></tr> -<tr class="memdesc:a43d8ba9673c846f049089a5029d5c73a"><td class="mdescLeft"> </td><td class="mdescRight">Returns <code>VK_TRUE</code> if allocation is not lost and atomically marks it as used in current frame. <a href="vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a">More...</a><br /></td></tr> -<tr class="separator:a43d8ba9673c846f049089a5029d5c73a"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af9147d31ffc11d62fc187bde283ed14f"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f">vmaSetAllocationUserData</a> (<a class="el" href="struct_vma_allocator.html">VmaAllocator</a> allocator, <a class="el" href="struct_vma_allocation.html">VmaAllocation</a> allocation, void *pUserData)</td></tr> <tr class="memdesc:af9147d31ffc11d62fc187bde283ed14f"><td class="mdescLeft"> </td><td class="mdescRight">Sets pUserData in given allocation to new value. <a href="vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f">More...</a><br /></td></tr> <tr class="separator:af9147d31ffc11d62fc187bde283ed14f"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ae5c9657d9e94756269145b01c05d16f1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1">vmaCreateLostAllocation</a> (<a class="el" href="struct_vma_allocator.html">VmaAllocator</a> allocator, <a class="el" href="struct_vma_allocation.html">VmaAllocation</a> *pAllocation)</td></tr> -<tr class="memdesc:ae5c9657d9e94756269145b01c05d16f1"><td class="mdescLeft"> </td><td class="mdescRight">Creates new allocation that is in lost state from the beginning. <a href="vk__mem__alloc_8h.html#ae5c9657d9e94756269145b01c05d16f1">More...</a><br /></td></tr> -<tr class="separator:ae5c9657d9e94756269145b01c05d16f1"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a571e87dd38e552249b56b1b0b982fad1"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1">vmaGetAllocationMemoryProperties</a> (<a class="el" href="struct_vma_allocator.html">VmaAllocator</a> allocator, <a class="el" href="struct_vma_allocation.html">VmaAllocation</a> allocation, VkMemoryPropertyFlags *pFlags)</td></tr> <tr class="memdesc:a571e87dd38e552249b56b1b0b982fad1"><td class="mdescLeft"> </td><td class="mdescRight">Given an allocation, returns Property Flags of its memory type. <a href="vk__mem__alloc_8h.html#a571e87dd38e552249b56b1b0b982fad1">More...</a><br /></td></tr> <tr class="separator:a571e87dd38e552249b56b1b0b982fad1"><td class="memSeparator" colspan="2"> </td></tr> @@ -616,20 +589,6 @@ Functions</h2></td></tr> </table> </div><div class="memdoc"> -</div> -</div> -<a id="a1f0c126759fc96ccb6e2d23c101d770c" name="a1f0c126759fc96ccb6e2d23c101d770c"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a1f0c126759fc96ccb6e2d23c101d770c">◆ </a></span>VMA_RECORDING_ENABLED</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">#define VMA_RECORDING_ENABLED   0</td> - </tr> - </table> -</div><div class="memdoc"> - </div> </div> <a id="ae25f0d55fd91cb166f002b63244800e1" name="ae25f0d55fd91cb166f002b63244800e1"></a> @@ -735,7 +694,7 @@ Functions</h2></td></tr> </table> </div><div class="memdoc"> -<p>Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>. </p> +<p>Parameters of <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation.">VmaAllocation</a> objects, that can be retrieved using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>. </p> </div> </div> @@ -1022,52 +981,6 @@ Functions</h2></td></tr> <p>Describes parameter of existing <a class="el" href="struct_vma_pool.html" title="Represents custom memory pool.">VmaPool</a>. </p> -</div> -</div> -<a id="acd24d5eb58abff7e1f43cb32a1ba1413" name="acd24d5eb58abff7e1f43cb32a1ba1413"></a> -<h2 class="memtitle"><span class="permalink"><a href="#acd24d5eb58abff7e1f43cb32a1ba1413">◆ </a></span>VmaRecordFlagBits</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">typedef enum <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2">VmaRecordFlagBits</a> <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2">VmaRecordFlagBits</a></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Flags to be used in <a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a" title="Flags for recording. Use VmaRecordFlagBits enum.">VmaRecordSettings::flags</a>. </p> - -</div> -</div> -<a id="af3929a1a4547c592fc0b0e55ef452828" name="af3929a1a4547c592fc0b0e55ef452828"></a> -<h2 class="memtitle"><span class="permalink"><a href="#af3929a1a4547c592fc0b0e55ef452828">◆ </a></span>VmaRecordFlags</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">typedef VkFlags <a class="el" href="vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828">VmaRecordFlags</a></td> - </tr> - </table> -</div><div class="memdoc"> - -</div> -</div> -<a id="a16e21c877101493fce582664cd8754fc" name="a16e21c877101493fce582664cd8754fc"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a16e21c877101493fce582664cd8754fc">◆ </a></span>VmaRecordSettings</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">typedef struct <a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a> <a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Parameters for recording calls to VMA functions. To be used in <a class="el" href="struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee" title="Parameters for recording of VMA calls. Can be null.">VmaAllocatorCreateInfo::pRecordSettings</a>. </p> - </div> </div> <a id="aec5b57e29c97b5d69c6d5654d60df878" name="aec5b57e29c97b5d69c6d5654d60df878"></a> @@ -1256,16 +1169,11 @@ Functions</h2></td></tr> </td></tr> <tr><td class="fieldname"><a id="ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f" name="ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f"></a>VMA_ALLOCATION_CREATE_MAPPED_BIT </td><td class="fielddoc"><p >Set this flag to use a memory that will be persistently mapped and retrieve pointer to it. </p> <p >Pointer to mapped memory will be returned through <a class="el" href="struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2" title="Pointer to the beginning of this allocation as mapped data.">VmaAllocationInfo::pMappedData</a>.</p> -<p >It is valid to use this flag for allocation made from memory type that is not <code>HOST_VISIBLE</code>. 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 (<code>DEVICE_LOCAL</code>) and still want to map it directly if possible on platforms that support it (e.g. Intel GPU).</p> -<p >You should not use this flag together with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a>. </p> +<p >It is valid to use this flag for allocation made from memory type that is not <code>HOST_VISIBLE</code>. 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 (<code>DEVICE_LOCAL</code>) and still want to map it directly if possible on platforms that support it (e.g. Intel GPU). </p> </td></tr> -<tr><td class="fieldname"><a id="ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2" name="ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2"></a>VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT </td><td class="fielddoc"><p >Allocation created with this flag can become lost as a result of another allocation with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e">VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT</a> flag, so you must check it before use.</p> -<p >To check if allocation is not lost, call <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> and check if <a class="el" href="struct_vma_allocation_info.html#ae0bfb7dfdf79a76ffefc9a94677a2f67" title="Handle to Vulkan memory object.">VmaAllocationInfo::deviceMemory</a> is not <code>VK_NULL_HANDLE</code>.</p> -<p >For details about supporting lost allocations, see Lost Allocations chapter of User Guide on Main Page.</p> -<p >You should not use this flag together with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f" title="Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.">VMA_ALLOCATION_CREATE_MAPPED_BIT</a>. </p> +<tr><td class="fieldname"><a id="ad9889c10c798b040d59c92f257cae597ad7e8035e8edecd8dfa1f32a194bdf103" name="ad9889c10c798b040d59c92f257cae597ad7e8035e8edecd8dfa1f32a194bdf103"></a>VMA_ALLOCATION_CREATE_RESERVED_1_BIT </td><td class="fielddoc"><dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000003">Deprecated:</a></b></dt><dd>Removed. Do not use. </dd></dl> </td></tr> -<tr><td class="fieldname"><a id="ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e" name="ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e"></a>VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT </td><td class="fielddoc"><p >While creating allocation using this flag, other allocations that were created with flag <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a> can become lost.</p> -<p >For details about supporting lost allocations, see Lost Allocations chapter of User Guide on Main Page. </p> +<tr><td class="fieldname"><a id="ad9889c10c798b040d59c92f257cae597ae9290dbcf5817e7616d5802e2aa251e7" name="ad9889c10c798b040d59c92f257cae597ae9290dbcf5817e7616d5802e2aa251e7"></a>VMA_ALLOCATION_CREATE_RESERVED_2_BIT </td><td class="fielddoc"><dl class="deprecated"><dt><b><a class="el" href="deprecated.html#_deprecated000004">Deprecated:</a></b></dt><dd>Removed. Do not use. </dd></dl> </td></tr> <tr><td class="fieldname"><a id="ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520" name="ad9889c10c798b040d59c92f257cae597aa6f24f821cd6a7c5e4a443f7bf59c520"></a>VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT </td><td class="fielddoc"><p >Set this flag to treat <a class="el" href="struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19" title="Custom general-purpose pointer that will be stored in VmaAllocation, can be read as VmaAllocationInfo...">VmaAllocationCreateInfo::pUserData</a> 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 <code>pUserData</code>. The string is automatically freed together with the allocation. It is also used in <a class="el" href="vk__mem__alloc_8h.html#aa4fee7eb5253377599ef4fd38c93c2a0" title="Builds and returns statistics as a null-terminated string in JSON format.">vmaBuildStatsString()</a>. </p> </td></tr> @@ -1466,28 +1374,6 @@ Functions</h2></td></tr> <tr><td class="fieldname"><a id="a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec" name="a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec"></a>VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM </td><td class="fielddoc"></td></tr> </table> -</div> -</div> -<a id="a4dd2c44642312a147a4e93373a6e64d2" name="a4dd2c44642312a147a4e93373a6e64d2"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a4dd2c44642312a147a4e93373a6e64d2">◆ </a></span>VmaRecordFlagBits</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">enum <a class="el" href="vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2">VmaRecordFlagBits</a></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Flags to be used in <a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a" title="Flags for recording. Use VmaRecordFlagBits enum.">VmaRecordSettings::flags</a>. </p> -<table class="fieldtable"> -<tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><a id="a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7" name="a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7"></a>VMA_RECORD_FLUSH_AFTER_CALL_BIT </td><td class="fielddoc"><p >Enables flush after recording every function call. </p> -<p >Enable it if you expect your application to crash, which may leave recording file truncated. It may degrade performance though. </p> -</td></tr> -<tr><td class="fieldname"><a id="a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e" name="a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e"></a>VMA_RECORD_FLAG_BITS_MAX_ENUM </td><td class="fielddoc"></td></tr> -</table> - </div> </div> <a id="a2e9c64d405b14156fea7e10c4ad06cb6" name="a2e9c64d405b14156fea7e10c4ad06cb6"></a> @@ -1601,7 +1487,7 @@ Functions</h2></td></tr> <tr><td class="paramdir"></td><td class="paramname">pVkMemoryRequirements</td><td></td></tr> <tr><td class="paramdir"></td><td class="paramname">pCreateInfo</td><td></td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">pAllocation</td><td>Handle to allocated memory. </td></tr> - <tr><td class="paramdir">[out]</td><td class="paramname">pAllocationInfo</td><td>Optional. Information about allocated memory. It can be later fetched using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>.</td></tr> + <tr><td class="paramdir">[out]</td><td class="paramname">pAllocationInfo</td><td>Optional. Information about allocated memory. It can be later fetched using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>.</td></tr> </table> </dd> </dl> @@ -1659,7 +1545,7 @@ Functions</h2></td></tr> <tr><td class="paramdir"></td><td class="paramname">buffer</td><td></td></tr> <tr><td class="paramdir"></td><td class="paramname">pCreateInfo</td><td></td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">pAllocation</td><td>Handle to allocated memory. </td></tr> - <tr><td class="paramdir">[out]</td><td class="paramname">pAllocationInfo</td><td>Optional. Information about allocated memory. It can be later fetched using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>.</td></tr> + <tr><td class="paramdir">[out]</td><td class="paramname">pAllocationInfo</td><td>Optional. Information about allocated memory. It can be later fetched using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>.</td></tr> </table> </dd> </dl> @@ -2355,7 +2241,7 @@ Functions</h2></td></tr> <tr><td class="paramdir"></td><td class="paramname">pAllocationCreateInfo</td><td></td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">pBuffer</td><td>Buffer that was created. </td></tr> <tr><td class="paramdir">[out]</td><td class="paramname">pAllocation</td><td>Allocation that was created. </td></tr> - <tr><td class="paramdir">[out]</td><td class="paramname">pAllocationInfo</td><td>Optional. Information about allocated memory. It can be later fetched using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>.</td></tr> + <tr><td class="paramdir">[out]</td><td class="paramname">pAllocationInfo</td><td>Optional. Information about allocated memory. It can be later fetched using function <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>.</td></tr> </table> </dd> </dl> @@ -2485,39 +2371,6 @@ Functions</h2></td></tr> <p>Function similar to <a class="el" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer()</a>. </p> -</div> -</div> -<a id="ae5c9657d9e94756269145b01c05d16f1" name="ae5c9657d9e94756269145b01c05d16f1"></a> -<h2 class="memtitle"><span class="permalink"><a href="#ae5c9657d9e94756269145b01c05d16f1">◆ </a></span>vmaCreateLostAllocation()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void vmaCreateLostAllocation </td> - <td>(</td> - <td class="paramtype"><a class="el" href="struct_vma_allocator.html">VmaAllocator</a> </td> - <td class="paramname"><em>allocator</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="struct_vma_allocation.html">VmaAllocation</a> * </td> - <td class="paramname"><em>pAllocation</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Creates new allocation that is in lost state from the beginning. </p> -<p >It can be useful if you need a dummy, non-null allocation.</p> -<p >You still need to destroy created object using <a class="el" href="vk__mem__alloc_8h.html#a5fea5518972ae9094b1526cbcb19b05f" title="Frees memory previously allocated using vmaAllocateMemory(), vmaAllocateMemoryForBuffer(),...">vmaFreeMemory()</a>.</p> -<p >Returned allocation is not tied to any specific memory pool or memory type and not bound to any image or buffer. It has size = 0. It cannot be turned into a real, non-empty allocation. </p> - </div> </div> <a id="a5c8770ded7c59c8caac6de0c2cb00b50" name="a5c8770ded7c59c8caac6de0c2cb00b50"></a> @@ -2731,7 +2584,7 @@ Functions</h2></td></tr> <p>Use this function instead of old, deprecated <a class="el" href="vk__mem__alloc_8h.html#a9f0f8f56db5f7f57fe4454f465142dac" title="Deprecated. Compacts memory by moving allocations.">vmaDefragment()</a>.</p> <p >Warning! Between the call to <a class="el" href="vk__mem__alloc_8h.html#a36ba776fd7fd5cb1e9359fdc0d8e6e8a" title="Begins defragmentation process.">vmaDefragmentationBegin()</a> and <a class="el" href="vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2" title="Ends defragmentation process.">vmaDefragmentationEnd()</a>:</p> <ul> -<li>You should not use any of allocations passed as <code>pInfo->pAllocations</code> or any allocations that belong to pools passed as <code>pInfo->pPools</code>, including calling <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a>, <a class="el" href="vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a" title="Returns VK_TRUE if allocation is not lost and atomically marks it as used in current frame.">vmaTouchAllocation()</a>, or access their data.</li> +<li>You should not use any of allocations passed as <code>pInfo->pAllocations</code> or any allocations that belong to pools passed as <code>pInfo->pPools</code>, including calling <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a>, or access their data.</li> <li>Some mutexes protecting internal data structures may be locked, so trying to make or free any allocations, bind buffers or images, map memory, or launch another simultaneous defragmentation in between may cause stall (when done on another thread) or deadlock (when done on the same thread), unless you are 100% sure that defragmented allocations are in different pools.</li> <li>Information returned via <code>pStats</code> and <code>pInfo->pAllocationsChanged</code> are undefined. They become valid after call to <a class="el" href="vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2" title="Ends defragmentation process.">vmaDefragmentationEnd()</a>.</li> <li>If <code>pInfo->commandBuffer</code> is not null, you must submit that command buffer and make sure it finished execution before calling <a class="el" href="vk__mem__alloc_8h.html#a8774e20e91e245aae959ba63efa15dd2" title="Ends defragmentation process.">vmaDefragmentationEnd()</a>.</li> @@ -3371,14 +3224,9 @@ Functions</h2></td></tr> </table> </div><div class="memdoc"> -<p>Returns current information about specified allocation and atomically marks it as used in current frame. </p> +<p>Returns current information about specified allocation. </p> <p >Current paramteres of given allocation are returned in <code>pAllocationInfo</code>.</p> -<p >This function also atomically "touches" allocation - marks it as used in current frame, just like <a class="el" href="vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a" title="Returns VK_TRUE if allocation is not lost and atomically marks it as used in current frame.">vmaTouchAllocation()</a>. If the allocation is in lost state, <code>pAllocationInfo->deviceMemory == VK_NULL_HANDLE</code>.</p> -<p >Although this function uses atomics and doesn't lock any mutex, so it should be quite efficient, you can avoid calling it too often.</p> -<ul> -<li>You can retrieve same <a class="el" href="struct_vma_allocation_info.html" title="Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().">VmaAllocationInfo</a> structure while creating your resource, from function <a class="el" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer()</a>, <a class="el" href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73" title="Function similar to vmaCreateBuffer().">vmaCreateImage()</a>. You can remember it if you are sure parameters don't change (e.g. due to defragmentation or allocation becoming lost).</li> -<li>If you just want to check if allocation is not lost, <a class="el" href="vk__mem__alloc_8h.html#a43d8ba9673c846f049089a5029d5c73a" title="Returns VK_TRUE if allocation is not lost and atomically marks it as used in current frame.">vmaTouchAllocation()</a> will work faster. </li> -</ul> +<p >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 <a class="el" href="struct_vma_allocation_info.html" title="Parameters of VmaAllocation objects, that can be retrieved using function vmaGetAllocationInfo().">VmaAllocationInfo</a> structure while creating your resource, from function <a class="el" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer()</a>, <a class="el" href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73" title="Function similar to vmaCreateBuffer().">vmaCreateImage()</a>. You can remember it if you are sure parameters don't change (e.g. due to defragmentation). </p> </div> </div> @@ -3415,7 +3263,7 @@ Functions</h2></td></tr> </div><div class="memdoc"> <p>Given an allocation, returns Property Flags of its memory type. </p> -<p >This is just a convenience function. Same information can be obtained using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> + <a class="el" href="vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19">vmaGetMemoryProperties()</a>. </p> +<p >This is just a convenience function. Same information can be obtained using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation.">vmaGetAllocationInfo()</a> + <a class="el" href="vk__mem__alloc_8h.html#ab88db292a17974f911182543fda52d19">vmaGetMemoryProperties()</a>. </p> </div> </div> @@ -3831,50 +3679,6 @@ Functions</h2></td></tr> <p>Returns true of the <a class="el" href="struct_vma_virtual_block.html" title="Handle to a virtual block object that allows to use core allocation algorithm without allocating any ...">VmaVirtualBlock</a> is empty - contains 0 virtual allocations and has all its space available for new allocations. </p> -</div> -</div> -<a id="a736bd6cbda886f36c891727e73bd4024" name="a736bd6cbda886f36c891727e73bd4024"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a736bd6cbda886f36c891727e73bd4024">◆ </a></span>vmaMakePoolAllocationsLost()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">void vmaMakePoolAllocationsLost </td> - <td>(</td> - <td class="paramtype"><a class="el" href="struct_vma_allocator.html">VmaAllocator</a> </td> - <td class="paramname"><em>allocator</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="struct_vma_pool.html">VmaPool</a> </td> - <td class="paramname"><em>pool</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype">size_t * </td> - <td class="paramname"><em>pLostAllocationCount</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Marks all allocations in given pool as lost if they are not used in current frame or <a class="el" href="struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa" title="Maximum number of additional frames that are in use at the same time as current frame.">VmaPoolCreateInfo::frameInUseCount</a> back from now. </p> -<dl class="params"><dt>Parameters</dt><dd> - <table class="params"> - <tr><td class="paramdir"></td><td class="paramname">allocator</td><td>Allocator object. </td></tr> - <tr><td class="paramdir"></td><td class="paramname">pool</td><td>Pool. </td></tr> - <tr><td class="paramdir">[out]</td><td class="paramname">pLostAllocationCount</td><td>Number of allocations marked as lost. Optional - pass null if you don't need this information. </td></tr> - </table> - </dd> -</dl> - </div> </div> <a id="ad5bd1243512d099706de88168992f069" name="ad5bd1243512d099706de88168992f069"></a> @@ -3910,13 +3714,13 @@ Functions</h2></td></tr> </div><div class="memdoc"> <p>Maps memory represented by given allocation and returns pointer to it. </p> -<p >Maps memory represented by given allocation to make it accessible to CPU code. When succeeded, <code>*ppData</code> contains pointer to first byte of this memory. If the allocation is part of bigger <code>VkDeviceMemory</code> block, the pointer is correctly offsetted to the beginning of region assigned to this particular allocation.</p> -<p >Mapping is internally reference-counted and synchronized, so despite raw Vulkan function <code>vkMapMemory()</code> cannot be used to map same block of <code>VkDeviceMemory</code> 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.</p> +<p >Maps memory represented by given allocation to make it accessible to CPU code. When succeeded, <code>*ppData</code> contains pointer to first byte of this memory.</p> +<dl class="section warning"><dt>Warning</dt><dd>If the allocation is part of a bigger <code>VkDeviceMemory</code> block, returned pointer is correctly offsetted to the beginning of region assigned to this particular allocation. Unlike the result of <code>vkMapMemory</code>, it points to the allocation, not to the beginning of the whole block. You should not add <a class="el" href="struct_vma_allocation_info.html#a4a3c732388dbdc7a23f9365b00825268" title="Offset in VkDeviceMemory object to the beginning of this allocation, in bytes. (deviceMemory,...">VmaAllocationInfo::offset</a> to it!</dd></dl> +<p>Mapping is internally reference-counted and synchronized, so despite raw Vulkan function <code>vkMapMemory()</code> cannot be used to map same block of <code>VkDeviceMemory</code> 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.</p> <p >If the function succeeded, you must call <a class="el" href="vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45" title="Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().">vmaUnmapMemory()</a> to unmap the allocation when mapping is no longer needed or before freeing the allocation, at the latest.</p> <p >It also safe to call this function multiple times on the same allocation. You must call <a class="el" href="vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45" title="Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().">vmaUnmapMemory()</a> same number of times as you called <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069" title="Maps memory represented by given allocation and returns pointer to it.">vmaMapMemory()</a>.</p> <p >It is also safe to call this function on allocation created with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f" title="Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.">VMA_ALLOCATION_CREATE_MAPPED_BIT</a> flag. Its memory stays mapped all the time. You must still call <a class="el" href="vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45" title="Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().">vmaUnmapMemory()</a> same number of times as you called <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069" title="Maps memory represented by given allocation and returns pointer to it.">vmaMapMemory()</a>. You must not call <a class="el" href="vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45" title="Unmaps memory represented by given allocation, mapped previously using vmaMapMemory().">vmaUnmapMemory()</a> additional time to free the "0-th" mapping made automatically due to <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f" title="Set this flag to use a memory that will be persistently mapped and retrieve pointer to it.">VMA_ALLOCATION_CREATE_MAPPED_BIT</a> flag.</p> <p >This function fails when used on allocation made in memory type that is not <code>HOST_VISIBLE</code>.</p> -<p >This function always fails when called for allocation that was created with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a> flag. Such allocations cannot be mapped.</p> <p >This function doesn't automatically flush or invalidate caches. If the allocation is made from a memory types that is not <code>HOST_COHERENT</code>, you also need to use <a class="el" href="vk__mem__alloc_8h.html#aaa8412919139ef413a4215ac6a290fae" title="Invalidates memory of given allocation.">vmaInvalidateAllocation()</a> / <a class="el" href="vk__mem__alloc_8h.html#a30c37c1eec6025f397be41644f48490f" title="Flushes memory of given allocation.">vmaFlushAllocation()</a>, as required by Vulkan specification. </p> </div> @@ -3986,7 +3790,6 @@ Functions</h2></td></tr> </div><div class="memdoc"> <p>Sets index of the current frame. </p> -<p >This function must be used if you make allocations with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a> and <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a68686d0ce9beb0d4d1b9f2b8b1389a7e">VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT</a> flags to inform the allocator when a new frame begins. Allocations queried using <a class="el" href="vk__mem__alloc_8h.html#a86dd08aba8633bfa4ad0df2e76481d8b" title="Returns current information about specified allocation and atomically marks it as used in current fra...">vmaGetAllocationInfo()</a> cannot become lost in the current frame. </p> </div> </div> @@ -4061,39 +3864,6 @@ Functions</h2></td></tr> <p>Changes custom pointer associated with given virtual allocation. </p> -</div> -</div> -<a id="a43d8ba9673c846f049089a5029d5c73a" name="a43d8ba9673c846f049089a5029d5c73a"></a> -<h2 class="memtitle"><span class="permalink"><a href="#a43d8ba9673c846f049089a5029d5c73a">◆ </a></span>vmaTouchAllocation()</h2> - -<div class="memitem"> -<div class="memproto"> - <table class="memname"> - <tr> - <td class="memname">VkBool32 vmaTouchAllocation </td> - <td>(</td> - <td class="paramtype"><a class="el" href="struct_vma_allocator.html">VmaAllocator</a> </td> - <td class="paramname"><em>allocator</em>, </td> - </tr> - <tr> - <td class="paramkey"></td> - <td></td> - <td class="paramtype"><a class="el" href="struct_vma_allocation.html">VmaAllocation</a> </td> - <td class="paramname"><em>allocation</em> </td> - </tr> - <tr> - <td></td> - <td>)</td> - <td></td><td></td> - </tr> - </table> -</div><div class="memdoc"> - -<p>Returns <code>VK_TRUE</code> if allocation is not lost and atomically marks it as used in current frame. </p> -<p >If the allocation has been created with <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a> flag, this function returns <code>VK_TRUE</code> if it is not in lost state, so it can still be used. It then also atomically "touches" the allocation - marks it as used in current frame, so that you can be sure it won't become lost in current frame or next <code>frameInUseCount</code> frames.</p> -<p >If the allocation is in lost state, the function returns <code>VK_FALSE</code>. Memory of such allocation, as well as buffer or image bound to it, should not be used. Lost allocation and the buffer/image still need to be destroyed.</p> -<p >If the allocation has been created without <a class="el" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a5f436af6c8fe8540573a6d22627a6fd2">VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT</a> flag, this function always returns <code>VK_TRUE</code>. </p> - </div> </div> <a id="a9bc268595cb33f6ec4d519cfce81ff45" name="a9bc268595cb33f6ec4d519cfce81ff45"></a> diff --git a/docs/html/vk_khr_dedicated_allocation.html b/docs/html/vk_khr_dedicated_allocation.html index 3cc80ba..83a04e9 100644 --- a/docs/html/vk_khr_dedicated_allocation.html +++ b/docs/html/vk_khr_dedicated_allocation.html @@ -82,7 +82,7 @@ $(function() { <div class="line"> </div> <div class="line"><a class="code hl_function" href="vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb">vmaCreateAllocator</a>(&allocatorInfo, &allocator);</div> <div class="ttc" id="avk__mem__alloc_8h_html_a200692051ddb34240248234f5f4c17bb"><div class="ttname"><a href="vk__mem__alloc_8h.html#a200692051ddb34240248234f5f4c17bb">vmaCreateAllocator</a></div><div class="ttdeci">VkResult vmaCreateAllocator(const VmaAllocatorCreateInfo *pCreateInfo, VmaAllocator *pAllocator)</div><div class="ttdoc">Creates Allocator object.</div></div> -<div class="ttc" id="avk__mem__alloc_8h_html_a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878"><div class="ttname"><a href="vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878">VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT</div><div class="ttdoc">Enables usage of VK_KHR_dedicated_allocation extension.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:336</div></div> +<div class="ttc" id="avk__mem__alloc_8h_html_a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878"><div class="ttname"><a href="vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7cace7da7cc6e71a625dfa763c55a597878">VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT</a></div><div class="ttdeci">@ VMA_ALLOCATOR_CREATE_KHR_DEDICATED_ALLOCATION_BIT</div><div class="ttdoc">Enables usage of VK_KHR_dedicated_allocation extension.</div><div class="ttdef"><b>Definition:</b> vk_mem_alloc.h:326</div></div> </div><!-- fragment --><p >That is all. The extension will be automatically used whenever you create a buffer using <a class="el" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer()</a> or image using <a class="el" href="vk__mem__alloc_8h.html#a02a94f25679275851a53e82eacbcfc73" title="Function similar to vmaCreateBuffer().">vmaCreateImage()</a>.</p> <p >When using the extension together with Vulkan Validation Layer, you will receive warnings like this: </p><pre class="fragment">vkBindBufferMemory(): Binding memory to buffer 0x33 but vkGetBufferMemoryRequirements() has not been called on that buffer. </pre><p> It is OK, you should just ignore it. It happens because you use function <code>vkGetBufferMemoryRequirements2KHR()</code> instead of standard <code>vkGetBufferMemoryRequirements()</code>, while the validation layer seems to be unaware of it.</p> diff --git a/include/vk_mem_alloc.h b/include/vk_mem_alloc.h index ed69da8..ea0ec3f 100644 --- a/include/vk_mem_alloc.h +++ b/include/vk_mem_alloc.h @@ -78,7 +78,6 @@ Documentation of all members: vk_mem_alloc.h - [Memory initialization](@ref debugging_memory_usage_initialization) - [Margins](@ref debugging_memory_usage_margins) - [Corruption detection](@ref debugging_memory_usage_corruption_detection) - - \subpage record_and_replay - \subpage opengl_interop - \subpage usage_patterns - [Common mistakes](@ref usage_patterns_common_mistakes) @@ -108,14 +107,6 @@ Documentation of all members: vk_mem_alloc.h extern "C" { #endif -/* -Define this macro to 0/1 to disable/enable support for recording functionality, -available through VmaAllocatorCreateInfo::pRecordSettings. -*/ -#ifndef VMA_RECORDING_ENABLED - #define VMA_RECORDING_ENABLED 0 -#endif - #if defined(__ANDROID__) && defined(VK_NO_PROTOTYPES) && VMA_STATIC_VULKAN_FUNCTIONS extern PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; extern PFN_vkGetDeviceProcAddr vkGetDeviceProcAddr; @@ -418,20 +409,6 @@ typedef enum VmaAllocatorCreateFlagBits } VmaAllocatorCreateFlagBits; typedef VkFlags VmaAllocatorCreateFlags; -/// Flags to be used in VmaRecordSettings::flags. -typedef enum VmaRecordFlagBits -{ - /** \brief Enables flush after recording every function call. - - Enable it if you expect your application to crash, which may leave recording file truncated. - It may degrade performance though. - */ - VMA_RECORD_FLUSH_AFTER_CALL_BIT = 0x00000001, - - VMA_RECORD_FLAG_BITS_MAX_ENUM = 0x7FFFFFFF -} VmaRecordFlagBits; -typedef VkFlags VmaRecordFlags; - typedef enum VmaMemoryUsage { /** No intended memory usage specified. @@ -872,21 +849,6 @@ typedef struct VmaVulkanFunctions #endif } VmaVulkanFunctions; -/// Parameters for recording calls to VMA functions. To be used in VmaAllocatorCreateInfo::pRecordSettings. -typedef struct VmaRecordSettings -{ - /// Flags for recording. Use #VmaRecordFlagBits enum. - VmaRecordFlags flags; - /** \brief Path to the file that should be written by the recording. - - Suggested extension: "csv". - If the file already exists, it will be overwritten. - It will be opened for the whole time #VmaAllocator object is alive. - If opening this file fails, creation of the whole allocator object fails. - */ - const char* VMA_NOT_NULL pFilePath; -} VmaRecordSettings; - /// Description of a Allocator to be created. typedef struct VmaAllocatorCreateInfo { @@ -938,13 +900,6 @@ typedef struct VmaAllocatorCreateInfo For details see [Pointers to Vulkan functions](@ref config_Vulkan_functions). */ const VmaVulkanFunctions* VMA_NULLABLE pVulkanFunctions; - /** \brief Parameters for recording of VMA calls. Can be null. - - If not null, it enables recording of calls to VMA functions to a file. - If support for recording is not enabled using `VMA_RECORDING_ENABLED` macro, - creation of the allocator object fails with `VK_ERROR_FEATURE_NOT_PRESENT`. - */ - const VmaRecordSettings* VMA_NULLABLE pRecordSettings; /** \brief Handle to Vulkan instance object. Starting from version 3.0.0 this member is no longer optional, it must be set! @@ -2344,16 +2299,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString( #include <cstring> #include <utility> -#if VMA_RECORDING_ENABLED - #include <chrono> - #if defined(_WIN32) - #include <windows.h> - #else - #include <sstream> - #include <thread> - #endif -#endif - /******************************************************************************* CONFIGURATION SECTION @@ -2886,9 +2831,6 @@ struct VmaCurrentBudgetData; class VmaAllocationObjectAllocator; -#if VMA_RECORDING_ENABLED -class VmaRecorder; -#endif #endif // _VMA_FORWARD_DECLARATIONS @@ -9707,133 +9649,6 @@ void VmaVirtualBlock_T::BuildStatsString(bool detailedMap, VmaStringBuilder& sb) #endif // _VMA_VIRTUAL_BLOCK_T_FUNCTIONS #endif // _VMA_VIRTUAL_BLOCK_T -#if VMA_RECORDING_ENABLED -class VmaRecorder -{ -public: - VmaRecorder(); - VkResult Init(const VmaRecordSettings& settings, bool useMutex); - void WriteConfiguration( - const VkPhysicalDeviceProperties& devProps, - const VkPhysicalDeviceMemoryProperties& memProps, - uint32_t vulkanApiVersion, - bool dedicatedAllocationExtensionEnabled, - bool bindMemory2ExtensionEnabled, - bool memoryBudgetExtensionEnabled, - bool deviceCoherentMemoryExtensionEnabled); - ~VmaRecorder(); - - void RecordCreateAllocator(uint32_t frameIndex); - void RecordDestroyAllocator(uint32_t frameIndex); - void RecordCreatePool(uint32_t frameIndex, - const VmaPoolCreateInfo& createInfo, - VmaPool pool); - void RecordDestroyPool(uint32_t frameIndex, VmaPool pool); - void RecordAllocateMemory(uint32_t frameIndex, - const VkMemoryRequirements& vkMemReq, - const VmaAllocationCreateInfo& createInfo, - VmaAllocation allocation); - void RecordAllocateMemoryPages(uint32_t frameIndex, - const VkMemoryRequirements& vkMemReq, - const VmaAllocationCreateInfo& createInfo, - uint64_t allocationCount, - const VmaAllocation* pAllocations); - void RecordAllocateMemoryForBuffer(uint32_t frameIndex, - const VkMemoryRequirements& vkMemReq, - bool requiresDedicatedAllocation, - bool prefersDedicatedAllocation, - const VmaAllocationCreateInfo& createInfo, - VmaAllocation allocation); - void RecordAllocateMemoryForImage(uint32_t frameIndex, - const VkMemoryRequirements& vkMemReq, - bool requiresDedicatedAllocation, - bool prefersDedicatedAllocation, - const VmaAllocationCreateInfo& createInfo, - VmaAllocation allocation); - void RecordFreeMemory(uint32_t frameIndex, - VmaAllocation allocation); - void RecordFreeMemoryPages(uint32_t frameIndex, - uint64_t allocationCount, - const VmaAllocation* pAllocations); - void RecordSetAllocationUserData(uint32_t frameIndex, - VmaAllocation allocation, - const void* pUserData); - void RecordMapMemory(uint32_t frameIndex, - VmaAllocation allocation); - void RecordUnmapMemory(uint32_t frameIndex, - VmaAllocation allocation); - void RecordFlushAllocation(uint32_t frameIndex, - VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size); - void RecordInvalidateAllocation(uint32_t frameIndex, - VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size); - void RecordCreateBuffer(uint32_t frameIndex, - const VkBufferCreateInfo& bufCreateInfo, - const VmaAllocationCreateInfo& allocCreateInfo, - VmaAllocation allocation); - void RecordCreateImage(uint32_t frameIndex, - const VkImageCreateInfo& imageCreateInfo, - const VmaAllocationCreateInfo& allocCreateInfo, - VmaAllocation allocation); - void RecordDestroyBuffer(uint32_t frameIndex, - VmaAllocation allocation); - void RecordDestroyImage(uint32_t frameIndex, - VmaAllocation allocation); - void RecordGetAllocationInfo(uint32_t frameIndex, - VmaAllocation allocation); - void RecordDefragmentationBegin(uint32_t frameIndex, - const VmaDefragmentationInfo2& info, - VmaDefragmentationContext ctx); - void RecordDefragmentationEnd(uint32_t frameIndex, - VmaDefragmentationContext ctx); - void RecordSetPoolName(uint32_t frameIndex, - VmaPool pool, - const char* name); - -private: - struct CallParams - { - uint32_t threadId; - double time; - }; - class UserDataString - { - public: - UserDataString(VmaAllocationCreateFlags allocFlags, const void* pUserData); - const char* GetString() const { return m_Str; } - - private: - char m_PtrStr[17]; - const char* m_Str; - }; - - bool m_UseMutex; - VmaRecordFlags m_Flags; - FILE* m_File; - VMA_MUTEX m_FileMutex; - std::chrono::time_point<std::chrono::high_resolution_clock> m_RecordingStartTime; - - void GetBasicParams(CallParams& outParams); - - // T must be a pointer type, e.g. VmaAllocation, VmaPool. - template<typename T> - void PrintPointerList(uint64_t count, const T* pItems) - { - if (count) - { - fprintf(m_File, "%p", pItems[0]); - for (uint64_t i = 1; i < count; ++i) - { - fprintf(m_File, " %p", pItems[i]); - } - } - } - - void PrintPointerList(uint64_t count, const VmaAllocation* pItems); - void Flush(); -}; -#endif // VMA_RECORDING_ENABLED - - // Main allocator object. struct VmaAllocator_T { @@ -9918,10 +9733,6 @@ public: uint32_t GetGlobalMemoryTypeBits() const { return m_GlobalMemoryTypeBits; } -#if VMA_RECORDING_ENABLED - VmaRecorder* GetRecorder() const { return m_pRecorder; } -#endif - void GetBufferMemoryRequirements( VkBuffer hBuffer, VkMemoryRequirements& memReq, @@ -10062,10 +9873,6 @@ private: // Global bit mask AND-ed with any memoryTypeBits to disallow certain memory types. uint32_t m_GlobalMemoryTypeBits; -#if VMA_RECORDING_ENABLED - VmaRecorder* m_pRecorder; -#endif - void ImportVulkanFunctions(const VmaVulkanFunctions* pVulkanFunctions); #if VMA_STATIC_VULKAN_FUNCTIONS == 1 @@ -13191,565 +12998,6 @@ void VmaPool_T::SetName(const char* pName) } #endif // _VMA_POOL_T_FUNCTIONS -#if VMA_RECORDING_ENABLED -VmaRecorder::VmaRecorder() - : m_UseMutex(true), - m_Flags(0), - m_File(VMA_NULL), - m_RecordingStartTime(std::chrono::high_resolution_clock::now()) {} - -VkResult VmaRecorder::Init(const VmaRecordSettings& settings, bool useMutex) -{ - m_UseMutex = useMutex; - m_Flags = settings.flags; - -#if defined(_WIN32) - // Open file for writing. - errno_t err = fopen_s(&m_File, settings.pFilePath, "wb"); - - if(err != 0) - { - return VK_ERROR_INITIALIZATION_FAILED; - } -#else - // Open file for writing. - m_File = fopen(settings.pFilePath, "wb"); - - if(m_File == 0) - { - return VK_ERROR_INITIALIZATION_FAILED; - } -#endif - - // Write header. - fprintf(m_File, "%s\n", "Vulkan Memory Allocator,Calls recording"); - fprintf(m_File, "%s\n", "1,8"); - - return VK_SUCCESS; -} - -VmaRecorder::~VmaRecorder() -{ - if(m_File != VMA_NULL) - { - fclose(m_File); - } -} - -void VmaRecorder::RecordCreateAllocator(uint32_t frameIndex) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaCreateAllocator\n", callParams.threadId, callParams.time, frameIndex); - Flush(); -} - -void VmaRecorder::RecordDestroyAllocator(uint32_t frameIndex) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaDestroyAllocator\n", callParams.threadId, callParams.time, frameIndex); - Flush(); -} - -void VmaRecorder::RecordCreatePool(uint32_t frameIndex, const VmaPoolCreateInfo& createInfo, VmaPool pool) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaCreatePool,%u,%u,%llu,%llu,%llu,%p\n", callParams.threadId, callParams.time, frameIndex, - createInfo.memoryTypeIndex, - createInfo.flags, - createInfo.blockSize, - (uint64_t)createInfo.minBlockCount, - (uint64_t)createInfo.maxBlockCount, - pool); - Flush(); -} - -void VmaRecorder::RecordDestroyPool(uint32_t frameIndex, VmaPool pool) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaDestroyPool,%p\n", callParams.threadId, callParams.time, frameIndex, - pool); - Flush(); -} - -void VmaRecorder::RecordAllocateMemory(uint32_t frameIndex, - const VkMemoryRequirements& vkMemReq, - const VmaAllocationCreateInfo& createInfo, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - UserDataString userDataStr(createInfo.flags, createInfo.pUserData); - fprintf(m_File, "%u,%.3f,%u,vmaAllocateMemory,%llu,%llu,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex, - vkMemReq.size, - vkMemReq.alignment, - vkMemReq.memoryTypeBits, - createInfo.flags, - createInfo.usage, - createInfo.requiredFlags, - createInfo.preferredFlags, - createInfo.memoryTypeBits, - createInfo.pool, - allocation, - userDataStr.GetString()); - Flush(); -} - -void VmaRecorder::RecordAllocateMemoryPages(uint32_t frameIndex, - const VkMemoryRequirements& vkMemReq, - const VmaAllocationCreateInfo& createInfo, - uint64_t allocationCount, - const VmaAllocation* pAllocations) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - UserDataString userDataStr(createInfo.flags, createInfo.pUserData); - fprintf(m_File, "%u,%.3f,%u,vmaAllocateMemoryPages,%llu,%llu,%u,%u,%u,%u,%u,%u,%p,", callParams.threadId, callParams.time, frameIndex, - vkMemReq.size, - vkMemReq.alignment, - vkMemReq.memoryTypeBits, - createInfo.flags, - createInfo.usage, - createInfo.requiredFlags, - createInfo.preferredFlags, - createInfo.memoryTypeBits, - createInfo.pool); - PrintPointerList(allocationCount, pAllocations); - fprintf(m_File, ",%s\n", userDataStr.GetString()); - Flush(); -} - -void VmaRecorder::RecordAllocateMemoryForBuffer(uint32_t frameIndex, - const VkMemoryRequirements& vkMemReq, - bool requiresDedicatedAllocation, - bool prefersDedicatedAllocation, - const VmaAllocationCreateInfo& createInfo, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - UserDataString userDataStr(createInfo.flags, createInfo.pUserData); - fprintf(m_File, "%u,%.3f,%u,vmaAllocateMemoryForBuffer,%llu,%llu,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex, - vkMemReq.size, - vkMemReq.alignment, - vkMemReq.memoryTypeBits, - requiresDedicatedAllocation ? 1 : 0, - prefersDedicatedAllocation ? 1 : 0, - createInfo.flags, - createInfo.usage, - createInfo.requiredFlags, - createInfo.preferredFlags, - createInfo.memoryTypeBits, - createInfo.pool, - allocation, - userDataStr.GetString()); - Flush(); -} - -void VmaRecorder::RecordAllocateMemoryForImage(uint32_t frameIndex, - const VkMemoryRequirements& vkMemReq, - bool requiresDedicatedAllocation, - bool prefersDedicatedAllocation, - const VmaAllocationCreateInfo& createInfo, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - UserDataString userDataStr(createInfo.flags, createInfo.pUserData); - fprintf(m_File, "%u,%.3f,%u,vmaAllocateMemoryForImage,%llu,%llu,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex, - vkMemReq.size, - vkMemReq.alignment, - vkMemReq.memoryTypeBits, - requiresDedicatedAllocation ? 1 : 0, - prefersDedicatedAllocation ? 1 : 0, - createInfo.flags, - createInfo.usage, - createInfo.requiredFlags, - createInfo.preferredFlags, - createInfo.memoryTypeBits, - createInfo.pool, - allocation, - userDataStr.GetString()); - Flush(); -} - -void VmaRecorder::RecordFreeMemory(uint32_t frameIndex, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaFreeMemory,%p\n", callParams.threadId, callParams.time, frameIndex, - allocation); - Flush(); -} - -void VmaRecorder::RecordFreeMemoryPages(uint32_t frameIndex, - uint64_t allocationCount, - const VmaAllocation* pAllocations) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaFreeMemoryPages,", callParams.threadId, callParams.time, frameIndex); - PrintPointerList(allocationCount, pAllocations); - fprintf(m_File, "\n"); - Flush(); -} - -void VmaRecorder::RecordSetAllocationUserData(uint32_t frameIndex, - VmaAllocation allocation, - const void* pUserData) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - UserDataString userDataStr( - allocation->IsUserDataString() ? VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT : 0, - pUserData); - fprintf(m_File, "%u,%.3f,%u,vmaSetAllocationUserData,%p,%s\n", callParams.threadId, callParams.time, frameIndex, - allocation, - userDataStr.GetString()); - Flush(); -} - -void VmaRecorder::RecordMapMemory(uint32_t frameIndex, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaMapMemory,%p\n", callParams.threadId, callParams.time, frameIndex, - allocation); - Flush(); -} - -void VmaRecorder::RecordUnmapMemory(uint32_t frameIndex, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaUnmapMemory,%p\n", callParams.threadId, callParams.time, frameIndex, - allocation); - Flush(); -} - -void VmaRecorder::RecordFlushAllocation(uint32_t frameIndex, - VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaFlushAllocation,%p,%llu,%llu\n", callParams.threadId, callParams.time, frameIndex, - allocation, - offset, - size); - Flush(); -} - -void VmaRecorder::RecordInvalidateAllocation(uint32_t frameIndex, - VmaAllocation allocation, VkDeviceSize offset, VkDeviceSize size) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaInvalidateAllocation,%p,%llu,%llu\n", callParams.threadId, callParams.time, frameIndex, - allocation, - offset, - size); - Flush(); -} - -void VmaRecorder::RecordCreateBuffer(uint32_t frameIndex, - const VkBufferCreateInfo& bufCreateInfo, - const VmaAllocationCreateInfo& allocCreateInfo, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - UserDataString userDataStr(allocCreateInfo.flags, allocCreateInfo.pUserData); - fprintf(m_File, "%u,%.3f,%u,vmaCreateBuffer,%u,%llu,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex, - bufCreateInfo.flags, - bufCreateInfo.size, - bufCreateInfo.usage, - bufCreateInfo.sharingMode, - allocCreateInfo.flags, - allocCreateInfo.usage, - allocCreateInfo.requiredFlags, - allocCreateInfo.preferredFlags, - allocCreateInfo.memoryTypeBits, - allocCreateInfo.pool, - allocation, - userDataStr.GetString()); - Flush(); -} - -void VmaRecorder::RecordCreateImage(uint32_t frameIndex, - const VkImageCreateInfo& imageCreateInfo, - const VmaAllocationCreateInfo& allocCreateInfo, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - UserDataString userDataStr(allocCreateInfo.flags, allocCreateInfo.pUserData); - fprintf(m_File, "%u,%.3f,%u,vmaCreateImage,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%u,%p,%p,%s\n", callParams.threadId, callParams.time, frameIndex, - imageCreateInfo.flags, - imageCreateInfo.imageType, - imageCreateInfo.format, - imageCreateInfo.extent.width, - imageCreateInfo.extent.height, - imageCreateInfo.extent.depth, - imageCreateInfo.mipLevels, - imageCreateInfo.arrayLayers, - imageCreateInfo.samples, - imageCreateInfo.tiling, - imageCreateInfo.usage, - imageCreateInfo.sharingMode, - imageCreateInfo.initialLayout, - allocCreateInfo.flags, - allocCreateInfo.usage, - allocCreateInfo.requiredFlags, - allocCreateInfo.preferredFlags, - allocCreateInfo.memoryTypeBits, - allocCreateInfo.pool, - allocation, - userDataStr.GetString()); - Flush(); -} - -void VmaRecorder::RecordDestroyBuffer(uint32_t frameIndex, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaDestroyBuffer,%p\n", callParams.threadId, callParams.time, frameIndex, - allocation); - Flush(); -} - -void VmaRecorder::RecordDestroyImage(uint32_t frameIndex, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaDestroyImage,%p\n", callParams.threadId, callParams.time, frameIndex, - allocation); - Flush(); -} - -void VmaRecorder::RecordGetAllocationInfo(uint32_t frameIndex, - VmaAllocation allocation) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaGetAllocationInfo,%p\n", callParams.threadId, callParams.time, frameIndex, - allocation); - Flush(); -} - -void VmaRecorder::RecordDefragmentationBegin(uint32_t frameIndex, - const VmaDefragmentationInfo2& info, - VmaDefragmentationContext ctx) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaDefragmentationBegin,%u,", callParams.threadId, callParams.time, frameIndex, - info.flags); - PrintPointerList(info.allocationCount, info.pAllocations); - fprintf(m_File, ","); - PrintPointerList(info.poolCount, info.pPools); - fprintf(m_File, ",%llu,%u,%llu,%u,%p,%p\n", - info.maxCpuBytesToMove, - info.maxCpuAllocationsToMove, - info.maxGpuBytesToMove, - info.maxGpuAllocationsToMove, - info.commandBuffer, - ctx); - Flush(); -} - -void VmaRecorder::RecordDefragmentationEnd(uint32_t frameIndex, - VmaDefragmentationContext ctx) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaDefragmentationEnd,%p\n", callParams.threadId, callParams.time, frameIndex, - ctx); - Flush(); -} - -void VmaRecorder::RecordSetPoolName(uint32_t frameIndex, - VmaPool pool, - const char* name) -{ - CallParams callParams; - GetBasicParams(callParams); - - VmaMutexLock lock(m_FileMutex, m_UseMutex); - fprintf(m_File, "%u,%.3f,%u,vmaSetPoolName,%p,%s\n", callParams.threadId, callParams.time, frameIndex, - pool, name != VMA_NULL ? name : ""); - Flush(); -} - -VmaRecorder::UserDataString::UserDataString(VmaAllocationCreateFlags allocFlags, const void* pUserData) -{ - if(pUserData != VMA_NULL) - { - if((allocFlags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0) - { - m_Str = (const char*)pUserData; - } - else - { - // If VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT is not specified, convert the string's memory address to a string and store it. - snprintf(m_PtrStr, 17, "%p", pUserData); - m_Str = m_PtrStr; - } - } - else - { - m_Str = ""; - } -} - -void VmaRecorder::WriteConfiguration( - const VkPhysicalDeviceProperties& devProps, - const VkPhysicalDeviceMemoryProperties& memProps, - uint32_t vulkanApiVersion, - bool dedicatedAllocationExtensionEnabled, - bool bindMemory2ExtensionEnabled, - bool memoryBudgetExtensionEnabled, - bool deviceCoherentMemoryExtensionEnabled) -{ - fprintf(m_File, "Config,Begin\n"); - - fprintf(m_File, "VulkanApiVersion,%u,%u\n", VK_VERSION_MAJOR(vulkanApiVersion), VK_VERSION_MINOR(vulkanApiVersion)); - - fprintf(m_File, "PhysicalDevice,apiVersion,%u\n", devProps.apiVersion); - fprintf(m_File, "PhysicalDevice,driverVersion,%u\n", devProps.driverVersion); - fprintf(m_File, "PhysicalDevice,vendorID,%u\n", devProps.vendorID); - fprintf(m_File, "PhysicalDevice,deviceID,%u\n", devProps.deviceID); - fprintf(m_File, "PhysicalDevice,deviceType,%u\n", devProps.deviceType); - fprintf(m_File, "PhysicalDevice,deviceName,%s\n", devProps.deviceName); - - fprintf(m_File, "PhysicalDeviceLimits,maxMemoryAllocationCount,%u\n", devProps.limits.maxMemoryAllocationCount); - fprintf(m_File, "PhysicalDeviceLimits,bufferImageGranularity,%llu\n", devProps.limits.bufferImageGranularity); - fprintf(m_File, "PhysicalDeviceLimits,nonCoherentAtomSize,%llu\n", devProps.limits.nonCoherentAtomSize); - - fprintf(m_File, "PhysicalDeviceMemory,HeapCount,%u\n", memProps.memoryHeapCount); - for(uint32_t i = 0; i < memProps.memoryHeapCount; ++i) - { - fprintf(m_File, "PhysicalDeviceMemory,Heap,%u,size,%llu\n", i, memProps.memoryHeaps[i].size); - fprintf(m_File, "PhysicalDeviceMemory,Heap,%u,flags,%u\n", i, memProps.memoryHeaps[i].flags); - } - fprintf(m_File, "PhysicalDeviceMemory,TypeCount,%u\n", memProps.memoryTypeCount); - for(uint32_t i = 0; i < memProps.memoryTypeCount; ++i) - { - fprintf(m_File, "PhysicalDeviceMemory,Type,%u,heapIndex,%u\n", i, memProps.memoryTypes[i].heapIndex); - fprintf(m_File, "PhysicalDeviceMemory,Type,%u,propertyFlags,%u\n", i, memProps.memoryTypes[i].propertyFlags); - } - - fprintf(m_File, "Extension,VK_KHR_dedicated_allocation,%u\n", dedicatedAllocationExtensionEnabled ? 1 : 0); - fprintf(m_File, "Extension,VK_KHR_bind_memory2,%u\n", bindMemory2ExtensionEnabled ? 1 : 0); - fprintf(m_File, "Extension,VK_EXT_memory_budget,%u\n", memoryBudgetExtensionEnabled ? 1 : 0); - fprintf(m_File, "Extension,VK_AMD_device_coherent_memory,%u\n", deviceCoherentMemoryExtensionEnabled ? 1 : 0); - - fprintf(m_File, "Macro,VMA_DEBUG_ALWAYS_DEDICATED_MEMORY,%u\n", VMA_DEBUG_ALWAYS_DEDICATED_MEMORY ? 1 : 0); - fprintf(m_File, "Macro,VMA_MIN_ALIGNMENT,%llu\n", (VkDeviceSize)VMA_MIN_ALIGNMENT); - fprintf(m_File, "Macro,VMA_DEBUG_MARGIN,%llu\n", (VkDeviceSize)VMA_DEBUG_MARGIN); - fprintf(m_File, "Macro,VMA_DEBUG_INITIALIZE_ALLOCATIONS,%u\n", VMA_DEBUG_INITIALIZE_ALLOCATIONS ? 1 : 0); - fprintf(m_File, "Macro,VMA_DEBUG_DETECT_CORRUPTION,%u\n", VMA_DEBUG_DETECT_CORRUPTION ? 1 : 0); - fprintf(m_File, "Macro,VMA_DEBUG_GLOBAL_MUTEX,%u\n", VMA_DEBUG_GLOBAL_MUTEX ? 1 : 0); - fprintf(m_File, "Macro,VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY,%llu\n", (VkDeviceSize)VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY); - fprintf(m_File, "Macro,VMA_SMALL_HEAP_MAX_SIZE,%llu\n", (VkDeviceSize)VMA_SMALL_HEAP_MAX_SIZE); - fprintf(m_File, "Macro,VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE,%llu\n", (VkDeviceSize)VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE); - - fprintf(m_File, "Config,End\n"); -} - -void VmaRecorder::GetBasicParams(CallParams& outParams) -{ - #if defined(_WIN32) - outParams.threadId = GetCurrentThreadId(); - #else - // Use C++11 features to get thread id and convert it to uint32_t. - // There is room for optimization since sstream is quite slow. - // Is there a better way to convert std::this_thread::get_id() to uint32_t? - std::thread::id thread_id = std::this_thread::get_id(); - std::stringstream thread_id_to_string_converter; - thread_id_to_string_converter << thread_id; - std::string thread_id_as_string = thread_id_to_string_converter.str(); - outParams.threadId = static_cast<uint32_t>(std::stoi(thread_id_as_string.c_str())); - #endif - - auto current_time = std::chrono::high_resolution_clock::now(); - - outParams.time = std::chrono::duration<double, std::chrono::seconds::period>(current_time - m_RecordingStartTime).count(); -} - -void VmaRecorder::PrintPointerList(uint64_t count, const VmaAllocation* pItems) -{ - if(count) - { - fprintf(m_File, "%p", pItems[0]); - for(uint64_t i = 1; i < count; ++i) - { - fprintf(m_File, " %p", pItems[i]); - } - } -} - -void VmaRecorder::Flush() -{ - if((m_Flags & VMA_RECORD_FLUSH_AFTER_CALL_BIT) != 0) - { - fflush(m_File); - } -} - -#endif // VMA_RECORDING_ENABLED - #ifndef _VMA_ALLOCATOR_T_FUNCTIONS VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) : m_UseMutex((pCreateInfo->flags & VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT) == 0), @@ -13773,9 +13021,6 @@ VmaAllocator_T::VmaAllocator_T(const VmaAllocatorCreateInfo* pCreateInfo) : m_GpuDefragmentationMemoryTypeBits(UINT32_MAX), m_NextPoolId(0), m_GlobalMemoryTypeBits(UINT32_MAX) -#if VMA_RECORDING_ENABLED - ,m_pRecorder(VMA_NULL) -#endif { if(m_VulkanApiVersion >= VK_MAKE_VERSION(1, 1, 0)) { @@ -13923,31 +13168,6 @@ VkResult VmaAllocator_T::Init(const VmaAllocatorCreateInfo* pCreateInfo) { VkResult res = VK_SUCCESS; - if(pCreateInfo->pRecordSettings != VMA_NULL && - !VmaStrIsEmpty(pCreateInfo->pRecordSettings->pFilePath)) - { -#if VMA_RECORDING_ENABLED - m_pRecorder = vma_new(this, VmaRecorder)(); - res = m_pRecorder->Init(*pCreateInfo->pRecordSettings, m_UseMutex); - if(res != VK_SUCCESS) - { - return res; - } - m_pRecorder->WriteConfiguration( - m_PhysicalDeviceProperties, - m_MemProps, - m_VulkanApiVersion, - m_UseKhrDedicatedAllocation, - m_UseKhrBindMemory2, - m_UseExtMemoryBudget, - m_UseAmdDeviceCoherentMemory); - m_pRecorder->RecordCreateAllocator(GetCurrentFrameIndex()); -#else - VMA_ASSERT(0 && "VmaAllocatorCreateInfo::pRecordSettings used, but not supported due to VMA_RECORDING_ENABLED not defined to 1."); - return VK_ERROR_FEATURE_NOT_PRESENT; -#endif - } - #if VMA_MEMORY_BUDGET if(m_UseExtMemoryBudget) { @@ -13960,14 +13180,6 @@ VkResult VmaAllocator_T::Init(const VmaAllocatorCreateInfo* pCreateInfo) VmaAllocator_T::~VmaAllocator_T() { -#if VMA_RECORDING_ENABLED - if(m_pRecorder != VMA_NULL) - { - m_pRecorder->RecordDestroyAllocator(GetCurrentFrameIndex()); - vma_delete(this, m_pRecorder); - } -#endif - VMA_ASSERT(m_Pools.IsEmpty()); for(size_t memTypeIndex = GetMemoryTypeCount(); memTypeIndex--; ) @@ -16134,16 +15346,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreatePool( VMA_DEBUG_GLOBAL_MUTEX_LOCK - VkResult res = allocator->CreatePool(pCreateInfo, pPool); - -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordCreatePool(allocator->GetCurrentFrameIndex(), *pCreateInfo, *pPool); - } -#endif - - return res; + return allocator->CreatePool(pCreateInfo, pPool); } VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool( @@ -16161,13 +15364,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyPool( VMA_DEBUG_GLOBAL_MUTEX_LOCK -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordDestroyPool(allocator->GetCurrentFrameIndex(), pool); - } -#endif - allocator->DestroyPool(pool); } @@ -16181,8 +15377,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetPoolStats( VMA_DEBUG_GLOBAL_MUTEX_LOCK allocator->GetPoolStats(pool, pPoolStats); -} - VMA_CALL_PRE VkResult VMA_CALL_POST vmaCheckPoolCorruption(VmaAllocator allocator, VmaPool pool) { VMA_ASSERT(allocator && pool); @@ -16220,13 +15414,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaSetPoolName( VMA_DEBUG_GLOBAL_MUTEX_LOCK pool->SetName(pName); - -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordSetPoolName(allocator->GetCurrentFrameIndex(), pool, pName); - } -#endif } VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory( @@ -16254,17 +15441,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemory( 1, // allocationCount pAllocation); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordAllocateMemory( - allocator->GetCurrentFrameIndex(), - *pVkMemoryRequirements, - *pCreateInfo, - *pAllocation); - } -#endif - if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS) { allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); @@ -16304,18 +15480,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryPages( allocationCount, pAllocations); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordAllocateMemoryPages( - allocator->GetCurrentFrameIndex(), - *pVkMemoryRequirements, - *pCreateInfo, - (uint64_t)allocationCount, - pAllocations); - } -#endif - if(pAllocationInfo != VMA_NULL && result == VK_SUCCESS) { for(size_t i = 0; i < allocationCount; ++i) @@ -16359,19 +15523,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForBuffer( 1, // allocationCount pAllocation); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordAllocateMemoryForBuffer( - allocator->GetCurrentFrameIndex(), - vkMemReq, - requiresDedicatedAllocation, - prefersDedicatedAllocation, - *pCreateInfo, - *pAllocation); - } -#endif - if(pAllocationInfo && result == VK_SUCCESS) { allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); @@ -16411,19 +15562,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaAllocateMemoryForImage( 1, // allocationCount pAllocation); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordAllocateMemoryForImage( - allocator->GetCurrentFrameIndex(), - vkMemReq, - requiresDedicatedAllocation, - prefersDedicatedAllocation, - *pCreateInfo, - *pAllocation); - } -#endif - if(pAllocationInfo && result == VK_SUCCESS) { allocator->GetAllocationInfo(*pAllocation, pAllocationInfo); @@ -16447,15 +15585,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemory( VMA_DEBUG_GLOBAL_MUTEX_LOCK -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordFreeMemory( - allocator->GetCurrentFrameIndex(), - allocation); - } -#endif - allocator->FreeMemory( 1, // allocationCount &allocation); @@ -16477,16 +15606,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeMemoryPages( VMA_DEBUG_GLOBAL_MUTEX_LOCK -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordFreeMemoryPages( - allocator->GetCurrentFrameIndex(), - (uint64_t)allocationCount, - pAllocations); - } -#endif - allocator->FreeMemory(allocationCount, pAllocations); } @@ -16499,18 +15618,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationInfo( VMA_DEBUG_GLOBAL_MUTEX_LOCK -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordGetAllocationInfo( - allocator->GetCurrentFrameIndex(), - allocation); - } -#endif - allocator->GetAllocationInfo(allocation, pAllocationInfo); -} - VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData( VmaAllocator allocator, VmaAllocation allocation, @@ -16521,16 +15629,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaSetAllocationUserData( VMA_DEBUG_GLOBAL_MUTEX_LOCK allocation->SetUserData(allocator, pUserData); - -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordSetAllocationUserData( - allocator->GetCurrentFrameIndex(), - allocation, - pUserData); - } -#endif } VMA_CALL_PRE void VMA_CALL_POST vmaGetAllocationMemoryProperties( @@ -16552,18 +15650,7 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaMapMemory( VMA_DEBUG_GLOBAL_MUTEX_LOCK - VkResult res = allocator->Map(allocation, ppData); - -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordMapMemory( - allocator->GetCurrentFrameIndex(), - allocation); - } -#endif - - return res; + return allocator->Map(allocation, ppData); } VMA_CALL_PRE void VMA_CALL_POST vmaUnmapMemory( @@ -16574,15 +15661,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaUnmapMemory( VMA_DEBUG_GLOBAL_MUTEX_LOCK -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordUnmapMemory( - allocator->GetCurrentFrameIndex(), - allocation); - } -#endif - allocator->Unmap(allocation); } @@ -16596,15 +15674,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocation(VmaAllocator allocator, V const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_FLUSH); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordFlushAllocation( - allocator->GetCurrentFrameIndex(), - allocation, offset, size); - } -#endif - return res; } @@ -16618,15 +15687,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocation(VmaAllocator allocat const VkResult res = allocator->FlushOrInvalidateAllocation(allocation, offset, size, VMA_CACHE_INVALIDATE); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordInvalidateAllocation( - allocator->GetCurrentFrameIndex(), - allocation, offset, size); - } -#endif - return res; } @@ -16652,13 +15712,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaFlushAllocations( const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_FLUSH); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - //TODO - } -#endif - return res; } @@ -16684,13 +15737,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaInvalidateAllocations( const VkResult res = allocator->FlushOrInvalidateAllocations(allocationCount, allocations, offsets, sizes, VMA_CACHE_INVALIDATE); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - //TODO - } -#endif - return res; } @@ -16765,14 +15811,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationBegin( VkResult res = allocator->DefragmentationBegin(*pInfo, pStats, pContext); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordDefragmentationBegin( - allocator->GetCurrentFrameIndex(), *pInfo, *pContext); - } -#endif - return res; } @@ -16787,15 +15825,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaDefragmentationEnd( if(context != VK_NULL_HANDLE) { VMA_DEBUG_GLOBAL_MUTEX_LOCK - -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordDefragmentationEnd( - allocator->GetCurrentFrameIndex(), context); - } -#endif - return allocator->DefragmentationEnd(context); } else @@ -16956,17 +15985,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBuffer( 1, // allocationCount pAllocation); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordCreateBuffer( - allocator->GetCurrentFrameIndex(), - *pBufferCreateInfo, - *pAllocationCreateInfo, - *pAllocation); - } -#endif - if(res >= 0) { // 3. Bind buffer with memory. @@ -17062,13 +16080,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateBufferWithAlignment( 1, // allocationCount pAllocation); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - VMA_ASSERT(0 && "Not implemented."); - } -#endif - if(res >= 0) { // 3. Bind buffer with memory. @@ -17120,15 +16131,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyBuffer( VMA_DEBUG_GLOBAL_MUTEX_LOCK -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordDestroyBuffer( - allocator->GetCurrentFrameIndex(), - allocation); - } -#endif - if(buffer != VK_NULL_HANDLE) { (*allocator->GetVulkanFunctions().vkDestroyBuffer)(allocator->m_hDevice, buffer, allocator->GetAllocationCallbacks()); @@ -17199,17 +16201,6 @@ VMA_CALL_PRE VkResult VMA_CALL_POST vmaCreateImage( 1, // allocationCount pAllocation); -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordCreateImage( - allocator->GetCurrentFrameIndex(), - *pImageCreateInfo, - *pAllocationCreateInfo, - *pAllocation); - } -#endif - if(res >= 0) { // 3. Bind image with memory. @@ -17261,15 +16252,6 @@ VMA_CALL_PRE void VMA_CALL_POST vmaDestroyImage( VMA_DEBUG_GLOBAL_MUTEX_LOCK -#if VMA_RECORDING_ENABLED - if(allocator->GetRecorder() != VMA_NULL) - { - allocator->GetRecorder()->RecordDestroyImage( - allocator->GetCurrentFrameIndex(), - allocation); - } -#endif - if(image != VK_NULL_HANDLE) { (*allocator->GetVulkanFunctions().vkDestroyImage)(allocator->m_hDevice, image, allocator->GetAllocationCallbacks()); @@ -18826,58 +17808,6 @@ Margin validation (corruption detection) works only for memory types that are `HOST_VISIBLE` and `HOST_COHERENT`. -\page record_and_replay Record and replay - -\section record_and_replay_introduction Introduction - -While using the library, sequence of calls to its functions together with their -parameters can be recorded to a file and later replayed using standalone player -application. It can be useful to: - -- Test correctness - check if same sequence of calls will not cause crash or - failures on a target platform. -- Gather statistics - see number of allocations, peak memory usage, number of - calls etc. -- Benchmark performance - see how much time it takes to replay the whole - sequence. - -\section record_and_replay_usage Usage - -Recording functionality is disabled by default. -To enable it, define following macro before every include of this library: - -\code -#define VMA_RECORDING_ENABLED 1 -\endcode - -<b>To record sequence of calls to a file:</b> Fill in -VmaAllocatorCreateInfo::pRecordSettings member while creating #VmaAllocator -object. File is opened and written during whole lifetime of the allocator. - -<b>To replay file:</b> Use VmaReplay - standalone command-line program. -Precompiled binary can be found in "bin" directory. -Its source can be found in "src/VmaReplay" directory. -Its project is generated by Premake. -Command line syntax is printed when the program is launched without parameters. -Basic usage: - - VmaReplay.exe MyRecording.csv - -<b>Documentation of file format</b> can be found in file: "docs/Recording file format.md". -It is a human-readable, text file in CSV format (Comma Separated Values). - -\section record_and_replay_additional_considerations Additional considerations - -- Replaying file that was recorded on a different GPU (with different parameters - like `bufferImageGranularity`, `nonCoherentAtomSize`, and especially different - set of memory heaps and types) may give different performance and memory usage - results, as well as issue some warnings and errors. -- Current implementation of recording in VMA, as well as VmaReplay application, is - coded and tested only on Windows. Inclusion of recording code is driven by - `VMA_RECORDING_ENABLED` macro. Support for other platforms should be easy to - add. Contributions are welcomed. - - \page opengl_interop OpenGL Interop VMA provides some features that help with interoperability with OpenGL. diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index a5e751b..a55a6ab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -104,7 +104,3 @@ endif() if(VMA_BUILD_SAMPLE_SHADERS) add_subdirectory(Shaders) endif() - -if(VMA_BUILD_REPLAY) - add_subdirectory(VmaReplay) -endif() diff --git a/src/VmaReplay/CMakeLists.txt b/src/VmaReplay/CMakeLists.txt deleted file mode 100644 index 56e4fcc..0000000 --- a/src/VmaReplay/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ -# This file will only be executed if VMA_BUILD_REPLAY is set to ON - -if (WIN32) - set(VMA_REPLAY_SOURCE_FILES - Common.cpp - Common.h - Constants.cpp - Constants.h - VmaUsage.cpp - VmaUsage.h - VmaReplay.cpp - ) - - add_executable(VmaReplay ${VMA_REPLAY_SOURCE_FILES}) - add_dependencies(VmaReplay VulkanMemoryAllocator) - - # Enable multithreaded compiling - target_compile_options(VmaReplay PRIVATE "/MP") - - target_link_libraries( - VmaReplay - - PRIVATE - Vulkan::Vulkan - ) -else() - message(STATUS "VmaReplay is not supported on Linux") -endif() diff --git a/src/VmaReplay/Common.cpp b/src/VmaReplay/Common.cpp deleted file mode 100644 index 54039dd..0000000 --- a/src/VmaReplay/Common.cpp +++ /dev/null @@ -1,721 +0,0 @@ -// -// Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "Common.h" - -bool StrRangeToPtrList(const StrRange& s, std::vector<uint64_t>& out) -{ - out.clear(); - StrRange currRange = { s.beg, nullptr }; - while(currRange.beg < s.end) - { - currRange.end = currRange.beg; - while(currRange.end < s.end && *currRange.end != ' ') - { - ++currRange.end; - } - - uint64_t ptr = 0; - if(!StrRangeToPtr(currRange, ptr)) - { - return false; - } - out.push_back(ptr); - - currRange.beg = currRange.end + 1; - } - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -// LineSplit class - -bool LineSplit::GetNextLine(StrRange& out) -{ - if(m_NextLineBeg < m_NumBytes) - { - out.beg = m_Data + m_NextLineBeg; - size_t currLineEnd = m_NextLineBeg; - while(currLineEnd < m_NumBytes && m_Data[currLineEnd] != '\n') - ++currLineEnd; - out.end = m_Data + currLineEnd; - // Ignore trailing '\r' to support Windows end of line. - if(out.end > out.beg && *(out.end - 1) == '\r') - { - --out.end; - } - m_NextLineBeg = currLineEnd + 1; // Past '\n' - ++m_NextLineIndex; - return true; - } - else - return false; -} - -//////////////////////////////////////////////////////////////////////////////// -// CsvSplit class - -void CsvSplit::Set(const StrRange& line, size_t maxCount) -{ - assert(maxCount <= RANGE_COUNT_MAX); - m_Line = line; - const size_t strLen = line.length(); - size_t rangeIndex = 0; - size_t charIndex = 0; - while(charIndex < strLen && rangeIndex < maxCount) - { - m_Ranges[rangeIndex * 2] = charIndex; - while(charIndex < strLen && (rangeIndex + 1 == maxCount || m_Line.beg[charIndex] != ',')) - ++charIndex; - m_Ranges[rangeIndex * 2 + 1] = charIndex; - ++rangeIndex; - ++charIndex; // Past ',' - } - m_Count = rangeIndex; -} - -//////////////////////////////////////////////////////////////////////////////// -// class CmdLineParser - -bool CmdLineParser::ReadNextArg(std::string *OutArg) -{ - if (m_argv != NULL) - { - if (m_ArgIndex >= (size_t)m_argc) return false; - - *OutArg = m_argv[m_ArgIndex]; - m_ArgIndex++; - return true; - } - else - { - if (m_ArgIndex >= m_CmdLineLength) return false; - - OutArg->clear(); - bool InsideQuotes = false; - while (m_ArgIndex < m_CmdLineLength) - { - char Ch = m_CmdLine[m_ArgIndex]; - if (Ch == '\\') - { - bool FollowedByQuote = false; - size_t BackslashCount = 1; - size_t TmpIndex = m_ArgIndex + 1; - while (TmpIndex < m_CmdLineLength) - { - char TmpCh = m_CmdLine[TmpIndex]; - if (TmpCh == '\\') - { - BackslashCount++; - TmpIndex++; - } - else if (TmpCh == '"') - { - FollowedByQuote = true; - break; - } - else - break; - } - - if (FollowedByQuote) - { - if (BackslashCount % 2 == 0) - { - for (size_t i = 0; i < BackslashCount / 2; i++) - *OutArg += '\\'; - m_ArgIndex += BackslashCount + 1; - InsideQuotes = !InsideQuotes; - } - else - { - for (size_t i = 0; i < BackslashCount / 2; i++) - *OutArg += '\\'; - *OutArg += '"'; - m_ArgIndex += BackslashCount + 1; - } - } - else - { - for (size_t i = 0; i < BackslashCount; i++) - *OutArg += '\\'; - m_ArgIndex += BackslashCount; - } - } - else if (Ch == '"') - { - InsideQuotes = !InsideQuotes; - m_ArgIndex++; - } - else if (isspace(Ch)) - { - if (InsideQuotes) - { - *OutArg += Ch; - m_ArgIndex++; - } - else - { - m_ArgIndex++; - break; - } - } - else - { - *OutArg += Ch; - m_ArgIndex++; - } - } - - while (m_ArgIndex < m_CmdLineLength && isspace(m_CmdLine[m_ArgIndex])) - m_ArgIndex++; - - return true; - } -} - -CmdLineParser::SHORT_OPT * CmdLineParser::FindShortOpt(char Opt) -{ - for (size_t i = 0; i < m_ShortOpts.size(); i++) - if (m_ShortOpts[i].Opt == Opt) - return &m_ShortOpts[i]; - return NULL; -} - -CmdLineParser::LONG_OPT * CmdLineParser::FindLongOpt(const std::string &Opt) -{ - for (size_t i = 0; i < m_LongOpts.size(); i++) - if (m_LongOpts[i].Opt == Opt) - return &m_LongOpts[i]; - return NULL; -} - -CmdLineParser::CmdLineParser(int argc, char **argv) : - m_argv(argv), - m_CmdLine(NULL), - m_argc(argc), - m_CmdLineLength(0), - m_ArgIndex(1), - m_InsideMultioption(false), - m_LastArgIndex(0), - m_LastOptId(0) -{ - assert(argc > 0); - assert(argv != NULL); -} - -CmdLineParser::CmdLineParser(const char *CmdLine) : - m_argv(NULL), - m_CmdLine(CmdLine), - m_argc(0), - m_ArgIndex(0), - m_InsideMultioption(false), - m_LastArgIndex(0), - m_LastOptId(0) -{ - assert(CmdLine != NULL); - - m_CmdLineLength = strlen(m_CmdLine); - - while (m_ArgIndex < m_CmdLineLength && isspace(m_CmdLine[m_ArgIndex])) - m_ArgIndex++; -} - -void CmdLineParser::RegisterOpt(uint32_t Id, char Opt, bool Parameter) -{ - assert(Opt != '\0'); - - m_ShortOpts.push_back(SHORT_OPT(Id, Opt, Parameter)); -} - -void CmdLineParser::RegisterOpt(uint32_t Id, const std::string &Opt, bool Parameter) -{ - assert(!Opt.empty()); - - m_LongOpts.push_back(LONG_OPT(Id, Opt, Parameter)); -} - -CmdLineParser::RESULT CmdLineParser::ReadNext() -{ - if (m_InsideMultioption) - { - assert(m_LastArgIndex < m_LastArg.length()); - SHORT_OPT *so = FindShortOpt(m_LastArg[m_LastArgIndex]); - if (so == NULL) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - if (so->Parameter) - { - if (m_LastArg.length() == m_LastArgIndex+1) - { - if (!ReadNextArg(&m_LastParameter)) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - m_InsideMultioption = false; - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - else if (m_LastArg[m_LastArgIndex+1] == '=') - { - m_InsideMultioption = false; - m_LastParameter = m_LastArg.substr(m_LastArgIndex+2); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - else - { - m_InsideMultioption = false; - m_LastParameter = m_LastArg.substr(m_LastArgIndex+1); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - } - else - { - if (m_LastArg.length() == m_LastArgIndex+1) - { - m_InsideMultioption = false; - m_LastParameter.clear(); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - else - { - m_LastArgIndex++; - - m_LastParameter.clear(); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - } - } - else - { - if (!ReadNextArg(&m_LastArg)) - { - m_LastParameter.clear(); - m_LastOptId = 0; - return CmdLineParser::RESULT_END; - } - - if (!m_LastArg.empty() && m_LastArg[0] == '-') - { - if (m_LastArg.length() > 1 && m_LastArg[1] == '-') - { - size_t EqualIndex = m_LastArg.find('=', 2); - if (EqualIndex != std::string::npos) - { - LONG_OPT *lo = FindLongOpt(m_LastArg.substr(2, EqualIndex-2)); - if (lo == NULL || lo->Parameter == false) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - m_LastParameter = m_LastArg.substr(EqualIndex+1); - m_LastOptId = lo->Id; - return CmdLineParser::RESULT_OPT; - } - else - { - LONG_OPT *lo = FindLongOpt(m_LastArg.substr(2)); - if (lo == NULL) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - if (lo->Parameter) - { - if (!ReadNextArg(&m_LastParameter)) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - } - else - m_LastParameter.clear(); - m_LastOptId = lo->Id; - return CmdLineParser::RESULT_OPT; - } - } - else - { - if (m_LastArg.length() < 2) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - SHORT_OPT *so = FindShortOpt(m_LastArg[1]); - if (so == NULL) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - if (so->Parameter) - { - if (m_LastArg.length() == 2) - { - if (!ReadNextArg(&m_LastParameter)) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - else if (m_LastArg[2] == '=') - { - m_LastParameter = m_LastArg.substr(3); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - else - { - m_LastParameter = m_LastArg.substr(2); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - } - else - { - if (m_LastArg.length() == 2) - { - m_LastParameter.clear(); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - else - { - m_InsideMultioption = true; - m_LastArgIndex = 2; - - m_LastParameter.clear(); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - } - } - } - else if (!m_LastArg.empty() && m_LastArg[0] == '/') - { - size_t EqualIndex = m_LastArg.find('=', 1); - if (EqualIndex != std::string::npos) - { - if (EqualIndex == 2) - { - SHORT_OPT *so = FindShortOpt(m_LastArg[1]); - if (so != NULL) - { - if (so->Parameter == false) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - m_LastParameter = m_LastArg.substr(EqualIndex+1); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - } - LONG_OPT *lo = FindLongOpt(m_LastArg.substr(1, EqualIndex-1)); - if (lo == NULL || lo->Parameter == false) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - m_LastParameter = m_LastArg.substr(EqualIndex+1); - m_LastOptId = lo->Id; - return CmdLineParser::RESULT_OPT; - } - else - { - if (m_LastArg.length() == 2) - { - SHORT_OPT *so = FindShortOpt(m_LastArg[1]); - if (so != NULL) - { - if (so->Parameter) - { - if (!ReadNextArg(&m_LastParameter)) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - } - else - m_LastParameter.clear(); - m_LastOptId = so->Id; - return CmdLineParser::RESULT_OPT; - } - } - LONG_OPT *lo = FindLongOpt(m_LastArg.substr(1)); - if (lo == NULL) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - if (lo->Parameter) - { - if (!ReadNextArg(&m_LastParameter)) - { - m_LastOptId = 0; - m_LastParameter.clear(); - return CmdLineParser::RESULT_ERROR; - } - } - else - m_LastParameter.clear(); - m_LastOptId = lo->Id; - return CmdLineParser::RESULT_OPT; - } - } - else - { - m_LastOptId = 0; - m_LastParameter = m_LastArg; - return CmdLineParser::RESULT_PARAMETER; - } - } -} - -uint32_t CmdLineParser::GetOptId() -{ - return m_LastOptId; -} - -const std::string & CmdLineParser::GetParameter() -{ - return m_LastParameter; -} - -//////////////////////////////////////////////////////////////////////////////// -// Glolals - -/* - -void SetConsoleColor(CONSOLE_COLOR color) -{ - WORD attr = 0; - switch(color) - { - case CONSOLE_COLOR::INFO: - attr = FOREGROUND_INTENSITY;; - break; - case CONSOLE_COLOR::NORMAL: - attr = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE; - break; - case CONSOLE_COLOR::WARNING: - attr = FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_INTENSITY; - break; - case CONSOLE_COLOR::ERROR_: - attr = FOREGROUND_RED | FOREGROUND_INTENSITY; - break; - default: - assert(0); - } - - HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); - SetConsoleTextAttribute(out, attr); -} - -void PrintMessage(CONSOLE_COLOR color, const char* msg) -{ - if(color != CONSOLE_COLOR::NORMAL) - SetConsoleColor(color); - - printf("%s\n", msg); - - if (color != CONSOLE_COLOR::NORMAL) - SetConsoleColor(CONSOLE_COLOR::NORMAL); -} - -void PrintMessage(CONSOLE_COLOR color, const wchar_t* msg) -{ - if(color != CONSOLE_COLOR::NORMAL) - SetConsoleColor(color); - - wprintf(L"%s\n", msg); - - if (color != CONSOLE_COLOR::NORMAL) - SetConsoleColor(CONSOLE_COLOR::NORMAL); -} - -static const size_t CONSOLE_SMALL_BUF_SIZE = 256; - -void PrintMessageV(CONSOLE_COLOR color, const char* format, va_list argList) -{ - size_t dstLen = (size_t)::_vscprintf(format, argList); - if(dstLen) - { - bool useSmallBuf = dstLen < CONSOLE_SMALL_BUF_SIZE; - char smallBuf[CONSOLE_SMALL_BUF_SIZE]; - std::vector<char> bigBuf(useSmallBuf ? 0 : dstLen + 1); - char* bufPtr = useSmallBuf ? smallBuf : bigBuf.data(); - ::vsprintf_s(bufPtr, dstLen + 1, format, argList); - PrintMessage(color, bufPtr); - } -} - -void PrintMessageV(CONSOLE_COLOR color, const wchar_t* format, va_list argList) -{ - size_t dstLen = (size_t)::_vcwprintf(format, argList); - if(dstLen) - { - bool useSmallBuf = dstLen < CONSOLE_SMALL_BUF_SIZE; - wchar_t smallBuf[CONSOLE_SMALL_BUF_SIZE]; - std::vector<wchar_t> bigBuf(useSmallBuf ? 0 : dstLen + 1); - wchar_t* bufPtr = useSmallBuf ? smallBuf : bigBuf.data(); - ::vswprintf_s(bufPtr, dstLen + 1, format, argList); - PrintMessage(color, bufPtr); - } -} - -void PrintMessageF(CONSOLE_COLOR color, const char* format, ...) -{ - va_list argList; - va_start(argList, format); - PrintMessageV(color, format, argList); - va_end(argList); -} - -void PrintMessageF(CONSOLE_COLOR color, const wchar_t* format, ...) -{ - va_list argList; - va_start(argList, format); - PrintMessageV(color, format, argList); - va_end(argList); -} - -void PrintWarningF(const char* format, ...) -{ - va_list argList; - va_start(argList, format); - PrintMessageV(CONSOLE_COLOR::WARNING, format, argList); - va_end(argList); -} - -void PrintWarningF(const wchar_t* format, ...) -{ - va_list argList; - va_start(argList, format); - PrintMessageV(CONSOLE_COLOR::WARNING, format, argList); - va_end(argList); -} - -void PrintErrorF(const char* format, ...) -{ - va_list argList; - va_start(argList, format); - PrintMessageV(CONSOLE_COLOR::WARNING, format, argList); - va_end(argList); -} - -void PrintErrorF(const wchar_t* format, ...) -{ - va_list argList; - va_start(argList, format); - PrintMessageV(CONSOLE_COLOR::WARNING, format, argList); - va_end(argList); -} -*/ - -void SecondsToFriendlyStr(float seconds, std::string& out) -{ - if(seconds == 0.f) - { - out = "0"; - return; - } - - if (seconds < 0.f) - { - out = "-"; - seconds = -seconds; - } - else - { - out.clear(); - } - - char s[32]; - - // #.### ns - if(seconds < 1e-6) - { - sprintf_s(s, "%.3f ns", seconds * 1e9); - out += s; - } - // #.### us - else if(seconds < 1e-3) - { - sprintf_s(s, "%.3f us", seconds * 1e6); - out += s; - } - // #.### ms - else if(seconds < 1.f) - { - sprintf_s(s, "%.3f ms", seconds * 1e3); - out += s; - } - // #.### s - else if(seconds < 60.f) - { - sprintf_s(s, "%.3f s", seconds); - out += s; - } - else - { - uint64_t seconds_u = (uint64_t)seconds; - // "#:## min" - if (seconds_u < 3600) - { - uint64_t minutes = seconds_u / 60; - seconds_u -= minutes * 60; - sprintf_s(s, "%llu:%02llu min", minutes, seconds_u); - out += s; - } - // "#:##:## h" - else - { - uint64_t minutes = seconds_u / 60; - seconds_u -= minutes * 60; - uint64_t hours = minutes / 60; - minutes -= hours * 60; - sprintf_s(s, "%llu:%02llu:%02llu h", hours, minutes, seconds_u); - out += s; - } - } -} diff --git a/src/VmaReplay/Common.h b/src/VmaReplay/Common.h deleted file mode 100644 index 8c839b0..0000000 --- a/src/VmaReplay/Common.h +++ /dev/null @@ -1,426 +0,0 @@ -// -// Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#pragma once - -#include "VmaUsage.h" - -#include <iostream> -#include <fstream> -#include <vector> -#include <memory> -#include <algorithm> -#include <numeric> -#include <array> -#include <type_traits> -#include <utility> -#include <chrono> -#include <string> -#include <limits> - -#include <cassert> -#include <cstdlib> -#include <cstdio> -#include <cstdarg> - -typedef std::chrono::high_resolution_clock::time_point time_point; -typedef std::chrono::high_resolution_clock::duration duration; - -inline float ToFloatSeconds(duration d) -{ - return std::chrono::duration_cast<std::chrono::duration<float>>(d).count(); -} - -void SecondsToFriendlyStr(float seconds, std::string& out); - -template <typename T> -T ceil_div(T x, T y) -{ - return (x+y-1) / y; -} -template <typename T> -inline T round_div(T x, T y) -{ - return (x+y/(T)2) / y; -} - -template <typename T> -inline T align_up(T val, T align) -{ - return (val + align - 1) / align * align; -} - -struct StrRange -{ - const char* beg; - const char* end; - - StrRange() { } - StrRange(const char* beg, const char* end) : beg(beg), end(end) { } - explicit StrRange(const char* sz) : beg(sz), end(sz + strlen(sz)) { } - explicit StrRange(const std::string& s) : beg(s.data()), end(s.data() + s.length()) { } - - size_t length() const { return end - beg; } - void to_str(std::string& out) const { out.assign(beg, end); } -}; - -inline bool StrRangeEq(const StrRange& lhs, const char* rhsSz) -{ - const size_t rhsLen = strlen(rhsSz); - return rhsLen == lhs.length() && - memcmp(lhs.beg, rhsSz, rhsLen) == 0; -} - -inline bool StrRangeToUint(const StrRange& s, uint32_t& out) -{ - char* end = (char*)s.end; - out = (uint32_t)strtoul(s.beg, &end, 10); - return end == s.end; -} -inline bool StrRangeToUint(const StrRange& s, uint64_t& out) -{ - char* end = (char*)s.end; - out = (uint64_t)strtoull(s.beg, &end, 10); - return end == s.end; -} -inline bool StrRangeToPtr(const StrRange& s, uint64_t& out) -{ - char* end = (char*)s.end; - out = (uint64_t)strtoull(s.beg, &end, 16); - return end == s.end; -} -inline bool StrRangeToFloat(const StrRange& s, float& out) -{ - char* end = (char*)s.end; - out = strtof(s.beg, &end); - return end == s.end; -} -inline bool StrRangeToBool(const StrRange& s, bool& out) -{ - if(s.end - s.beg == 1) - { - if(*s.beg == '1') - { - out = true; - } - else if(*s.beg == '0') - { - out = false; - } - else - { - return false; - } - } - else - { - return false; - } - - return true; -} -bool StrRangeToPtrList(const StrRange& s, std::vector<uint64_t>& out); - -class LineSplit -{ -public: - LineSplit(const char* data, size_t numBytes) : - m_Data(data), - m_NumBytes(numBytes), - m_NextLineBeg(0), - m_NextLineIndex(0) - { - } - - bool GetNextLine(StrRange& out); - size_t GetNextLineIndex() const { return m_NextLineIndex; } - -private: - const char* const m_Data; - const size_t m_NumBytes; - size_t m_NextLineBeg; - size_t m_NextLineIndex; -}; - -class CsvSplit -{ -public: - static const size_t RANGE_COUNT_MAX = 32; - - void Set(const StrRange& line, size_t maxCount = RANGE_COUNT_MAX); - - const StrRange& GetLine() const { return m_Line; } - - size_t GetCount() const { return m_Count; } - StrRange GetRange(size_t index) const - { - if(index < m_Count) - { - return StrRange { - m_Line.beg + m_Ranges[index * 2], - m_Line.beg + m_Ranges[index * 2 + 1] }; - } - else - { - return StrRange{0, 0}; - } - } - -private: - StrRange m_Line = { nullptr, nullptr }; - size_t m_Count = 0; - size_t m_Ranges[RANGE_COUNT_MAX * 2]; // Pairs of begin-end. -}; - -class CmdLineParser -{ -public: - enum RESULT - { - RESULT_OPT, - RESULT_PARAMETER, - RESULT_END, - RESULT_ERROR, - }; - - CmdLineParser(int argc, char **argv); - CmdLineParser(const char *CmdLine); - - void RegisterOpt(uint32_t Id, char Opt, bool Parameter); - void RegisterOpt(uint32_t Id, const std::string &Opt, bool Parameter); - - RESULT ReadNext(); - uint32_t GetOptId(); - const std::string & GetParameter(); - -private: - struct SHORT_OPT - { - uint32_t Id; - char Opt; - bool Parameter; - - SHORT_OPT(uint32_t Id, char Opt, bool Parameter) : Id(Id), Opt(Opt), Parameter(Parameter) { } - }; - - struct LONG_OPT - { - uint32_t Id; - std::string Opt; - bool Parameter; - - LONG_OPT(uint32_t Id, std::string Opt, bool Parameter) : Id(Id), Opt(Opt), Parameter(Parameter) { } - }; - - char **m_argv; - const char *m_CmdLine; - int m_argc; - size_t m_CmdLineLength; - size_t m_ArgIndex; - - bool ReadNextArg(std::string *OutArg); - - std::vector<SHORT_OPT> m_ShortOpts; - std::vector<LONG_OPT> m_LongOpts; - - SHORT_OPT * FindShortOpt(char Opt); - LONG_OPT * FindLongOpt(const std::string &Opt); - - bool m_InsideMultioption; - std::string m_LastArg; - size_t m_LastArgIndex; - uint32_t m_LastOptId; - std::string m_LastParameter; -}; - -/* -Parses and stores a sequence of ranges. - -Upper range is inclusive. - -Examples: - - "1" -> [ {1, 1} ] - "1,10" -> [ {1, 1}, {10, 10} ] - "2-6" -> [ {2, 6} ] - "-8" -> [ {MIN, 8} ] - "12-" -> [ {12, MAX} ] - "1-10,12,15-" -> [ {1, 10}, {12, 12}, {15, MAX} ] - -TODO: Optimize it: Do sorting and merging while parsing. Do binary search while -reading. -*/ -template<typename T> -class RangeSequence -{ -public: - typedef std::pair<T, T> RangeType; - - void Clear() { m_Ranges.clear(); } - bool Parse(const StrRange& str); - - bool IsEmpty() const { return m_Ranges.empty(); } - size_t GetCount() const { return m_Ranges.size(); } - const RangeType* GetRanges() const { return m_Ranges.data(); } - - bool Includes(T number) const; - -private: - std::vector<RangeType> m_Ranges; -}; - -template<typename T> -bool RangeSequence<T>::Parse(const StrRange& str) -{ - m_Ranges.clear(); - - StrRange currRange = { str.beg, str.beg }; - while(currRange.beg < str.end) - { - currRange.end = currRange.beg + 1; - // Find next ',' or the end. - while(currRange.end < str.end && *currRange.end != ',') - { - ++currRange.end; - } - - // Find '-' within this range. - const char* hyphenPos = currRange.beg; - while(hyphenPos < currRange.end && *hyphenPos != '-') - { - ++hyphenPos; - } - - // No hyphen - single number like '10'. - if(hyphenPos == currRange.end) - { - RangeType range; - if(!StrRangeToUint(currRange, range.first)) - { - return false; - } - range.second = range.first; - m_Ranges.push_back(range); - } - // Hyphen at the end, like '10-'. - else if(hyphenPos + 1 == currRange.end) - { - const StrRange numberRange = { currRange.beg, hyphenPos }; - RangeType range; - if(!StrRangeToUint(numberRange, range.first)) - { - return false; - } - range.second = std::numeric_limits<T>::max(); - m_Ranges.push_back(range); - } - // Hyphen at the beginning, like "-10". - else if(hyphenPos == currRange.beg) - { - const StrRange numberRange = { currRange.beg + 1, currRange.end }; - RangeType range; - range.first = std::numeric_limits<T>::min(); - if(!StrRangeToUint(numberRange, range.second)) - { - return false; - } - m_Ranges.push_back(range); - } - // Hyphen in the middle, like "1-10". - else - { - const StrRange numberRange1 = { currRange.beg, hyphenPos }; - const StrRange numberRange2 = { hyphenPos + 1, currRange.end }; - RangeType range; - if(!StrRangeToUint(numberRange1, range.first) || - !StrRangeToUint(numberRange2, range.second) || - range.second < range.first) - { - return false; - } - m_Ranges.push_back(range); - } - - // Skip ',' - currRange.beg = currRange.end + 1; - } - - return true; -} - -template<typename T> -bool RangeSequence<T>::Includes(T number) const -{ - for(const auto& it : m_Ranges) - { - if(number >= it.first && number <= it.second) - { - return true; - } - } - return false; -} - -/* -class RandomNumberGenerator -{ -public: - RandomNumberGenerator() : m_Value{GetTickCount()} {} - RandomNumberGenerator(uint32_t seed) : m_Value{seed} { } - void Seed(uint32_t seed) { m_Value = seed; } - uint32_t Generate() { return GenerateFast() ^ (GenerateFast() >> 7); } - -private: - uint32_t m_Value; - uint32_t GenerateFast() { return m_Value = (m_Value * 196314165 + 907633515); } -}; - -enum class CONSOLE_COLOR -{ - INFO, - NORMAL, - WARNING, - ERROR_, - COUNT -}; - -void SetConsoleColor(CONSOLE_COLOR color); - -void PrintMessage(CONSOLE_COLOR color, const char* msg); -void PrintMessage(CONSOLE_COLOR color, const wchar_t* msg); - -inline void Print(const char* msg) { PrintMessage(CONSOLE_COLOR::NORMAL, msg); } -inline void Print(const wchar_t* msg) { PrintMessage(CONSOLE_COLOR::NORMAL, msg); } -inline void PrintWarning(const char* msg) { PrintMessage(CONSOLE_COLOR::WARNING, msg); } -inline void PrintWarning(const wchar_t* msg) { PrintMessage(CONSOLE_COLOR::WARNING, msg); } -inline void PrintError(const char* msg) { PrintMessage(CONSOLE_COLOR::ERROR_, msg); } -inline void PrintError(const wchar_t* msg) { PrintMessage(CONSOLE_COLOR::ERROR_, msg); } - -void PrintMessageV(CONSOLE_COLOR color, const char* format, va_list argList); -void PrintMessageV(CONSOLE_COLOR color, const wchar_t* format, va_list argList); -void PrintMessageF(CONSOLE_COLOR color, const char* format, ...); -void PrintMessageF(CONSOLE_COLOR color, const wchar_t* format, ...); -void PrintWarningF(const char* format, ...); -void PrintWarningF(const wchar_t* format, ...); -void PrintErrorF(const char* format, ...); -void PrintErrorF(const wchar_t* format, ...); -*/ diff --git a/src/VmaReplay/Constants.cpp b/src/VmaReplay/Constants.cpp deleted file mode 100644 index 150b346..0000000 --- a/src/VmaReplay/Constants.cpp +++ /dev/null @@ -1,795 +0,0 @@ -// -// Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "Common.h" -#include "Constants.h" - -const int RESULT_EXCEPTION = -1000; -const int RESULT_ERROR_COMMAND_LINE = -1; -const int RESULT_ERROR_SOURCE_FILE = -2; -const int RESULT_ERROR_FORMAT = -3; -const int RESULT_ERROR_VULKAN = -4; - -const char* VMA_FUNCTION_NAMES[] = { - "vmaCreatePool", - "vmaDestroyPool", - "vmaSetAllocationUserData", - "vmaCreateBuffer", - "vmaDestroyBuffer", - "vmaCreateImage", - "vmaDestroyImage", - "vmaFreeMemory", - "vmaFreeMemoryPages", - "vmaCreateLostAllocation", - "vmaAllocateMemory", - "vmaAllocateMemoryPages", - "vmaAllocateMemoryForBuffer", - "vmaAllocateMemoryForImage", - "vmaMapMemory", - "vmaUnmapMemory", - "vmaFlushAllocation", - "vmaInvalidateAllocation", - "vmaTouchAllocation", - "vmaGetAllocationInfo", - "vmaMakePoolAllocationsLost", - "vmaResizeAllocation", - "vmaDefragmentationBegin", - "vmaDefragmentationEnd", - "vmaSetPoolName", -}; -static_assert( - _countof(VMA_FUNCTION_NAMES) == (size_t)VMA_FUNCTION::Count, - "VMA_FUNCTION_NAMES array doesn't match VMA_FUNCTION enum."); - -const char* VMA_POOL_CREATE_FLAG_NAMES[] = { - "VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT", - "VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT", - "VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT", -}; -const uint32_t VMA_POOL_CREATE_FLAG_VALUES[] = { - VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT, - VMA_POOL_CREATE_LINEAR_ALGORITHM_BIT, - VMA_POOL_CREATE_BUDDY_ALGORITHM_BIT, -}; -const size_t VMA_POOL_CREATE_FLAG_COUNT = _countof(VMA_POOL_CREATE_FLAG_NAMES); -static_assert( - _countof(VMA_POOL_CREATE_FLAG_NAMES) == _countof(VMA_POOL_CREATE_FLAG_VALUES), - "VMA_POOL_CREATE_FLAG_NAMES array doesn't match VMA_POOL_CREATE_FLAG_VALUES."); - -const char* VK_BUFFER_CREATE_FLAG_NAMES[] = { - "VK_BUFFER_CREATE_SPARSE_BINDING_BIT", - "VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT", - "VK_BUFFER_CREATE_SPARSE_ALIASED_BIT", - "VK_BUFFER_CREATE_PROTECTED_BIT", -}; -const uint32_t VK_BUFFER_CREATE_FLAG_VALUES[] = { - VK_BUFFER_CREATE_SPARSE_BINDING_BIT, - VK_BUFFER_CREATE_SPARSE_RESIDENCY_BIT, - VK_BUFFER_CREATE_SPARSE_ALIASED_BIT, - VK_BUFFER_CREATE_PROTECTED_BIT, -}; -const size_t VK_BUFFER_CREATE_FLAG_COUNT = _countof(VK_BUFFER_CREATE_FLAG_NAMES); -static_assert( - _countof(VK_BUFFER_CREATE_FLAG_NAMES) == _countof(VK_BUFFER_CREATE_FLAG_VALUES), - "VK_BUFFER_CREATE_FLAG_NAMES array doesn't match VK_BUFFER_CREATE_FLAG_VALUES."); - -const char* VK_BUFFER_USAGE_FLAG_NAMES[] = { - "VK_BUFFER_USAGE_TRANSFER_SRC_BIT", - "VK_BUFFER_USAGE_TRANSFER_DST_BIT", - "VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT", - "VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT", - "VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT", - "VK_BUFFER_USAGE_STORAGE_BUFFER_BIT", - "VK_BUFFER_USAGE_INDEX_BUFFER_BIT", - "VK_BUFFER_USAGE_VERTEX_BUFFER_BIT", - "VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT", - "VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT", - //"VK_BUFFER_USAGE_RAYTRACING_BIT_NVX", -}; -const uint32_t VK_BUFFER_USAGE_FLAG_VALUES[] = { - VK_BUFFER_USAGE_TRANSFER_SRC_BIT, - VK_BUFFER_USAGE_TRANSFER_DST_BIT, - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT, - VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT, - VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, - VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, - VK_BUFFER_USAGE_INDEX_BUFFER_BIT, - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT, - VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT, - VK_BUFFER_USAGE_CONDITIONAL_RENDERING_BIT_EXT, - //VK_BUFFER_USAGE_RAYTRACING_BIT_NVX, -}; -const size_t VK_BUFFER_USAGE_FLAG_COUNT = _countof(VK_BUFFER_USAGE_FLAG_NAMES); -static_assert( - _countof(VK_BUFFER_USAGE_FLAG_NAMES) == _countof(VK_BUFFER_USAGE_FLAG_VALUES), - "VK_BUFFER_USAGE_FLAG_NAMES array doesn't match VK_BUFFER_USAGE_FLAG_VALUES."); - -const char* VK_SHARING_MODE_NAMES[] = { - "VK_SHARING_MODE_EXCLUSIVE", - "VK_SHARING_MODE_CONCURRENT", -}; -const size_t VK_SHARING_MODE_COUNT = _countof(VK_SHARING_MODE_NAMES); - -const char* VK_IMAGE_CREATE_FLAG_NAMES[] = { - "VK_IMAGE_CREATE_SPARSE_BINDING_BIT", - "VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT", - "VK_IMAGE_CREATE_SPARSE_ALIASED_BIT", - "VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT", - "VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT", - "VK_IMAGE_CREATE_ALIAS_BIT", - "VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT", - "VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT", - "VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT", - "VK_IMAGE_CREATE_EXTENDED_USAGE_BIT", - "VK_IMAGE_CREATE_PROTECTED_BIT", - "VK_IMAGE_CREATE_DISJOINT_BIT", - //"VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV", - "VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT", -}; -const uint32_t VK_IMAGE_CREATE_FLAG_VALUES[] = { - VK_IMAGE_CREATE_SPARSE_BINDING_BIT, - VK_IMAGE_CREATE_SPARSE_RESIDENCY_BIT, - VK_IMAGE_CREATE_SPARSE_ALIASED_BIT, - VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT, - VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT, - VK_IMAGE_CREATE_ALIAS_BIT, - VK_IMAGE_CREATE_SPLIT_INSTANCE_BIND_REGIONS_BIT, - VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT, - VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT, - VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, - VK_IMAGE_CREATE_PROTECTED_BIT, - VK_IMAGE_CREATE_DISJOINT_BIT, - //VK_IMAGE_CREATE_CORNER_SAMPLED_BIT_NV, - VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, -}; -const size_t VK_IMAGE_CREATE_FLAG_COUNT = _countof(VK_IMAGE_CREATE_FLAG_NAMES); -static_assert( - _countof(VK_IMAGE_CREATE_FLAG_NAMES) == _countof(VK_IMAGE_CREATE_FLAG_VALUES), - "VK_IMAGE_CREATE_FLAG_NAMES array doesn't match VK_IMAGE_CREATE_FLAG_VALUES."); - -const char* VK_IMAGE_TYPE_NAMES[] = { - "VK_IMAGE_TYPE_1D", - "VK_IMAGE_TYPE_2D", - "VK_IMAGE_TYPE_3D", -}; -const size_t VK_IMAGE_TYPE_COUNT = _countof(VK_IMAGE_TYPE_NAMES); - -const char* VK_FORMAT_NAMES[] = { - "VK_FORMAT_UNDEFINED", - "VK_FORMAT_R4G4_UNORM_PACK8", - "VK_FORMAT_R4G4B4A4_UNORM_PACK16", - "VK_FORMAT_B4G4R4A4_UNORM_PACK16", - "VK_FORMAT_R5G6B5_UNORM_PACK16", - "VK_FORMAT_B5G6R5_UNORM_PACK16", - "VK_FORMAT_R5G5B5A1_UNORM_PACK16", - "VK_FORMAT_B5G5R5A1_UNORM_PACK16", - "VK_FORMAT_A1R5G5B5_UNORM_PACK16", - "VK_FORMAT_R8_UNORM", - "VK_FORMAT_R8_SNORM", - "VK_FORMAT_R8_USCALED", - "VK_FORMAT_R8_SSCALED", - "VK_FORMAT_R8_UINT", - "VK_FORMAT_R8_SINT", - "VK_FORMAT_R8_SRGB", - "VK_FORMAT_R8G8_UNORM", - "VK_FORMAT_R8G8_SNORM", - "VK_FORMAT_R8G8_USCALED", - "VK_FORMAT_R8G8_SSCALED", - "VK_FORMAT_R8G8_UINT", - "VK_FORMAT_R8G8_SINT", - "VK_FORMAT_R8G8_SRGB", - "VK_FORMAT_R8G8B8_UNORM", - "VK_FORMAT_R8G8B8_SNORM", - "VK_FORMAT_R8G8B8_USCALED", - "VK_FORMAT_R8G8B8_SSCALED", - "VK_FORMAT_R8G8B8_UINT", - "VK_FORMAT_R8G8B8_SINT", - "VK_FORMAT_R8G8B8_SRGB", - "VK_FORMAT_B8G8R8_UNORM", - "VK_FORMAT_B8G8R8_SNORM", - "VK_FORMAT_B8G8R8_USCALED", - "VK_FORMAT_B8G8R8_SSCALED", - "VK_FORMAT_B8G8R8_UINT", - "VK_FORMAT_B8G8R8_SINT", - "VK_FORMAT_B8G8R8_SRGB", - "VK_FORMAT_R8G8B8A8_UNORM", - "VK_FORMAT_R8G8B8A8_SNORM", - "VK_FORMAT_R8G8B8A8_USCALED", - "VK_FORMAT_R8G8B8A8_SSCALED", - "VK_FORMAT_R8G8B8A8_UINT", - "VK_FORMAT_R8G8B8A8_SINT", - "VK_FORMAT_R8G8B8A8_SRGB", - "VK_FORMAT_B8G8R8A8_UNORM", - "VK_FORMAT_B8G8R8A8_SNORM", - "VK_FORMAT_B8G8R8A8_USCALED", - "VK_FORMAT_B8G8R8A8_SSCALED", - "VK_FORMAT_B8G8R8A8_UINT", - "VK_FORMAT_B8G8R8A8_SINT", - "VK_FORMAT_B8G8R8A8_SRGB", - "VK_FORMAT_A8B8G8R8_UNORM_PACK32", - "VK_FORMAT_A8B8G8R8_SNORM_PACK32", - "VK_FORMAT_A8B8G8R8_USCALED_PACK32", - "VK_FORMAT_A8B8G8R8_SSCALED_PACK32", - "VK_FORMAT_A8B8G8R8_UINT_PACK32", - "VK_FORMAT_A8B8G8R8_SINT_PACK32", - "VK_FORMAT_A8B8G8R8_SRGB_PACK32", - "VK_FORMAT_A2R10G10B10_UNORM_PACK32", - "VK_FORMAT_A2R10G10B10_SNORM_PACK32", - "VK_FORMAT_A2R10G10B10_USCALED_PACK32", - "VK_FORMAT_A2R10G10B10_SSCALED_PACK32", - "VK_FORMAT_A2R10G10B10_UINT_PACK32", - "VK_FORMAT_A2R10G10B10_SINT_PACK32", - "VK_FORMAT_A2B10G10R10_UNORM_PACK32", - "VK_FORMAT_A2B10G10R10_SNORM_PACK32", - "VK_FORMAT_A2B10G10R10_USCALED_PACK32", - "VK_FORMAT_A2B10G10R10_SSCALED_PACK32", - "VK_FORMAT_A2B10G10R10_UINT_PACK32", - "VK_FORMAT_A2B10G10R10_SINT_PACK32", - "VK_FORMAT_R16_UNORM", - "VK_FORMAT_R16_SNORM", - "VK_FORMAT_R16_USCALED", - "VK_FORMAT_R16_SSCALED", - "VK_FORMAT_R16_UINT", - "VK_FORMAT_R16_SINT", - "VK_FORMAT_R16_SFLOAT", - "VK_FORMAT_R16G16_UNORM", - "VK_FORMAT_R16G16_SNORM", - "VK_FORMAT_R16G16_USCALED", - "VK_FORMAT_R16G16_SSCALED", - "VK_FORMAT_R16G16_UINT", - "VK_FORMAT_R16G16_SINT", - "VK_FORMAT_R16G16_SFLOAT", - "VK_FORMAT_R16G16B16_UNORM", - "VK_FORMAT_R16G16B16_SNORM", - "VK_FORMAT_R16G16B16_USCALED", - "VK_FORMAT_R16G16B16_SSCALED", - "VK_FORMAT_R16G16B16_UINT", - "VK_FORMAT_R16G16B16_SINT", - "VK_FORMAT_R16G16B16_SFLOAT", - "VK_FORMAT_R16G16B16A16_UNORM", - "VK_FORMAT_R16G16B16A16_SNORM", - "VK_FORMAT_R16G16B16A16_USCALED", - "VK_FORMAT_R16G16B16A16_SSCALED", - "VK_FORMAT_R16G16B16A16_UINT", - "VK_FORMAT_R16G16B16A16_SINT", - "VK_FORMAT_R16G16B16A16_SFLOAT", - "VK_FORMAT_R32_UINT", - "VK_FORMAT_R32_SINT", - "VK_FORMAT_R32_SFLOAT", - "VK_FORMAT_R32G32_UINT", - "VK_FORMAT_R32G32_SINT", - "VK_FORMAT_R32G32_SFLOAT", - "VK_FORMAT_R32G32B32_UINT", - "VK_FORMAT_R32G32B32_SINT", - "VK_FORMAT_R32G32B32_SFLOAT", - "VK_FORMAT_R32G32B32A32_UINT", - "VK_FORMAT_R32G32B32A32_SINT", - "VK_FORMAT_R32G32B32A32_SFLOAT", - "VK_FORMAT_R64_UINT", - "VK_FORMAT_R64_SINT", - "VK_FORMAT_R64_SFLOAT", - "VK_FORMAT_R64G64_UINT", - "VK_FORMAT_R64G64_SINT", - "VK_FORMAT_R64G64_SFLOAT", - "VK_FORMAT_R64G64B64_UINT", - "VK_FORMAT_R64G64B64_SINT", - "VK_FORMAT_R64G64B64_SFLOAT", - "VK_FORMAT_R64G64B64A64_UINT", - "VK_FORMAT_R64G64B64A64_SINT", - "VK_FORMAT_R64G64B64A64_SFLOAT", - "VK_FORMAT_B10G11R11_UFLOAT_PACK32", - "VK_FORMAT_E5B9G9R9_UFLOAT_PACK32", - "VK_FORMAT_D16_UNORM", - "VK_FORMAT_X8_D24_UNORM_PACK32", - "VK_FORMAT_D32_SFLOAT", - "VK_FORMAT_S8_UINT", - "VK_FORMAT_D16_UNORM_S8_UINT", - "VK_FORMAT_D24_UNORM_S8_UINT", - "VK_FORMAT_D32_SFLOAT_S8_UINT", - "VK_FORMAT_BC1_RGB_UNORM_BLOCK", - "VK_FORMAT_BC1_RGB_SRGB_BLOCK", - "VK_FORMAT_BC1_RGBA_UNORM_BLOCK", - "VK_FORMAT_BC1_RGBA_SRGB_BLOCK", - "VK_FORMAT_BC2_UNORM_BLOCK", - "VK_FORMAT_BC2_SRGB_BLOCK", - "VK_FORMAT_BC3_UNORM_BLOCK", - "VK_FORMAT_BC3_SRGB_BLOCK", - "VK_FORMAT_BC4_UNORM_BLOCK", - "VK_FORMAT_BC4_SNORM_BLOCK", - "VK_FORMAT_BC5_UNORM_BLOCK", - "VK_FORMAT_BC5_SNORM_BLOCK", - "VK_FORMAT_BC6H_UFLOAT_BLOCK", - "VK_FORMAT_BC6H_SFLOAT_BLOCK", - "VK_FORMAT_BC7_UNORM_BLOCK", - "VK_FORMAT_BC7_SRGB_BLOCK", - "VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK", - "VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK", - "VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK", - "VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK", - "VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK", - "VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK", - "VK_FORMAT_EAC_R11_UNORM_BLOCK", - "VK_FORMAT_EAC_R11_SNORM_BLOCK", - "VK_FORMAT_EAC_R11G11_UNORM_BLOCK", - "VK_FORMAT_EAC_R11G11_SNORM_BLOCK", - "VK_FORMAT_ASTC_4x4_UNORM_BLOCK", - "VK_FORMAT_ASTC_4x4_SRGB_BLOCK", - "VK_FORMAT_ASTC_5x4_UNORM_BLOCK", - "VK_FORMAT_ASTC_5x4_SRGB_BLOCK", - "VK_FORMAT_ASTC_5x5_UNORM_BLOCK", - "VK_FORMAT_ASTC_5x5_SRGB_BLOCK", - "VK_FORMAT_ASTC_6x5_UNORM_BLOCK", - "VK_FORMAT_ASTC_6x5_SRGB_BLOCK", - "VK_FORMAT_ASTC_6x6_UNORM_BLOCK", - "VK_FORMAT_ASTC_6x6_SRGB_BLOCK", - "VK_FORMAT_ASTC_8x5_UNORM_BLOCK", - "VK_FORMAT_ASTC_8x5_SRGB_BLOCK", - "VK_FORMAT_ASTC_8x6_UNORM_BLOCK", - "VK_FORMAT_ASTC_8x6_SRGB_BLOCK", - "VK_FORMAT_ASTC_8x8_UNORM_BLOCK", - "VK_FORMAT_ASTC_8x8_SRGB_BLOCK", - "VK_FORMAT_ASTC_10x5_UNORM_BLOCK", - "VK_FORMAT_ASTC_10x5_SRGB_BLOCK", - "VK_FORMAT_ASTC_10x6_UNORM_BLOCK", - "VK_FORMAT_ASTC_10x6_SRGB_BLOCK", - "VK_FORMAT_ASTC_10x8_UNORM_BLOCK", - "VK_FORMAT_ASTC_10x8_SRGB_BLOCK", - "VK_FORMAT_ASTC_10x10_UNORM_BLOCK", - "VK_FORMAT_ASTC_10x10_SRGB_BLOCK", - "VK_FORMAT_ASTC_12x10_UNORM_BLOCK", - "VK_FORMAT_ASTC_12x10_SRGB_BLOCK", - "VK_FORMAT_ASTC_12x12_UNORM_BLOCK", - "VK_FORMAT_ASTC_12x12_SRGB_BLOCK", - "VK_FORMAT_G8B8G8R8_422_UNORM", - "VK_FORMAT_B8G8R8G8_422_UNORM", - "VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM", - "VK_FORMAT_G8_B8R8_2PLANE_420_UNORM", - "VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM", - "VK_FORMAT_G8_B8R8_2PLANE_422_UNORM", - "VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM", - "VK_FORMAT_R10X6_UNORM_PACK16", - "VK_FORMAT_R10X6G10X6_UNORM_2PACK16", - "VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16", - "VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16", - "VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16", - "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16", - "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16", - "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16", - "VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16", - "VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16", - "VK_FORMAT_R12X4_UNORM_PACK16", - "VK_FORMAT_R12X4G12X4_UNORM_2PACK16", - "VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16", - "VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16", - "VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16", - "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16", - "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16", - "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16", - "VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16", - "VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16", - "VK_FORMAT_G16B16G16R16_422_UNORM", - "VK_FORMAT_B16G16R16G16_422_UNORM", - "VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM", - "VK_FORMAT_G16_B16R16_2PLANE_420_UNORM", - "VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM", - "VK_FORMAT_G16_B16R16_2PLANE_422_UNORM", - "VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM", - "VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG", - "VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG", - "VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG", - "VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG", - "VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG", - "VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG", - "VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG", - "VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG", -}; -const uint32_t VK_FORMAT_VALUES[] = { - VK_FORMAT_UNDEFINED, - VK_FORMAT_R4G4_UNORM_PACK8, - VK_FORMAT_R4G4B4A4_UNORM_PACK16, - VK_FORMAT_B4G4R4A4_UNORM_PACK16, - VK_FORMAT_R5G6B5_UNORM_PACK16, - VK_FORMAT_B5G6R5_UNORM_PACK16, - VK_FORMAT_R5G5B5A1_UNORM_PACK16, - VK_FORMAT_B5G5R5A1_UNORM_PACK16, - VK_FORMAT_A1R5G5B5_UNORM_PACK16, - VK_FORMAT_R8_UNORM, - VK_FORMAT_R8_SNORM, - VK_FORMAT_R8_USCALED, - VK_FORMAT_R8_SSCALED, - VK_FORMAT_R8_UINT, - VK_FORMAT_R8_SINT, - VK_FORMAT_R8_SRGB, - VK_FORMAT_R8G8_UNORM, - VK_FORMAT_R8G8_SNORM, - VK_FORMAT_R8G8_USCALED, - VK_FORMAT_R8G8_SSCALED, - VK_FORMAT_R8G8_UINT, - VK_FORMAT_R8G8_SINT, - VK_FORMAT_R8G8_SRGB, - VK_FORMAT_R8G8B8_UNORM, - VK_FORMAT_R8G8B8_SNORM, - VK_FORMAT_R8G8B8_USCALED, - VK_FORMAT_R8G8B8_SSCALED, - VK_FORMAT_R8G8B8_UINT, - VK_FORMAT_R8G8B8_SINT, - VK_FORMAT_R8G8B8_SRGB, - VK_FORMAT_B8G8R8_UNORM, - VK_FORMAT_B8G8R8_SNORM, - VK_FORMAT_B8G8R8_USCALED, - VK_FORMAT_B8G8R8_SSCALED, - VK_FORMAT_B8G8R8_UINT, - VK_FORMAT_B8G8R8_SINT, - VK_FORMAT_B8G8R8_SRGB, - VK_FORMAT_R8G8B8A8_UNORM, - VK_FORMAT_R8G8B8A8_SNORM, - VK_FORMAT_R8G8B8A8_USCALED, - VK_FORMAT_R8G8B8A8_SSCALED, - VK_FORMAT_R8G8B8A8_UINT, - VK_FORMAT_R8G8B8A8_SINT, - VK_FORMAT_R8G8B8A8_SRGB, - VK_FORMAT_B8G8R8A8_UNORM, - VK_FORMAT_B8G8R8A8_SNORM, - VK_FORMAT_B8G8R8A8_USCALED, - VK_FORMAT_B8G8R8A8_SSCALED, - VK_FORMAT_B8G8R8A8_UINT, - VK_FORMAT_B8G8R8A8_SINT, - VK_FORMAT_B8G8R8A8_SRGB, - VK_FORMAT_A8B8G8R8_UNORM_PACK32, - VK_FORMAT_A8B8G8R8_SNORM_PACK32, - VK_FORMAT_A8B8G8R8_USCALED_PACK32, - VK_FORMAT_A8B8G8R8_SSCALED_PACK32, - VK_FORMAT_A8B8G8R8_UINT_PACK32, - VK_FORMAT_A8B8G8R8_SINT_PACK32, - VK_FORMAT_A8B8G8R8_SRGB_PACK32, - VK_FORMAT_A2R10G10B10_UNORM_PACK32, - VK_FORMAT_A2R10G10B10_SNORM_PACK32, - VK_FORMAT_A2R10G10B10_USCALED_PACK32, - VK_FORMAT_A2R10G10B10_SSCALED_PACK32, - VK_FORMAT_A2R10G10B10_UINT_PACK32, - VK_FORMAT_A2R10G10B10_SINT_PACK32, - VK_FORMAT_A2B10G10R10_UNORM_PACK32, - VK_FORMAT_A2B10G10R10_SNORM_PACK32, - VK_FORMAT_A2B10G10R10_USCALED_PACK32, - VK_FORMAT_A2B10G10R10_SSCALED_PACK32, - VK_FORMAT_A2B10G10R10_UINT_PACK32, - VK_FORMAT_A2B10G10R10_SINT_PACK32, - VK_FORMAT_R16_UNORM, - VK_FORMAT_R16_SNORM, - VK_FORMAT_R16_USCALED, - VK_FORMAT_R16_SSCALED, - VK_FORMAT_R16_UINT, - VK_FORMAT_R16_SINT, - VK_FORMAT_R16_SFLOAT, - VK_FORMAT_R16G16_UNORM, - VK_FORMAT_R16G16_SNORM, - VK_FORMAT_R16G16_USCALED, - VK_FORMAT_R16G16_SSCALED, - VK_FORMAT_R16G16_UINT, - VK_FORMAT_R16G16_SINT, - VK_FORMAT_R16G16_SFLOAT, - VK_FORMAT_R16G16B16_UNORM, - VK_FORMAT_R16G16B16_SNORM, - VK_FORMAT_R16G16B16_USCALED, - VK_FORMAT_R16G16B16_SSCALED, - VK_FORMAT_R16G16B16_UINT, - VK_FORMAT_R16G16B16_SINT, - VK_FORMAT_R16G16B16_SFLOAT, - VK_FORMAT_R16G16B16A16_UNORM, - VK_FORMAT_R16G16B16A16_SNORM, - VK_FORMAT_R16G16B16A16_USCALED, - VK_FORMAT_R16G16B16A16_SSCALED, - VK_FORMAT_R16G16B16A16_UINT, - VK_FORMAT_R16G16B16A16_SINT, - VK_FORMAT_R16G16B16A16_SFLOAT, - VK_FORMAT_R32_UINT, - VK_FORMAT_R32_SINT, - VK_FORMAT_R32_SFLOAT, - VK_FORMAT_R32G32_UINT, - VK_FORMAT_R32G32_SINT, - VK_FORMAT_R32G32_SFLOAT, - VK_FORMAT_R32G32B32_UINT, - VK_FORMAT_R32G32B32_SINT, - VK_FORMAT_R32G32B32_SFLOAT, - VK_FORMAT_R32G32B32A32_UINT, - VK_FORMAT_R32G32B32A32_SINT, - VK_FORMAT_R32G32B32A32_SFLOAT, - VK_FORMAT_R64_UINT, - VK_FORMAT_R64_SINT, - VK_FORMAT_R64_SFLOAT, - VK_FORMAT_R64G64_UINT, - VK_FORMAT_R64G64_SINT, - VK_FORMAT_R64G64_SFLOAT, - VK_FORMAT_R64G64B64_UINT, - VK_FORMAT_R64G64B64_SINT, - VK_FORMAT_R64G64B64_SFLOAT, - VK_FORMAT_R64G64B64A64_UINT, - VK_FORMAT_R64G64B64A64_SINT, - VK_FORMAT_R64G64B64A64_SFLOAT, - VK_FORMAT_B10G11R11_UFLOAT_PACK32, - VK_FORMAT_E5B9G9R9_UFLOAT_PACK32, - VK_FORMAT_D16_UNORM, - VK_FORMAT_X8_D24_UNORM_PACK32, - VK_FORMAT_D32_SFLOAT, - VK_FORMAT_S8_UINT, - VK_FORMAT_D16_UNORM_S8_UINT, - VK_FORMAT_D24_UNORM_S8_UINT, - VK_FORMAT_D32_SFLOAT_S8_UINT, - VK_FORMAT_BC1_RGB_UNORM_BLOCK, - VK_FORMAT_BC1_RGB_SRGB_BLOCK, - VK_FORMAT_BC1_RGBA_UNORM_BLOCK, - VK_FORMAT_BC1_RGBA_SRGB_BLOCK, - VK_FORMAT_BC2_UNORM_BLOCK, - VK_FORMAT_BC2_SRGB_BLOCK, - VK_FORMAT_BC3_UNORM_BLOCK, - VK_FORMAT_BC3_SRGB_BLOCK, - VK_FORMAT_BC4_UNORM_BLOCK, - VK_FORMAT_BC4_SNORM_BLOCK, - VK_FORMAT_BC5_UNORM_BLOCK, - VK_FORMAT_BC5_SNORM_BLOCK, - VK_FORMAT_BC6H_UFLOAT_BLOCK, - VK_FORMAT_BC6H_SFLOAT_BLOCK, - VK_FORMAT_BC7_UNORM_BLOCK, - VK_FORMAT_BC7_SRGB_BLOCK, - VK_FORMAT_ETC2_R8G8B8_UNORM_BLOCK, - VK_FORMAT_ETC2_R8G8B8_SRGB_BLOCK, - VK_FORMAT_ETC2_R8G8B8A1_UNORM_BLOCK, - VK_FORMAT_ETC2_R8G8B8A1_SRGB_BLOCK, - VK_FORMAT_ETC2_R8G8B8A8_UNORM_BLOCK, - VK_FORMAT_ETC2_R8G8B8A8_SRGB_BLOCK, - VK_FORMAT_EAC_R11_UNORM_BLOCK, - VK_FORMAT_EAC_R11_SNORM_BLOCK, - VK_FORMAT_EAC_R11G11_UNORM_BLOCK, - VK_FORMAT_EAC_R11G11_SNORM_BLOCK, - VK_FORMAT_ASTC_4x4_UNORM_BLOCK, - VK_FORMAT_ASTC_4x4_SRGB_BLOCK, - VK_FORMAT_ASTC_5x4_UNORM_BLOCK, - VK_FORMAT_ASTC_5x4_SRGB_BLOCK, - VK_FORMAT_ASTC_5x5_UNORM_BLOCK, - VK_FORMAT_ASTC_5x5_SRGB_BLOCK, - VK_FORMAT_ASTC_6x5_UNORM_BLOCK, - VK_FORMAT_ASTC_6x5_SRGB_BLOCK, - VK_FORMAT_ASTC_6x6_UNORM_BLOCK, - VK_FORMAT_ASTC_6x6_SRGB_BLOCK, - VK_FORMAT_ASTC_8x5_UNORM_BLOCK, - VK_FORMAT_ASTC_8x5_SRGB_BLOCK, - VK_FORMAT_ASTC_8x6_UNORM_BLOCK, - VK_FORMAT_ASTC_8x6_SRGB_BLOCK, - VK_FORMAT_ASTC_8x8_UNORM_BLOCK, - VK_FORMAT_ASTC_8x8_SRGB_BLOCK, - VK_FORMAT_ASTC_10x5_UNORM_BLOCK, - VK_FORMAT_ASTC_10x5_SRGB_BLOCK, - VK_FORMAT_ASTC_10x6_UNORM_BLOCK, - VK_FORMAT_ASTC_10x6_SRGB_BLOCK, - VK_FORMAT_ASTC_10x8_UNORM_BLOCK, - VK_FORMAT_ASTC_10x8_SRGB_BLOCK, - VK_FORMAT_ASTC_10x10_UNORM_BLOCK, - VK_FORMAT_ASTC_10x10_SRGB_BLOCK, - VK_FORMAT_ASTC_12x10_UNORM_BLOCK, - VK_FORMAT_ASTC_12x10_SRGB_BLOCK, - VK_FORMAT_ASTC_12x12_UNORM_BLOCK, - VK_FORMAT_ASTC_12x12_SRGB_BLOCK, - VK_FORMAT_G8B8G8R8_422_UNORM, - VK_FORMAT_B8G8R8G8_422_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM, - VK_FORMAT_G8_B8R8_2PLANE_420_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM, - VK_FORMAT_G8_B8R8_2PLANE_422_UNORM, - VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM, - VK_FORMAT_R10X6_UNORM_PACK16, - VK_FORMAT_R10X6G10X6_UNORM_2PACK16, - VK_FORMAT_R10X6G10X6B10X6A10X6_UNORM_4PACK16, - VK_FORMAT_G10X6B10X6G10X6R10X6_422_UNORM_4PACK16, - VK_FORMAT_B10X6G10X6R10X6G10X6_422_UNORM_4PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16, - VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16, - VK_FORMAT_R12X4_UNORM_PACK16, - VK_FORMAT_R12X4G12X4_UNORM_2PACK16, - VK_FORMAT_R12X4G12X4B12X4A12X4_UNORM_4PACK16, - VK_FORMAT_G12X4B12X4G12X4R12X4_422_UNORM_4PACK16, - VK_FORMAT_B12X4G12X4R12X4G12X4_422_UNORM_4PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16, - VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16, - VK_FORMAT_G16B16G16R16_422_UNORM, - VK_FORMAT_B16G16R16G16_422_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM, - VK_FORMAT_G16_B16R16_2PLANE_420_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM, - VK_FORMAT_G16_B16R16_2PLANE_422_UNORM, - VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM, - VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG, - VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG, - VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG, - VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG, - VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG, - VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG, - VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG, - VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG, -}; -const size_t VK_FORMAT_COUNT = _countof(VK_FORMAT_NAMES); -static_assert( - _countof(VK_FORMAT_NAMES) == _countof(VK_FORMAT_VALUES), - "VK_FORMAT_NAMES array doesn't match VK_FORMAT_VALUES."); - -const char* VK_SAMPLE_COUNT_NAMES[] = { - "VK_SAMPLE_COUNT_1_BIT", - "VK_SAMPLE_COUNT_2_BIT", - "VK_SAMPLE_COUNT_4_BIT", - "VK_SAMPLE_COUNT_8_BIT", - "VK_SAMPLE_COUNT_16_BIT", - "VK_SAMPLE_COUNT_32_BIT", - "VK_SAMPLE_COUNT_64_BIT", -}; -const uint32_t VK_SAMPLE_COUNT_VALUES[] = { - VK_SAMPLE_COUNT_1_BIT, - VK_SAMPLE_COUNT_2_BIT, - VK_SAMPLE_COUNT_4_BIT, - VK_SAMPLE_COUNT_8_BIT, - VK_SAMPLE_COUNT_16_BIT, - VK_SAMPLE_COUNT_32_BIT, - VK_SAMPLE_COUNT_64_BIT, -}; -const size_t VK_SAMPLE_COUNT_COUNT = _countof(VK_SAMPLE_COUNT_NAMES); -static_assert( - _countof(VK_SAMPLE_COUNT_NAMES) == _countof(VK_SAMPLE_COUNT_VALUES), - "VK_SAMPLE_COUNT_NAMES array doesn't match VK_SAMPLE_COUNT_VALUES."); - -const char* VK_IMAGE_TILING_NAMES[] = { - "VK_IMAGE_TILING_OPTIMAL", - "VK_IMAGE_TILING_LINEAR", -}; -const size_t VK_IMAGE_TILING_COUNT = _countof(VK_IMAGE_TILING_NAMES); - -const char* VK_IMAGE_USAGE_FLAG_NAMES[] = { - "VK_IMAGE_USAGE_TRANSFER_SRC_BIT", - "VK_IMAGE_USAGE_TRANSFER_DST_BIT", - "VK_IMAGE_USAGE_SAMPLED_BIT", - "VK_IMAGE_USAGE_STORAGE_BIT", - "VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT", - "VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT", - "VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT", - "VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT", - //"VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV", -}; -const uint32_t VK_IMAGE_USAGE_FLAG_VALUES[] = { - VK_IMAGE_USAGE_TRANSFER_SRC_BIT, - VK_IMAGE_USAGE_TRANSFER_DST_BIT, - VK_IMAGE_USAGE_SAMPLED_BIT, - VK_IMAGE_USAGE_STORAGE_BIT, - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT, - VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT, - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT, - VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT, - //VK_IMAGE_USAGE_SHADING_RATE_IMAGE_BIT_NV, -}; -const size_t VK_IMAGE_USAGE_FLAG_COUNT = _countof(VK_IMAGE_USAGE_FLAG_NAMES); -static_assert( - _countof(VK_IMAGE_USAGE_FLAG_NAMES) == _countof(VK_IMAGE_USAGE_FLAG_VALUES), - "VK_IMAGE_USAGE_FLAG_NAMES array doesn't match VK_IMAGE_USAGE_FLAG_VALUES."); - -const char* VK_IMAGE_LAYOUT_NAMES[] = { - "VK_IMAGE_LAYOUT_UNDEFINED", - "VK_IMAGE_LAYOUT_GENERAL", - "VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL", - "VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL", - "VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL", - "VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL", - "VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL", - "VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL", - "VK_IMAGE_LAYOUT_PREINITIALIZED", - "VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL", - "VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL", - "VK_IMAGE_LAYOUT_PRESENT_SRC_KHR", - "VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR", - //"VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV", -}; -const uint32_t VK_IMAGE_LAYOUT_VALUES[] = { - VK_IMAGE_LAYOUT_UNDEFINED, - VK_IMAGE_LAYOUT_GENERAL, - VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - VK_IMAGE_LAYOUT_PREINITIALIZED, - VK_IMAGE_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_OPTIMAL, - VK_IMAGE_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_OPTIMAL, - VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR, - //VK_IMAGE_LAYOUT_SHADING_RATE_OPTIMAL_NV, -}; -const size_t VK_IMAGE_LAYOUT_COUNT = _countof(VK_IMAGE_LAYOUT_NAMES); -static_assert( - _countof(VK_IMAGE_LAYOUT_NAMES) == _countof(VK_IMAGE_LAYOUT_VALUES), - "VK_IMAGE_LAYOUT_NAMES array doesn't match VK_IMAGE_LAYOUT_VALUES."); - -const char* VMA_ALLOCATION_CREATE_FLAG_NAMES[] = { - "VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT", - "VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT", - "VMA_ALLOCATION_CREATE_MAPPED_BIT", - "VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT", - "VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT", - "VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT", - "VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT", - "VMA_ALLOCATION_CREATE_DONT_BIND_BIT", - "VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT", - "VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT", - "VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT", - "VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT", -}; -const uint32_t VMA_ALLOCATION_CREATE_FLAG_VALUES[] = { - VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT, - VMA_ALLOCATION_CREATE_NEVER_ALLOCATE_BIT, - VMA_ALLOCATION_CREATE_MAPPED_BIT, - VMA_ALLOCATION_CREATE_CAN_BECOME_LOST_BIT, - VMA_ALLOCATION_CREATE_CAN_MAKE_OTHER_LOST_BIT, - VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT, - VMA_ALLOCATION_CREATE_UPPER_ADDRESS_BIT, - VMA_ALLOCATION_CREATE_DONT_BIND_BIT, - VMA_ALLOCATION_CREATE_WITHIN_BUDGET_BIT, - VMA_ALLOCATION_CREATE_STRATEGY_BEST_FIT_BIT, - VMA_ALLOCATION_CREATE_STRATEGY_WORST_FIT_BIT, - VMA_ALLOCATION_CREATE_STRATEGY_FIRST_FIT_BIT, -}; -const size_t VMA_ALLOCATION_CREATE_FLAG_COUNT = _countof(VMA_ALLOCATION_CREATE_FLAG_NAMES); -static_assert( - _countof(VMA_ALLOCATION_CREATE_FLAG_NAMES) == _countof(VMA_ALLOCATION_CREATE_FLAG_VALUES), - "VMA_ALLOCATION_CREATE_FLAG_NAMES array doesn't match VMA_ALLOCATION_CREATE_FLAG_VALUES."); - -const char* VMA_MEMORY_USAGE_NAMES[] = { - "VMA_MEMORY_USAGE_UNKNOWN", - "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", - "VMA_MEMORY_USAGE_GPU_LAZILY_ALLOCATED", -}; -const size_t VMA_MEMORY_USAGE_COUNT = _countof(VMA_MEMORY_USAGE_NAMES); - -const char* VK_MEMORY_PROPERTY_FLAG_NAMES[] = { - "VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT", - "VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT", - "VK_MEMORY_PROPERTY_HOST_COHERENT_BIT", - "VK_MEMORY_PROPERTY_HOST_CACHED_BIT", - "VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT", - "VK_MEMORY_PROPERTY_PROTECTED_BIT", -}; -const uint32_t VK_MEMORY_PROPERTY_FLAG_VALUES[] = { - VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, - VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT, - VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, - VK_MEMORY_PROPERTY_HOST_CACHED_BIT, - VK_MEMORY_PROPERTY_LAZILY_ALLOCATED_BIT, - VK_MEMORY_PROPERTY_PROTECTED_BIT, -}; -const size_t VK_MEMORY_PROPERTY_FLAG_COUNT = _countof(VK_MEMORY_PROPERTY_FLAG_NAMES); -static_assert( - _countof(VK_MEMORY_PROPERTY_FLAG_NAMES) == _countof(VK_MEMORY_PROPERTY_FLAG_VALUES), - "VK_MEMORY_PROPERTY_FLAG_NAMES array doesn't match VK_MEMORY_PROPERTY_FLAG_VALUES."); diff --git a/src/VmaReplay/Constants.h b/src/VmaReplay/Constants.h deleted file mode 100644 index 959681f..0000000 --- a/src/VmaReplay/Constants.h +++ /dev/null @@ -1,149 +0,0 @@ -// -// Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#pragma once - -extern const int RESULT_EXCEPTION; -extern const int RESULT_ERROR_COMMAND_LINE; -extern const int RESULT_ERROR_SOURCE_FILE; -extern const int RESULT_ERROR_FORMAT; -extern const int RESULT_ERROR_VULKAN; - -enum CMD_LINE_OPT -{ - CMD_LINE_OPT_VERBOSITY, - CMD_LINE_OPT_ITERATIONS, - CMD_LINE_OPT_LINES, - CMD_LINE_OPT_PHYSICAL_DEVICE, - CMD_LINE_OPT_USER_DATA, - CMD_LINE_OPT_VK_KHR_DEDICATED_ALLOCATION, - CMD_LINE_OPT_VK_EXT_MEMORY_BUDGET, - CMD_LINE_OPT_VK_LAYER_KHRONOS_VALIDATION, - CMD_LINE_OPT_MEM_STATS, - CMD_LINE_OPT_DUMP_STATS_AFTER_LINE, - CMD_LINE_OPT_DEFRAGMENT_AFTER_LINE, - CMD_LINE_OPT_DEFRAGMENTATION_FLAGS, - CMD_LINE_OPT_DUMP_DETAILED_STATS_AFTER_LINE, -}; - -enum class VERBOSITY -{ - MINIMUM = 0, - DEFAULT, - MAXIMUM, - COUNT, -}; - -enum class VULKAN_EXTENSION_REQUEST -{ - DISABLED, - ENABLED, - DEFAULT -}; - -enum class OBJECT_TYPE { BUFFER, IMAGE }; - -enum class VMA_FUNCTION -{ - CreatePool, - DestroyPool, - SetAllocationUserData, - CreateBuffer, - DestroyBuffer, - CreateImage, - DestroyImage, - FreeMemory, - FreeMemoryPages, - CreateLostAllocation, - AllocateMemory, - AllocateMemoryPages, - AllocateMemoryForBuffer, - AllocateMemoryForImage, - MapMemory, - UnmapMemory, - FlushAllocation, - InvalidateAllocation, - TouchAllocation, - GetAllocationInfo, - MakePoolAllocationsLost, - ResizeAllocation, - DefragmentationBegin, - DefragmentationEnd, - SetPoolName, - Count -}; -extern const char* VMA_FUNCTION_NAMES[]; - -extern const char* VMA_POOL_CREATE_FLAG_NAMES[]; -extern const uint32_t VMA_POOL_CREATE_FLAG_VALUES[]; -extern const size_t VMA_POOL_CREATE_FLAG_COUNT; - -extern const char* VK_BUFFER_CREATE_FLAG_NAMES[]; -extern const uint32_t VK_BUFFER_CREATE_FLAG_VALUES[]; -extern const size_t VK_BUFFER_CREATE_FLAG_COUNT; - -extern const char* VK_BUFFER_USAGE_FLAG_NAMES[]; -extern const uint32_t VK_BUFFER_USAGE_FLAG_VALUES[]; -extern const size_t VK_BUFFER_USAGE_FLAG_COUNT; - -extern const char* VK_SHARING_MODE_NAMES[]; -extern const size_t VK_SHARING_MODE_COUNT; - -extern const char* VK_IMAGE_CREATE_FLAG_NAMES[]; -extern const uint32_t VK_IMAGE_CREATE_FLAG_VALUES[]; -extern const size_t VK_IMAGE_CREATE_FLAG_COUNT; - -extern const char* VK_IMAGE_TYPE_NAMES[]; -extern const size_t VK_IMAGE_TYPE_COUNT; - -extern const char* VK_FORMAT_NAMES[]; -extern const uint32_t VK_FORMAT_VALUES[]; -extern const size_t VK_FORMAT_COUNT; - -extern const char* VK_SAMPLE_COUNT_NAMES[]; -extern const uint32_t VK_SAMPLE_COUNT_VALUES[]; -extern const size_t VK_SAMPLE_COUNT_COUNT; - -extern const char* VK_IMAGE_TILING_NAMES[]; -extern const size_t VK_IMAGE_TILING_COUNT; - -extern const char* VK_IMAGE_USAGE_FLAG_NAMES[]; -extern const uint32_t VK_IMAGE_USAGE_FLAG_VALUES[]; -extern const size_t VK_IMAGE_USAGE_FLAG_COUNT; - -extern const char* VK_IMAGE_TILING_NAMES[]; -extern const size_t VK_IMAGE_TILING_COUNT; - -extern const char* VK_IMAGE_LAYOUT_NAMES[]; -extern const uint32_t VK_IMAGE_LAYOUT_VALUES[]; -extern const size_t VK_IMAGE_LAYOUT_COUNT; - -extern const char* VMA_ALLOCATION_CREATE_FLAG_NAMES[]; -extern const uint32_t VMA_ALLOCATION_CREATE_FLAG_VALUES[]; -extern const size_t VMA_ALLOCATION_CREATE_FLAG_COUNT; - -extern const char* VMA_MEMORY_USAGE_NAMES[]; -extern const size_t VMA_MEMORY_USAGE_COUNT; - -extern const char* VK_MEMORY_PROPERTY_FLAG_NAMES[]; -extern const uint32_t VK_MEMORY_PROPERTY_FLAG_VALUES[]; -extern const size_t VK_MEMORY_PROPERTY_FLAG_COUNT; diff --git a/src/VmaReplay/VmaReplay.cpp b/src/VmaReplay/VmaReplay.cpp deleted file mode 100644 index e989eef..0000000 --- a/src/VmaReplay/VmaReplay.cpp +++ /dev/null @@ -1,4397 +0,0 @@ -// -// Copyright (c) 2018-2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#include "VmaUsage.h" -#include "Common.h" -#include "Constants.h" -#include <unordered_map> -#include <map> -#include <algorithm> - -static VERBOSITY g_Verbosity = VERBOSITY::DEFAULT; - -static const uint32_t VULKAN_API_VERSION = VK_API_VERSION_1_1; - -namespace DetailedStats -{ - -struct Flag -{ - uint32_t setCount = 0; - - void PostValue(bool v) - { - if(v) - { - ++setCount; - } - } - - void Print(uint32_t totalCount) const - { - if(setCount) - { - printf(" %u (%.2f%%)\n", setCount, (double)setCount * 100.0 / (double)totalCount); - } - else - { - printf(" 0\n"); - } - } -}; - -struct Enum -{ - Enum(size_t itemCount, const char* const* itemNames, const uint32_t* itemValues = nullptr) : - m_ItemCount(itemCount), - m_ItemNames(itemNames), - m_ItemValues(itemValues) - { - } - - void PostValue(uint32_t v) - { - if(v < _countof(m_BaseCount)) - { - ++m_BaseCount[v]; - } - else - { - auto it = m_ExtendedCount.find(v); - if(it != m_ExtendedCount.end()) - { - ++it->second; - } - else - { - m_ExtendedCount.insert(std::make_pair(v, 1u)); - } - } - } - - void Print(uint32_t totalCount) const - { - if(totalCount && - (!m_ExtendedCount.empty() || std::count_if(m_BaseCount, m_BaseCount + _countof(m_BaseCount), [](uint32_t v) { return v > 0; }))) - { - printf("\n"); - - for(size_t i = 0; i < _countof(m_BaseCount); ++i) - { - const uint32_t currCount = m_BaseCount[i]; - if(currCount) - { - PrintItem((uint32_t)i, currCount, totalCount); - } - } - - for(const auto& it : m_ExtendedCount) - { - PrintItem(it.first, it.second, totalCount); - } - } - else - { - printf(" 0\n"); - } - } - -private: - const size_t m_ItemCount; - const char* const* const m_ItemNames; - const uint32_t* const m_ItemValues; - - uint32_t m_BaseCount[32] = {}; - std::map<uint32_t, uint32_t> m_ExtendedCount; - - void PrintItem(uint32_t value, uint32_t count, uint32_t totalCount) const - { - size_t itemIndex = m_ItemCount; - if(m_ItemValues) - { - for(itemIndex = 0; itemIndex < m_ItemCount; ++itemIndex) - { - if(m_ItemValues[itemIndex] == value) - { - break; - } - } - } - else - { - if(value < m_ItemCount) - { - itemIndex = value; - } - } - - if(itemIndex < m_ItemCount) - { - printf(" %s: ", m_ItemNames[itemIndex]); - } - else - { - printf(" 0x%X: ", value); - } - - printf("%u (%.2f%%)\n", count, (double)count * 100.0 / (double)totalCount); - } -}; - -struct FlagSet -{ - uint32_t count[32] = {}; - - FlagSet(size_t count, const char* const* names, const uint32_t* values = nullptr) : - m_Count(count), - m_Names(names), - m_Values(values) - { - } - - void PostValue(uint32_t v) - { - for(size_t i = 0; i < 32; ++i) - { - if((v & (1u << i)) != 0) - { - ++count[i]; - } - } - } - - void Print(uint32_t totalCount) const - { - if(totalCount && - std::count_if(count, count + _countof(count), [](uint32_t v) { return v > 0; })) - { - printf("\n"); - for(uint32_t bitIndex = 0; bitIndex < 32; ++bitIndex) - { - const uint32_t currCount = count[bitIndex]; - if(currCount) - { - size_t itemIndex = m_Count; - if(m_Values) - { - for(itemIndex = 0; itemIndex < m_Count; ++itemIndex) - { - if(m_Values[itemIndex] == (1u << bitIndex)) - { - break; - } - } - } - else - { - if(bitIndex < m_Count) - { - itemIndex = bitIndex; - } - } - - if(itemIndex < m_Count) - { - printf(" %s: ", m_Names[itemIndex]); - } - else - { - printf(" 0x%X: ", 1u << bitIndex); - } - - printf("%u (%.2f%%)\n", currCount, (double)currCount * 100.0 / (double)totalCount); - } - } - } - else - { - printf(" 0\n"); - } - } - -private: - const size_t m_Count; - const char* const* const m_Names; - const uint32_t* const m_Values; -}; - -// T should be unsigned int -template<typename T> -struct MinMaxAvg -{ - T min = std::numeric_limits<T>::max(); - T max = 0; - T sum = T(); - - void PostValue(T v) - { - this->min = std::min(this->min, v); - this->max = std::max(this->max, v); - sum += v; - } - - void Print(uint32_t totalCount) const - { - if(totalCount && sum > T()) - { - if(this->min == this->max) - { - printf(" %llu\n", (uint64_t)this->max); - } - else - { - printf("\n Min: %llu\n Max: %llu\n Avg: %llu\n", - (uint64_t)this->min, - (uint64_t)this->max, - round_div<uint64_t>(this->sum, totalCount)); - } - } - else - { - printf(" 0\n"); - } - } -}; - -template<typename T> -struct BitMask -{ - uint32_t zeroCount = 0; - uint32_t maxCount = 0; - - void PostValue(T v) - { - if(v) - { - if(v == std::numeric_limits<T>::max()) - { - ++maxCount; - } - } - else - { - ++zeroCount; - } - } - - void Print(uint32_t totalCount) const - { - if(totalCount > 0 && zeroCount < totalCount) - { - const uint32_t otherCount = totalCount - (zeroCount + maxCount); - - printf("\n 0: %u (%.2f%%)\n Max: %u (%.2f%%)\n Other: %u (%.2f%%)\n", - zeroCount, (double)zeroCount * 100.0 / (double)totalCount, - maxCount, (double)maxCount * 100.0 / (double)totalCount, - otherCount, (double)otherCount * 100.0 / (double)totalCount); - } - else - { - printf(" 0\n"); - } - } -}; - -struct CountPerMemType -{ - uint32_t count[VK_MAX_MEMORY_TYPES] = {}; - - void PostValue(uint32_t v) - { - for(uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i) - { - if((v & (1u << i)) != 0) - { - ++count[i]; - } - } - } - - void Print(uint32_t totalCount) const - { - if(totalCount) - { - printf("\n"); - for(uint32_t i = 0; i < VK_MAX_MEMORY_TYPES; ++i) - { - if(count[i]) - { - printf(" %u: %u (%.2f%%)\n", i, count[i], - (double)count[i] * 100.0 / (double)totalCount); - } - } - } - else - { - printf(" 0\n"); - } - } -}; - -struct StructureStats -{ - uint32_t totalCount = 0; -}; - -#define PRINT_FIELD(name) \ - printf(" " #name ":"); \ - (name).Print(totalCount); -#define PRINT_FIELD_NAMED(name, nameStr) \ - printf(" " nameStr ":"); \ - (name).Print(totalCount); - -struct VmaPoolCreateInfoStats : public StructureStats -{ - CountPerMemType memoryTypeIndex; - FlagSet flags; - MinMaxAvg<VkDeviceSize> blockSize; - MinMaxAvg<size_t> minBlockCount; - MinMaxAvg<size_t> maxBlockCount; - Flag minMaxBlockCountEqual; - MinMaxAvg<uint32_t> frameInUseCount; - - VmaPoolCreateInfoStats() : - flags(VMA_POOL_CREATE_FLAG_COUNT, VMA_POOL_CREATE_FLAG_NAMES, VMA_POOL_CREATE_FLAG_VALUES) - { - } - - void PostValue(const VmaPoolCreateInfo& v) - { - ++totalCount; - - memoryTypeIndex.PostValue(v.memoryTypeIndex); - flags.PostValue(v.flags); - blockSize.PostValue(v.blockSize); - minBlockCount.PostValue(v.minBlockCount); - maxBlockCount.PostValue(v.maxBlockCount); - minMaxBlockCountEqual.PostValue(v.minBlockCount == v.maxBlockCount); - frameInUseCount.PostValue(v.frameInUseCount); - } - - void Print() const - { - if(totalCount == 0) - { - return; - } - - printf("VmaPoolCreateInfo (%u):\n", totalCount); - - PRINT_FIELD(memoryTypeIndex); - PRINT_FIELD(flags); - PRINT_FIELD(blockSize); - PRINT_FIELD(minBlockCount); - PRINT_FIELD(maxBlockCount); - PRINT_FIELD_NAMED(minMaxBlockCountEqual, "minBlockCount == maxBlockCount"); - PRINT_FIELD(frameInUseCount); - } -}; - -struct VkBufferCreateInfoStats : public StructureStats -{ - FlagSet flags; - MinMaxAvg<VkDeviceSize> size; - FlagSet usage; - Enum sharingMode; - - VkBufferCreateInfoStats() : - flags(VK_BUFFER_CREATE_FLAG_COUNT, VK_BUFFER_CREATE_FLAG_NAMES, VK_BUFFER_CREATE_FLAG_VALUES), - usage(VK_BUFFER_USAGE_FLAG_COUNT, VK_BUFFER_USAGE_FLAG_NAMES, VK_BUFFER_USAGE_FLAG_VALUES), - sharingMode(VK_SHARING_MODE_COUNT, VK_SHARING_MODE_NAMES) - { - } - - void PostValue(const VkBufferCreateInfo& v) - { - ++totalCount; - - flags.PostValue(v.flags); - size.PostValue(v.size); - usage.PostValue(v.usage); - sharingMode.PostValue(v.sharingMode); - } - - void Print() const - { - if(totalCount == 0) - { - return; - } - - printf("VkBufferCreateInfo (%u):\n", totalCount); - - PRINT_FIELD(flags); - PRINT_FIELD(size); - PRINT_FIELD(usage); - PRINT_FIELD(sharingMode); - } -}; - -struct VkImageCreateInfoStats : public StructureStats -{ - FlagSet flags; - Enum imageType; - Enum format; - MinMaxAvg<uint32_t> width, height, depth, mipLevels, arrayLayers; - Flag depthGreaterThanOne, mipLevelsGreaterThanOne, arrayLayersGreaterThanOne; - Enum samples; - Enum tiling; - FlagSet usage; - Enum sharingMode; - Enum initialLayout; - - VkImageCreateInfoStats() : - flags(VK_IMAGE_CREATE_FLAG_COUNT, VK_IMAGE_CREATE_FLAG_NAMES, VK_IMAGE_CREATE_FLAG_VALUES), - imageType(VK_IMAGE_TYPE_COUNT, VK_IMAGE_TYPE_NAMES), - format(VK_FORMAT_COUNT, VK_FORMAT_NAMES, VK_FORMAT_VALUES), - samples(VK_SAMPLE_COUNT_COUNT, VK_SAMPLE_COUNT_NAMES, VK_SAMPLE_COUNT_VALUES), - tiling(VK_IMAGE_TILING_COUNT, VK_IMAGE_TILING_NAMES), - usage(VK_IMAGE_USAGE_FLAG_COUNT, VK_IMAGE_USAGE_FLAG_NAMES, VK_IMAGE_USAGE_FLAG_VALUES), - sharingMode(VK_SHARING_MODE_COUNT, VK_SHARING_MODE_NAMES), - initialLayout(VK_IMAGE_LAYOUT_COUNT, VK_IMAGE_LAYOUT_NAMES, VK_IMAGE_LAYOUT_VALUES) - { - } - - void PostValue(const VkImageCreateInfo& v) - { - ++totalCount; - - flags.PostValue(v.flags); - imageType.PostValue(v.imageType); - format.PostValue(v.format); - width.PostValue(v.extent.width); - height.PostValue(v.extent.height); - depth.PostValue(v.extent.depth); - mipLevels.PostValue(v.mipLevels); - arrayLayers.PostValue(v.arrayLayers); - depthGreaterThanOne.PostValue(v.extent.depth > 1); - mipLevelsGreaterThanOne.PostValue(v.mipLevels > 1); - arrayLayersGreaterThanOne.PostValue(v.arrayLayers > 1); - samples.PostValue(v.samples); - tiling.PostValue(v.tiling); - usage.PostValue(v.usage); - sharingMode.PostValue(v.sharingMode); - initialLayout.PostValue(v.initialLayout); - } - - void Print() const - { - if(totalCount == 0) - { - return; - } - - printf("VkImageCreateInfo (%u):\n", totalCount); - - PRINT_FIELD(flags); - PRINT_FIELD(imageType); - PRINT_FIELD(format); - PRINT_FIELD(width); - PRINT_FIELD(height); - PRINT_FIELD(depth); - PRINT_FIELD(mipLevels); - PRINT_FIELD(arrayLayers); - PRINT_FIELD_NAMED(depthGreaterThanOne, "depth > 1"); - PRINT_FIELD_NAMED(mipLevelsGreaterThanOne, "mipLevels > 1"); - PRINT_FIELD_NAMED(arrayLayersGreaterThanOne, "arrayLayers > 1"); - PRINT_FIELD(samples); - PRINT_FIELD(tiling); - PRINT_FIELD(usage); - PRINT_FIELD(sharingMode); - PRINT_FIELD(initialLayout); - } -}; - -struct VmaAllocationCreateInfoStats : public StructureStats -{ - FlagSet flags; - Enum usage; - FlagSet requiredFlags, preferredFlags; - Flag requiredFlagsNotZero, preferredFlagsNotZero; - BitMask<uint32_t> memoryTypeBits; - Flag poolNotNull; - Flag userDataNotNull; - - VmaAllocationCreateInfoStats() : - flags(VMA_ALLOCATION_CREATE_FLAG_COUNT, VMA_ALLOCATION_CREATE_FLAG_NAMES, VMA_ALLOCATION_CREATE_FLAG_VALUES), - usage(VMA_MEMORY_USAGE_COUNT, VMA_MEMORY_USAGE_NAMES), - requiredFlags(VK_MEMORY_PROPERTY_FLAG_COUNT, VK_MEMORY_PROPERTY_FLAG_NAMES, VK_MEMORY_PROPERTY_FLAG_VALUES), - preferredFlags(VK_MEMORY_PROPERTY_FLAG_COUNT, VK_MEMORY_PROPERTY_FLAG_NAMES, VK_MEMORY_PROPERTY_FLAG_VALUES) - { - } - - void PostValue(const VmaAllocationCreateInfo& v, size_t count = 1) - { - totalCount += (uint32_t)count; - - for(size_t i = 0; i < count; ++i) - { - flags.PostValue(v.flags); - usage.PostValue(v.usage); - requiredFlags.PostValue(v.requiredFlags); - preferredFlags.PostValue(v.preferredFlags); - requiredFlagsNotZero.PostValue(v.requiredFlags != 0); - preferredFlagsNotZero.PostValue(v.preferredFlags != 0); - memoryTypeBits.PostValue(v.memoryTypeBits); - poolNotNull.PostValue(v.pool != VK_NULL_HANDLE); - userDataNotNull.PostValue(v.pUserData != nullptr); - } - } - - void Print() const - { - if(totalCount == 0) - { - return; - } - - printf("VmaAllocationCreateInfo (%u):\n", totalCount); - - PRINT_FIELD(flags); - PRINT_FIELD(usage); - PRINT_FIELD(requiredFlags); - PRINT_FIELD(preferredFlags); - PRINT_FIELD_NAMED(requiredFlagsNotZero, "requiredFlags != 0"); - PRINT_FIELD_NAMED(preferredFlagsNotZero, "preferredFlags != 0"); - PRINT_FIELD(memoryTypeBits); - PRINT_FIELD_NAMED(poolNotNull, "pool != VK_NULL_HANDLE"); - PRINT_FIELD_NAMED(userDataNotNull, "pUserData != nullptr"); - } -}; - -struct VmaAllocateMemoryPagesStats : public StructureStats -{ - MinMaxAvg<size_t> allocationCount; - - void PostValue(size_t allocationCount) - { - this->allocationCount.PostValue(allocationCount); - } - - void Print() const - { - if(totalCount == 0) - { - return; - } - - printf("vmaAllocateMemoryPages (%u):\n", totalCount); - - PRINT_FIELD(allocationCount); - } -}; - -struct VmaDefragmentationInfo2Stats : public StructureStats -{ - BitMask<VkDeviceSize> maxCpuBytesToMove; - BitMask<uint32_t> maxCpuAllocationsToMove; - BitMask<VkDeviceSize> maxGpuBytesToMove; - BitMask<uint32_t> maxGpuAllocationsToMove; - Flag commandBufferNotNull; - MinMaxAvg<uint32_t> allocationCount; - Flag allocationCountNotZero; - MinMaxAvg<uint32_t> poolCount; - Flag poolCountNotZero; - - void PostValue(const VmaDefragmentationInfo2& info) - { - ++totalCount; - - maxCpuBytesToMove.PostValue(info.maxCpuBytesToMove); - maxCpuAllocationsToMove.PostValue(info.maxCpuAllocationsToMove); - maxGpuBytesToMove.PostValue(info.maxGpuBytesToMove); - maxGpuAllocationsToMove.PostValue(info.maxGpuAllocationsToMove); - commandBufferNotNull.PostValue(info.commandBuffer != VK_NULL_HANDLE); - allocationCount.PostValue(info.allocationCount); - allocationCountNotZero.PostValue(info.allocationCount != 0); - poolCount.PostValue(info.poolCount); - poolCountNotZero.PostValue(info.poolCount != 0); - } - - void Print() const - { - if(totalCount == 0) - { - return; - } - - printf("VmaDefragmentationInfo2 (%u):\n", totalCount); - - PRINT_FIELD(maxCpuBytesToMove); - PRINT_FIELD(maxCpuAllocationsToMove); - PRINT_FIELD(maxGpuBytesToMove); - PRINT_FIELD(maxGpuAllocationsToMove); - PRINT_FIELD_NAMED(commandBufferNotNull, "commandBuffer != VK_NULL_HANDLE"); - PRINT_FIELD(allocationCount); - PRINT_FIELD_NAMED(allocationCountNotZero, "allocationCount > 0"); - PRINT_FIELD(poolCount); - PRINT_FIELD_NAMED(poolCountNotZero, "poolCount > 0"); - } -}; - -#undef PRINT_FIELD_NAMED -#undef PRINT_FIELD - -} // namespace DetailedStats - -// Set this to false to disable deleting leaked VmaAllocation, VmaPool objects -// and let VMA report asserts about them. -static const bool CLEANUP_LEAKED_OBJECTS = true; - -static std::string g_FilePath; -// Most significant 16 bits are major version, least significant 16 bits are minor version. -static uint32_t g_FileVersion; - -inline uint32_t MakeVersion(uint32_t major, uint32_t minor) { return (major << 16) | minor; } -inline uint32_t GetVersionMajor(uint32_t version) { return version >> 16; } -inline uint32_t GetVersionMinor(uint32_t version) { return version & 0xFFFF; } - -static size_t g_IterationCount = 1; -static uint32_t g_PhysicalDeviceIndex = 0; -static RangeSequence<size_t> g_LineRanges; -static bool g_UserDataEnabled = true; -static bool g_MemStatsEnabled = false; -VULKAN_EXTENSION_REQUEST g_VK_LAYER_KHRONOS_validation = VULKAN_EXTENSION_REQUEST::DEFAULT; -VULKAN_EXTENSION_REQUEST g_VK_EXT_memory_budget_request = VULKAN_EXTENSION_REQUEST::DEFAULT; -VULKAN_EXTENSION_REQUEST g_VK_AMD_device_coherent_memory_request = VULKAN_EXTENSION_REQUEST::DEFAULT; - -struct StatsAfterLineEntry -{ - size_t line; - bool detailed; - - bool operator<(const StatsAfterLineEntry& rhs) const { return line < rhs.line; } - bool operator==(const StatsAfterLineEntry& rhs) const { return line == rhs.line; } -}; -static std::vector<StatsAfterLineEntry> g_DumpStatsAfterLine; -static std::vector<size_t> g_DefragmentAfterLine; -static uint32_t g_DefragmentationFlags = 0; -static size_t g_DumpStatsAfterLineNextIndex = 0; -static size_t g_DefragmentAfterLineNextIndex = 0; - -static bool ValidateFileVersion() -{ - if(GetVersionMajor(g_FileVersion) == 1 && - GetVersionMinor(g_FileVersion) <= 8) - { - return true; - } - - return false; -} - -static bool ParseFileVersion(const StrRange& s) -{ - CsvSplit csvSplit; - csvSplit.Set(s, 2); - uint32_t major, minor; - if(csvSplit.GetCount() == 2 && - StrRangeToUint(csvSplit.GetRange(0), major) && - StrRangeToUint(csvSplit.GetRange(1), minor)) - { - g_FileVersion = (major << 16) | minor; - return true; - } - else - { - return false; - } -} - -//////////////////////////////////////////////////////////////////////////////// -// class Statistics - -class Statistics -{ -public: - static uint32_t BufferUsageToClass(uint32_t usage); - static uint32_t ImageUsageToClass(uint32_t usage); - - Statistics(); - ~Statistics(); - void Init(uint32_t memHeapCount, uint32_t memTypeCount); - void PrintDeviceMemStats() const; - void PrintMemStats() const; - void PrintDetailedStats() const; - - const size_t* GetFunctionCallCount() const { return m_FunctionCallCount; } - size_t GetImageCreationCount(uint32_t imgClass) const { return m_ImageCreationCount[imgClass]; } - size_t GetLinearImageCreationCount() const { return m_LinearImageCreationCount; } - size_t GetBufferCreationCount(uint32_t bufClass) const { return m_BufferCreationCount[bufClass]; } - size_t GetAllocationCreationCount() const { return (size_t)m_VmaAllocationCreateInfo.totalCount + m_CreateLostAllocationCount; } - size_t GetPoolCreationCount() const { return m_VmaPoolCreateInfo.totalCount; } - size_t GetBufferCreationCount() const { return (size_t)m_VkBufferCreateInfo.totalCount; } - - void RegisterFunctionCall(VMA_FUNCTION func); - void RegisterCreateImage(const VkImageCreateInfo& info); - void RegisterCreateBuffer(const VkBufferCreateInfo& info); - void RegisterCreatePool(const VmaPoolCreateInfo& info); - void RegisterCreateAllocation(const VmaAllocationCreateInfo& info, size_t allocCount = 1); - void RegisterCreateLostAllocation() { ++m_CreateLostAllocationCount; } - void RegisterAllocateMemoryPages(size_t allocCount) { m_VmaAllocateMemoryPages.PostValue(allocCount); } - void RegisterDefragmentation(const VmaDefragmentationInfo2& info); - - void RegisterDeviceMemoryAllocation(uint32_t memoryType, VkDeviceSize size); - void UpdateMemStats(const VmaStats& currStats); - -private: - uint32_t m_MemHeapCount = 0; - uint32_t m_MemTypeCount = 0; - - size_t m_FunctionCallCount[(size_t)VMA_FUNCTION::Count] = {}; - size_t m_ImageCreationCount[4] = { }; - size_t m_LinearImageCreationCount = 0; - size_t m_BufferCreationCount[4] = { }; - - struct DeviceMemStatInfo - { - size_t allocationCount; - VkDeviceSize allocationTotalSize; - }; - struct DeviceMemStats - { - DeviceMemStatInfo memoryType[VK_MAX_MEMORY_TYPES]; - DeviceMemStatInfo total; - } m_DeviceMemStats; - - // Structure similar to VmaStatInfo, but not the same. - struct MemStatInfo - { - uint32_t blockCount; - uint32_t allocationCount; - uint32_t unusedRangeCount; - VkDeviceSize usedBytes; - VkDeviceSize unusedBytes; - VkDeviceSize totalBytes; - }; - struct MemStats - { - MemStatInfo memoryType[VK_MAX_MEMORY_TYPES]; - MemStatInfo memoryHeap[VK_MAX_MEMORY_HEAPS]; - MemStatInfo total; - } m_PeakMemStats; - - DetailedStats::VmaPoolCreateInfoStats m_VmaPoolCreateInfo; - DetailedStats::VkBufferCreateInfoStats m_VkBufferCreateInfo; - DetailedStats::VkImageCreateInfoStats m_VkImageCreateInfo; - DetailedStats::VmaAllocationCreateInfoStats m_VmaAllocationCreateInfo; - size_t m_CreateLostAllocationCount = 0; - DetailedStats::VmaAllocateMemoryPagesStats m_VmaAllocateMemoryPages; - DetailedStats::VmaDefragmentationInfo2Stats m_VmaDefragmentationInfo2; - - void UpdateMemStatInfo(MemStatInfo& inoutPeakInfo, const VmaStatInfo& currInfo); - static void PrintMemStatInfo(const MemStatInfo& info); -}; - -// Hack for global AllocateDeviceMemoryCallback. -static Statistics* g_Statistics; - -static void VKAPI_CALL AllocateDeviceMemoryCallback( - VmaAllocator allocator, - uint32_t memoryType, - VkDeviceMemory memory, - VkDeviceSize size, - void* pUserData) -{ - g_Statistics->RegisterDeviceMemoryAllocation(memoryType, size); -} - -/// Callback function called before vkFreeMemory. -static void VKAPI_CALL FreeDeviceMemoryCallback( - VmaAllocator allocator, - uint32_t memoryType, - VkDeviceMemory memory, - VkDeviceSize size, - void* pUserData) -{ - // Nothing. -} - -uint32_t Statistics::BufferUsageToClass(uint32_t usage) -{ - // Buffer is used as source of data for fixed-function stage of graphics pipeline. - // It's indirect, vertex, or index buffer. - if ((usage & (VK_BUFFER_USAGE_INDIRECT_BUFFER_BIT | - VK_BUFFER_USAGE_VERTEX_BUFFER_BIT | - VK_BUFFER_USAGE_INDEX_BUFFER_BIT)) != 0) - { - return 0; - } - // Buffer is accessed by shaders for load/store/atomic. - // Aka "UAV" - else if ((usage & (VK_BUFFER_USAGE_STORAGE_BUFFER_BIT | - VK_BUFFER_USAGE_STORAGE_TEXEL_BUFFER_BIT)) != 0) - { - return 1; - } - // Buffer is accessed by shaders for reading uniform data. - // Aka "constant buffer" - else if ((usage & (VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT | - VK_BUFFER_USAGE_UNIFORM_TEXEL_BUFFER_BIT)) != 0) - { - return 2; - } - // Any other type of buffer. - // Notice that VK_BUFFER_USAGE_TRANSFER_SRC_BIT and VK_BUFFER_USAGE_TRANSFER_DST_BIT - // flags are intentionally ignored. - else - { - return 3; - } -} - -uint32_t Statistics::ImageUsageToClass(uint32_t usage) -{ - // Image is used as depth/stencil "texture/surface". - if ((usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) != 0) - { - return 0; - } - // Image is used as other type of attachment. - // Aka "render target" - else if ((usage & (VK_IMAGE_USAGE_INPUT_ATTACHMENT_BIT | - VK_IMAGE_USAGE_TRANSIENT_ATTACHMENT_BIT | - VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)) != 0) - { - return 1; - } - // Image is accessed by shaders for sampling. - // Aka "texture" - else if ((usage & VK_IMAGE_USAGE_SAMPLED_BIT) != 0) - { - return 2; - } - // Any other type of image. - // Notice that VK_IMAGE_USAGE_TRANSFER_SRC_BIT and VK_IMAGE_USAGE_TRANSFER_DST_BIT - // flags are intentionally ignored. - else - { - return 3; - } -} - -Statistics::Statistics() -{ - ZeroMemory(&m_DeviceMemStats, sizeof(m_DeviceMemStats)); - ZeroMemory(&m_PeakMemStats, sizeof(m_PeakMemStats)); - - assert(g_Statistics == nullptr); - g_Statistics = this; -} - -Statistics::~Statistics() -{ - assert(g_Statistics == this); - g_Statistics = nullptr; -} - -void Statistics::Init(uint32_t memHeapCount, uint32_t memTypeCount) -{ - m_MemHeapCount = memHeapCount; - m_MemTypeCount = memTypeCount; -} - -void Statistics::PrintDeviceMemStats() const -{ - printf("Successful device memory allocations:\n"); - printf(" Total: count = %zu, total size = %llu\n", - m_DeviceMemStats.total.allocationCount, m_DeviceMemStats.total.allocationTotalSize); - for(uint32_t i = 0; i < m_MemTypeCount; ++i) - { - printf(" Memory type %u: count = %zu, total size = %llu\n", - i, m_DeviceMemStats.memoryType[i].allocationCount, m_DeviceMemStats.memoryType[i].allocationTotalSize); - } -} - -void Statistics::PrintMemStats() const -{ - printf("Memory statistics:\n"); - - printf(" Total:\n"); - PrintMemStatInfo(m_PeakMemStats.total); - - for(uint32_t i = 0; i < m_MemHeapCount; ++i) - { - const MemStatInfo& info = m_PeakMemStats.memoryHeap[i]; - if(info.blockCount > 0 || info.totalBytes > 0) - { - printf(" Heap %u:\n", i); - PrintMemStatInfo(info); - } - } - - for(uint32_t i = 0; i < m_MemTypeCount; ++i) - { - const MemStatInfo& info = m_PeakMemStats.memoryType[i]; - if(info.blockCount > 0 || info.totalBytes > 0) - { - printf(" Type %u:\n", i); - PrintMemStatInfo(info); - } - } -} - -void Statistics::PrintDetailedStats() const -{ - m_VmaPoolCreateInfo.Print(); - m_VmaAllocationCreateInfo.Print(); - m_VmaAllocateMemoryPages.Print(); - m_VkBufferCreateInfo.Print(); - m_VkImageCreateInfo.Print(); - m_VmaDefragmentationInfo2.Print(); -} - -void Statistics::RegisterFunctionCall(VMA_FUNCTION func) -{ - ++m_FunctionCallCount[(size_t)func]; -} - -void Statistics::RegisterCreateImage(const VkImageCreateInfo& info) -{ - if(info.tiling == VK_IMAGE_TILING_LINEAR) - ++m_LinearImageCreationCount; - else - { - const uint32_t imgClass = ImageUsageToClass(info.usage); - ++m_ImageCreationCount[imgClass]; - } - - m_VkImageCreateInfo.PostValue(info); -} - -void Statistics::RegisterCreateBuffer(const VkBufferCreateInfo& info) -{ - const uint32_t bufClass = BufferUsageToClass(info.usage); - ++m_BufferCreationCount[bufClass]; - - m_VkBufferCreateInfo.PostValue(info); -} - -void Statistics::RegisterCreatePool(const VmaPoolCreateInfo& info) -{ - m_VmaPoolCreateInfo.PostValue(info); -} - -void Statistics::RegisterCreateAllocation(const VmaAllocationCreateInfo& info, size_t allocCount) -{ - m_VmaAllocationCreateInfo.PostValue(info, allocCount); -} - -void Statistics::RegisterDefragmentation(const VmaDefragmentationInfo2& info) -{ - m_VmaDefragmentationInfo2.PostValue(info); -} - -void Statistics::UpdateMemStats(const VmaStats& currStats) -{ - UpdateMemStatInfo(m_PeakMemStats.total, currStats.total); - - for(uint32_t i = 0; i < m_MemHeapCount; ++i) - { - UpdateMemStatInfo(m_PeakMemStats.memoryHeap[i], currStats.memoryHeap[i]); - } - - for(uint32_t i = 0; i < m_MemTypeCount; ++i) - { - UpdateMemStatInfo(m_PeakMemStats.memoryType[i], currStats.memoryType[i]); - } -} - -void Statistics::RegisterDeviceMemoryAllocation(uint32_t memoryType, VkDeviceSize size) -{ - ++m_DeviceMemStats.total.allocationCount; - m_DeviceMemStats.total.allocationTotalSize += size; - - ++m_DeviceMemStats.memoryType[memoryType].allocationCount; - m_DeviceMemStats.memoryType[memoryType].allocationTotalSize += size; -} - -void Statistics::UpdateMemStatInfo(MemStatInfo& inoutPeakInfo, const VmaStatInfo& currInfo) -{ -#define SET_PEAK(inoutDst, src) \ - if((src) > (inoutDst)) \ - { \ - (inoutDst) = (src); \ - } - - SET_PEAK(inoutPeakInfo.blockCount, currInfo.blockCount); - SET_PEAK(inoutPeakInfo.allocationCount, currInfo.allocationCount); - SET_PEAK(inoutPeakInfo.unusedRangeCount, currInfo.unusedRangeCount); - SET_PEAK(inoutPeakInfo.usedBytes, currInfo.usedBytes); - SET_PEAK(inoutPeakInfo.unusedBytes, currInfo.unusedBytes); - SET_PEAK(inoutPeakInfo.totalBytes, currInfo.usedBytes + currInfo.unusedBytes); - -#undef SET_PEAK -} - -void Statistics::PrintMemStatInfo(const MemStatInfo& info) -{ - printf(" Peak blocks %u, allocations %u, unused ranges %u\n", - info.blockCount, - info.allocationCount, - info.unusedRangeCount); - printf(" Peak total bytes %llu, used bytes %llu, unused bytes %llu\n", - info.totalBytes, - info.usedBytes, - info.unusedBytes); -} - -//////////////////////////////////////////////////////////////////////////////// -// class ConfigurationParser - -class ConfigurationParser -{ -public: - ConfigurationParser(); - - bool Parse(LineSplit& lineSplit); - - void Compare( - const VkPhysicalDeviceProperties& currDevProps, - const VkPhysicalDeviceMemoryProperties& currMemProps, - uint32_t vulkanApiVersion, - bool currMemoryBudgetEnabled); - -private: - enum class OPTION - { - VulkanApiVersion, - PhysicalDevice_apiVersion, - PhysicalDevice_driverVersion, - PhysicalDevice_vendorID, - PhysicalDevice_deviceID, - PhysicalDevice_deviceType, - PhysicalDevice_deviceName, - PhysicalDeviceLimits_maxMemoryAllocationCount, - PhysicalDeviceLimits_bufferImageGranularity, - PhysicalDeviceLimits_nonCoherentAtomSize, - Extension_VK_KHR_dedicated_allocation, - Extension_VK_KHR_bind_memory2, - Extension_VK_EXT_memory_budget, - Extension_VK_AMD_device_coherent_memory, - Macro_VMA_DEBUG_ALWAYS_DEDICATED_MEMORY, - Macro_VMA_MIN_ALIGNMENT, - Macro_VMA_DEBUG_MARGIN, - Macro_VMA_DEBUG_INITIALIZE_ALLOCATIONS, - Macro_VMA_DEBUG_DETECT_CORRUPTION, - Macro_VMA_DEBUG_GLOBAL_MUTEX, - Macro_VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY, - Macro_VMA_SMALL_HEAP_MAX_SIZE, - Macro_VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE, - Count - }; - - std::vector<bool> m_OptionSet; - std::vector<std::string> m_OptionValue; - VkPhysicalDeviceMemoryProperties m_MemProps; - - bool m_WarningHeaderPrinted = false; - - void SetOption( - size_t lineNumber, - OPTION option, - const StrRange& str); - void EnsureWarningHeader(); - void CompareOption(VERBOSITY minVerbosity, const char* name, - OPTION option, uint32_t currValue); - void CompareOption(VERBOSITY minVerbosity, const char* name, - OPTION option, uint64_t currValue); - void CompareOption(VERBOSITY minVerbosity, const char* name, - OPTION option, bool currValue); - void CompareOption(VERBOSITY minVerbosity, const char* name, - OPTION option, const char* currValue); - void CompareMemProps( - const VkPhysicalDeviceMemoryProperties& currMemProps); -}; - -ConfigurationParser::ConfigurationParser() : - m_OptionSet((size_t)OPTION::Count), - m_OptionValue((size_t)OPTION::Count) -{ - ZeroMemory(&m_MemProps, sizeof(m_MemProps)); -} - -bool ConfigurationParser::Parse(LineSplit& lineSplit) -{ - for(auto& it : m_OptionSet) - { - it = false; - } - for(auto& it : m_OptionValue) - { - it.clear(); - } - - StrRange line; - - if(!lineSplit.GetNextLine(line) && !StrRangeEq(line, "Config,Begin")) - { - return false; - } - - CsvSplit csvSplit; - while(lineSplit.GetNextLine(line)) - { - if(StrRangeEq(line, "Config,End")) - { - break; - } - - const size_t currLineNumber = lineSplit.GetNextLineIndex(); - - csvSplit.Set(line); - if(csvSplit.GetCount() == 0) - { - return false; - } - - const StrRange optionName = csvSplit.GetRange(0); - if(StrRangeEq(optionName, "VulkanApiVersion")) - { - SetOption(currLineNumber, OPTION::VulkanApiVersion, StrRange{csvSplit.GetRange(1).beg, csvSplit.GetRange(2).end}); - } - else if(StrRangeEq(optionName, "PhysicalDevice")) - { - if(csvSplit.GetCount() >= 3) - { - const StrRange subOptionName = csvSplit.GetRange(1); - if(StrRangeEq(subOptionName, "apiVersion")) - SetOption(currLineNumber, OPTION::PhysicalDevice_apiVersion, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "driverVersion")) - SetOption(currLineNumber, OPTION::PhysicalDevice_driverVersion, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "vendorID")) - SetOption(currLineNumber, OPTION::PhysicalDevice_vendorID, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "deviceID")) - SetOption(currLineNumber, OPTION::PhysicalDevice_deviceID, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "deviceType")) - SetOption(currLineNumber, OPTION::PhysicalDevice_deviceType, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "deviceName")) - SetOption(currLineNumber, OPTION::PhysicalDevice_deviceName, StrRange(csvSplit.GetRange(2).beg, line.end)); - else - printf("Line %zu: Unrecognized configuration option.\n", currLineNumber); - } - else - printf("Line %zu: Too few columns.\n", currLineNumber); - } - else if(StrRangeEq(optionName, "PhysicalDeviceLimits")) - { - if(csvSplit.GetCount() >= 3) - { - const StrRange subOptionName = csvSplit.GetRange(1); - if(StrRangeEq(subOptionName, "maxMemoryAllocationCount")) - SetOption(currLineNumber, OPTION::PhysicalDeviceLimits_maxMemoryAllocationCount, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "bufferImageGranularity")) - SetOption(currLineNumber, OPTION::PhysicalDeviceLimits_bufferImageGranularity, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "nonCoherentAtomSize")) - SetOption(currLineNumber, OPTION::PhysicalDeviceLimits_nonCoherentAtomSize, csvSplit.GetRange(2)); - else - printf("Line %zu: Unrecognized configuration option.\n", currLineNumber); - } - else - printf("Line %zu: Too few columns.\n", currLineNumber); - } - else if(StrRangeEq(optionName, "Extension")) - { - if(csvSplit.GetCount() >= 3) - { - const StrRange subOptionName = csvSplit.GetRange(1); - if(StrRangeEq(subOptionName, "VK_KHR_dedicated_allocation")) - { - // Ignore because this extension is promoted to Vulkan 1.1. - } - else if(StrRangeEq(subOptionName, "VK_KHR_bind_memory2")) - SetOption(currLineNumber, OPTION::Extension_VK_KHR_bind_memory2, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VK_EXT_memory_budget")) - SetOption(currLineNumber, OPTION::Extension_VK_EXT_memory_budget, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VK_AMD_device_coherent_memory")) - SetOption(currLineNumber, OPTION::Extension_VK_AMD_device_coherent_memory, csvSplit.GetRange(2)); - else - printf("Line %zu: Unrecognized configuration option.\n", currLineNumber); - } - else - printf("Line %zu: Too few columns.\n", currLineNumber); - } - else if(StrRangeEq(optionName, "Macro")) - { - if(csvSplit.GetCount() >= 3) - { - const StrRange subOptionName = csvSplit.GetRange(1); - if(StrRangeEq(subOptionName, "VMA_DEBUG_ALWAYS_DEDICATED_MEMORY")) - SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_ALWAYS_DEDICATED_MEMORY, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_MIN_ALIGNMENT") || StrRangeEq(subOptionName, "VMA_DEBUG_ALIGNMENT")) - SetOption(currLineNumber, OPTION::Macro_VMA_MIN_ALIGNMENT, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_DEBUG_MARGIN")) - SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_MARGIN, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_DEBUG_INITIALIZE_ALLOCATIONS")) - SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_INITIALIZE_ALLOCATIONS, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_DEBUG_DETECT_CORRUPTION")) - SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_DETECT_CORRUPTION, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_DEBUG_GLOBAL_MUTEX")) - SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_GLOBAL_MUTEX, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY")) - SetOption(currLineNumber, OPTION::Macro_VMA_DEBUG_MIN_BUFFER_IMAGE_GRANULARITY, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_SMALL_HEAP_MAX_SIZE")) - SetOption(currLineNumber, OPTION::Macro_VMA_SMALL_HEAP_MAX_SIZE, csvSplit.GetRange(2)); - else if(StrRangeEq(subOptionName, "VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE")) - SetOption(currLineNumber, OPTION::Macro_VMA_DEFAULT_LARGE_HEAP_BLOCK_SIZE, csvSplit.GetRange(2)); - else - printf("Line %zu: Unrecognized configuration option.\n", currLineNumber); - } - else - printf("Line %zu: Too few columns.\n", currLineNumber); - } - else if(StrRangeEq(optionName, "PhysicalDeviceMemory")) - { - uint32_t value = 0; - if(csvSplit.GetCount() == 3 && StrRangeEq(csvSplit.GetRange(1), "HeapCount") && - StrRangeToUint(csvSplit.GetRange(2), value)) - { - m_MemProps.memoryHeapCount = value; - } - else if(csvSplit.GetCount() == 3 && StrRangeEq(csvSplit.GetRange(1), "TypeCount") && - StrRangeToUint(csvSplit.GetRange(2), value)) - { - m_MemProps.memoryTypeCount = value; - } - else if(csvSplit.GetCount() == 5 && StrRangeEq(csvSplit.GetRange(1), "Heap") && - StrRangeToUint(csvSplit.GetRange(2), value) && - value < m_MemProps.memoryHeapCount) - { - if(StrRangeEq(csvSplit.GetRange(3), "size") && - StrRangeToUint(csvSplit.GetRange(4), m_MemProps.memoryHeaps[value].size)) - { - // Parsed. - } - else if(StrRangeEq(csvSplit.GetRange(3), "flags") && - StrRangeToUint(csvSplit.GetRange(4), m_MemProps.memoryHeaps[value].flags)) - { - // Parsed. - } - else - printf("Line %zu: Invalid configuration option.\n", currLineNumber); - } - else if(csvSplit.GetCount() == 5 && StrRangeEq(csvSplit.GetRange(1), "Type") && - StrRangeToUint(csvSplit.GetRange(2), value) && - value < m_MemProps.memoryTypeCount) - { - if(StrRangeEq(csvSplit.GetRange(3), "heapIndex") && - StrRangeToUint(csvSplit.GetRange(4), m_MemProps.memoryTypes[value].heapIndex)) - { - // Parsed. - } - else if(StrRangeEq(csvSplit.GetRange(3), "propertyFlags") && - StrRangeToUint(csvSplit.GetRange(4), m_MemProps.memoryTypes[value].propertyFlags)) - { - // Parsed. - } - else - printf("Line %zu: Invalid configuration option.\n", currLineNumber); - } - else - printf("Line %zu: Invalid configuration option.\n", currLineNumber); - } - else - printf("Line %zu: Unrecognized configuration option.\n", currLineNumber); - } - - return true; -} - -void ConfigurationParser::Compare( - const VkPhysicalDeviceProperties& currDevProps, - const VkPhysicalDeviceMemoryProperties& currMemProps, - uint32_t vulkanApiVersion, - bool currMemoryBudgetEnabled) -{ - char vulkanApiVersionStr[32]; - sprintf_s(vulkanApiVersionStr, "%u,%u", VK_VERSION_MAJOR(vulkanApiVersion), VK_VERSION_MINOR(vulkanApiVersion)); - CompareOption(VERBOSITY::DEFAULT, "VulkanApiVersion", - OPTION::VulkanApiVersion, vulkanApiVersionStr); - - CompareOption(VERBOSITY::MAXIMUM, "PhysicalDevice apiVersion", - OPTION::PhysicalDevice_apiVersion, currDevProps.apiVersion); - CompareOption(VERBOSITY::MAXIMUM, "PhysicalDevice driverVersion", - OPTION::PhysicalDevice_driverVersion, currDevProps.driverVersion); - CompareOption(VERBOSITY::MAXIMUM, "PhysicalDevice vendorID", - OPTION::PhysicalDevice_vendorID, currDevProps.vendorID); - CompareOption(VERBOSITY::MAXIMUM, "PhysicalDevice deviceID", - OPTION::PhysicalDevice_deviceID, currDevProps.deviceID); - CompareOption(VERBOSITY::MAXIMUM, "PhysicalDevice deviceType", - OPTION::PhysicalDevice_deviceType, (uint32_t)currDevProps.deviceType); - CompareOption(VERBOSITY::MAXIMUM, "PhysicalDevice deviceName", - OPTION::PhysicalDevice_deviceName, currDevProps.deviceName); - - CompareOption(VERBOSITY::DEFAULT, "PhysicalDeviceLimits maxMemoryAllocationCount", - OPTION::PhysicalDeviceLimits_maxMemoryAllocationCount, currDevProps.limits.maxMemoryAllocationCount); - CompareOption(VERBOSITY::DEFAULT, "PhysicalDeviceLimits bufferImageGranularity", - OPTION::PhysicalDeviceLimits_bufferImageGranularity, currDevProps.limits.bufferImageGranularity); - CompareOption(VERBOSITY::DEFAULT, "PhysicalDeviceLimits nonCoherentAtomSize", - OPTION::PhysicalDeviceLimits_nonCoherentAtomSize, currDevProps.limits.nonCoherentAtomSize); - - CompareMemProps(currMemProps); -} - -void ConfigurationParser::SetOption( - size_t lineNumber, - OPTION option, - const StrRange& str) -{ - if(m_OptionSet[(size_t)option]) - { - printf("Line %zu: Option already specified.\n" ,lineNumber); - } - - m_OptionSet[(size_t)option] = true; - - std::string val; - str.to_str(val); - m_OptionValue[(size_t)option] = std::move(val); -} - -void ConfigurationParser::EnsureWarningHeader() -{ - if(!m_WarningHeaderPrinted) - { - printf("WARNING: Following configuration parameters don't match:\n"); - m_WarningHeaderPrinted = true; - } -} - -void ConfigurationParser::CompareOption(VERBOSITY minVerbosity, const char* name, - OPTION option, uint32_t currValue) -{ - if(m_OptionSet[(size_t)option] && - g_Verbosity >= minVerbosity) - { - uint32_t origValue; - if(StrRangeToUint(StrRange(m_OptionValue[(size_t)option]), origValue)) - { - if(origValue != currValue) - { - EnsureWarningHeader(); - printf(" %s: original %u, current %u\n", name, origValue, currValue); - } - } - } -} - -void ConfigurationParser::CompareOption(VERBOSITY minVerbosity, const char* name, - OPTION option, uint64_t currValue) -{ - if(m_OptionSet[(size_t)option] && - g_Verbosity >= minVerbosity) - { - uint64_t origValue; - if(StrRangeToUint(StrRange(m_OptionValue[(size_t)option]), origValue)) - { - if(origValue != currValue) - { - EnsureWarningHeader(); - printf(" %s: original %llu, current %llu\n", name, origValue, currValue); - } - } - } -} - -void ConfigurationParser::CompareOption(VERBOSITY minVerbosity, const char* name, - OPTION option, bool currValue) -{ - if(m_OptionSet[(size_t)option] && - g_Verbosity >= minVerbosity) - { - bool origValue; - if(StrRangeToBool(StrRange(m_OptionValue[(size_t)option]), origValue)) - { - if(origValue != currValue) - { - EnsureWarningHeader(); - printf(" %s: original %u, current %u\n", name, - origValue ? 1 : 0, - currValue ? 1 : 0); - } - } - } -} - -void ConfigurationParser::CompareOption(VERBOSITY minVerbosity, const char* name, - OPTION option, const char* currValue) -{ - if(m_OptionSet[(size_t)option] && - g_Verbosity >= minVerbosity) - { - const std::string& origValue = m_OptionValue[(size_t)option]; - if(origValue != currValue) - { - EnsureWarningHeader(); - printf(" %s: original \"%s\", current \"%s\"\n", name, origValue.c_str(), currValue); - } - } -} - -void ConfigurationParser::CompareMemProps( - const VkPhysicalDeviceMemoryProperties& currMemProps) -{ - if(g_Verbosity < VERBOSITY::DEFAULT) - { - return; - } - - bool memoryMatch = - currMemProps.memoryHeapCount == m_MemProps.memoryHeapCount && - currMemProps.memoryTypeCount == m_MemProps.memoryTypeCount; - - for(uint32_t i = 0; memoryMatch && i < currMemProps.memoryHeapCount; ++i) - { - memoryMatch = - currMemProps.memoryHeaps[i].flags == m_MemProps.memoryHeaps[i].flags; - } - for(uint32_t i = 0; memoryMatch && i < currMemProps.memoryTypeCount; ++i) - { - memoryMatch = - currMemProps.memoryTypes[i].heapIndex == m_MemProps.memoryTypes[i].heapIndex && - currMemProps.memoryTypes[i].propertyFlags == m_MemProps.memoryTypes[i].propertyFlags; - } - - if(memoryMatch && g_Verbosity == VERBOSITY::MAXIMUM) - { - bool memorySizeMatch = true; - for(uint32_t i = 0; memorySizeMatch && i < currMemProps.memoryHeapCount; ++i) - { - memorySizeMatch = - currMemProps.memoryHeaps[i].size == m_MemProps.memoryHeaps[i].size; - } - - if(!memorySizeMatch) - { - printf("WARNING: Sizes of original memory heaps are different from current ones.\n"); - } - } - else - { - printf("WARNING: Layout of original memory heaps and types is different from current one.\n"); - } -} - -//////////////////////////////////////////////////////////////////////////////// -// class Player - -static const char* const VALIDATION_LAYER_NAME = "VK_LAYER_KHRONOS_validation"; - -static VkBool32 VKAPI_PTR MyDebugReportCallback( - VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, - VkDebugUtilsMessageTypeFlagsEXT messageTypes, - const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, - void* pUserData) -{ - assert(pCallbackData && pCallbackData->pMessageIdName && pCallbackData->pMessage); - printf("%s \xBA %s\n", pCallbackData->pMessageIdName, pCallbackData->pMessage); - return VK_FALSE; -} - -static bool IsLayerSupported(const VkLayerProperties* pProps, size_t propCount, const char* pLayerName) -{ - const VkLayerProperties* propsEnd = pProps + propCount; - return std::find_if( - pProps, - propsEnd, - [pLayerName](const VkLayerProperties& prop) -> bool { - return strcmp(pLayerName, prop.layerName) == 0; - }) != propsEnd; -} - -static const size_t FIRST_PARAM_INDEX = 4; - -static void InitVulkanFeatures( - VkPhysicalDeviceFeatures& outFeatures, - const VkPhysicalDeviceFeatures& supportedFeatures) -{ - ZeroMemory(&outFeatures, sizeof(outFeatures)); - - // Enable something what may interact with memory/buffer/image support. - - outFeatures.fullDrawIndexUint32 = supportedFeatures.fullDrawIndexUint32; - outFeatures.imageCubeArray = supportedFeatures.imageCubeArray; - outFeatures.geometryShader = supportedFeatures.geometryShader; - outFeatures.tessellationShader = supportedFeatures.tessellationShader; - outFeatures.multiDrawIndirect = supportedFeatures.multiDrawIndirect; - outFeatures.textureCompressionETC2 = supportedFeatures.textureCompressionETC2; - outFeatures.textureCompressionASTC_LDR = supportedFeatures.textureCompressionASTC_LDR; - outFeatures.textureCompressionBC = supportedFeatures.textureCompressionBC; -} - -class Player -{ -public: - Player(); - int Init(); - ~Player(); - - void ApplyConfig(ConfigurationParser& configParser); - void ExecuteLine(size_t lineNumber, const StrRange& line); - void DumpStats(const char* fileNameFormat, size_t lineNumber, bool detailed); - void Defragment(); - - void PrintStats(); - -private: - static const size_t MAX_WARNINGS_TO_SHOW = 64; - - size_t m_WarningCount = 0; - bool m_AllocateForBufferImageWarningIssued = false; - - VkInstance m_VulkanInstance = VK_NULL_HANDLE; - VkPhysicalDevice m_PhysicalDevice = VK_NULL_HANDLE; - uint32_t m_GraphicsQueueFamilyIndex = UINT32_MAX; - uint32_t m_TransferQueueFamilyIndex = UINT32_MAX; - VkDevice m_Device = VK_NULL_HANDLE; - VkQueue m_GraphicsQueue = VK_NULL_HANDLE; - VkQueue m_TransferQueue = VK_NULL_HANDLE; - VmaAllocator m_Allocator = VK_NULL_HANDLE; - VkCommandPool m_CommandPool = VK_NULL_HANDLE; - VkCommandBuffer m_CommandBuffer = VK_NULL_HANDLE; - bool m_MemoryBudgetEnabled = false; - const VkPhysicalDeviceProperties* m_DevProps = nullptr; - const VkPhysicalDeviceMemoryProperties* m_MemProps = nullptr; - - PFN_vkCreateDebugUtilsMessengerEXT m_vkCreateDebugUtilsMessengerEXT = nullptr; - PFN_vkDestroyDebugUtilsMessengerEXT m_vkDestroyDebugUtilsMessengerEXT = nullptr; - VkDebugUtilsMessengerEXT m_DebugUtilsMessenger = VK_NULL_HANDLE; - - uint32_t m_VmaFrameIndex = 0; - - // Any of these handles null can mean it was created in original but couldn't be created now. - struct Pool - { - VmaPool pool; - }; - struct Allocation - { - uint32_t allocationFlags = 0; - VmaAllocation allocation = VK_NULL_HANDLE; - VkBuffer buffer = VK_NULL_HANDLE; - VkImage image = VK_NULL_HANDLE; - }; - std::unordered_map<uint64_t, Pool> m_Pools; - std::unordered_map<uint64_t, Allocation> m_Allocations; - std::unordered_map<uint64_t, VmaDefragmentationContext> m_DefragmentationContexts; - - struct Thread - { - uint32_t callCount; - }; - std::unordered_map<uint32_t, Thread> m_Threads; - - // Copy of column [1] from previously parsed line. - std::string m_LastLineTimeStr; - Statistics m_Stats; - - std::vector<char> m_UserDataTmpStr; - - void Destroy(const Allocation& alloc); - - // Finds VmaPool bu original pointer. - // If origPool = null, returns true and outPool = null. - // If failed, prints warning, returns false and outPool = null. - bool FindPool(size_t lineNumber, uint64_t origPool, VmaPool& outPool); - // If allocation with that origPtr already exists, prints warning and replaces it. - void AddAllocation(size_t lineNumber, uint64_t origPtr, VkResult res, const char* functionName, Allocation&& allocDesc); - - // Increments warning counter. Returns true if warning message should be printed. - bool IssueWarning(); - - int InitVulkan(); - void FinalizeVulkan(); - void RegisterDebugCallbacks(); - void UnregisterDebugCallbacks(); - - // If parmeter count doesn't match, issues warning and returns false. - bool ValidateFunctionParameterCount(size_t lineNumber, const CsvSplit& csvSplit, size_t expectedParamCount, bool lastUnbound); - - // If failed, prints warning, returns false, and sets allocCreateInfo.pUserData to null. - bool PrepareUserData(size_t lineNumber, uint32_t allocCreateFlags, const StrRange& userDataColumn, const StrRange& wholeLine, void*& outUserData); - - void UpdateMemStats(); - - void ExecuteCreatePool(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteDestroyPool(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteSetAllocationUserData(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteCreateBuffer(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteDestroyBuffer(size_t lineNumber, const CsvSplit& csvSplit) { m_Stats.RegisterFunctionCall(VMA_FUNCTION::DestroyBuffer); DestroyAllocation(lineNumber, csvSplit, "vmaDestroyBuffer"); } - void ExecuteCreateImage(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteDestroyImage(size_t lineNumber, const CsvSplit& csvSplit) { m_Stats.RegisterFunctionCall(VMA_FUNCTION::DestroyImage); DestroyAllocation(lineNumber, csvSplit, "vmaDestroyImage"); } - void ExecuteFreeMemory(size_t lineNumber, const CsvSplit& csvSplit) { m_Stats.RegisterFunctionCall(VMA_FUNCTION::FreeMemory); DestroyAllocation(lineNumber, csvSplit, "vmaFreeMemory"); } - void ExecuteFreeMemoryPages(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteCreateLostAllocation(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteAllocateMemory(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteAllocateMemoryPages(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteAllocateMemoryForBufferOrImage(size_t lineNumber, const CsvSplit& csvSplit, OBJECT_TYPE objType); - void ExecuteMapMemory(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteUnmapMemory(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteFlushAllocation(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteInvalidateAllocation(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteTouchAllocation(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteGetAllocationInfo(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteMakePoolAllocationsLost(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteResizeAllocation(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteDefragmentationBegin(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteDefragmentationEnd(size_t lineNumber, const CsvSplit& csvSplit); - void ExecuteSetPoolName(size_t lineNumber, const CsvSplit& csvSplit); - - void DestroyAllocation(size_t lineNumber, const CsvSplit& csvSplit, const char* functionName); - - void PrintStats(const VmaStats& stats, const char* suffix); - void PrintStatInfo(const VmaStatInfo& info); -}; - -Player::Player() -{ -} - -int Player::Init() -{ - int result = InitVulkan(); - - if(result == 0) - { - m_Stats.Init(m_MemProps->memoryHeapCount, m_MemProps->memoryTypeCount); - UpdateMemStats(); - } - - return result; -} - -Player::~Player() -{ - FinalizeVulkan(); - - if(g_Verbosity < VERBOSITY::MAXIMUM && m_WarningCount > MAX_WARNINGS_TO_SHOW) - printf("WARNING: %zu more warnings not shown.\n", m_WarningCount - MAX_WARNINGS_TO_SHOW); -} - -void Player::ApplyConfig(ConfigurationParser& configParser) -{ - configParser.Compare(*m_DevProps, *m_MemProps, - VULKAN_API_VERSION, - m_MemoryBudgetEnabled); -} - -void Player::ExecuteLine(size_t lineNumber, const StrRange& line) -{ - CsvSplit csvSplit; - csvSplit.Set(line); - - if(csvSplit.GetCount() >= FIRST_PARAM_INDEX) - { - // Check thread ID. - uint32_t threadId; - if(StrRangeToUint(csvSplit.GetRange(0), threadId)) - { - const auto it = m_Threads.find(threadId); - if(it != m_Threads.end()) - { - ++it->second.callCount; - } - else - { - Thread threadInfo{}; - threadInfo.callCount = 1; - m_Threads[threadId] = threadInfo; - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Incorrect thread ID.\n", lineNumber); - } - } - - // Save time. - csvSplit.GetRange(1).to_str(m_LastLineTimeStr); - - // Update VMA current frame index. - StrRange frameIndexStr = csvSplit.GetRange(2); - uint32_t frameIndex; - if(StrRangeToUint(frameIndexStr, frameIndex)) - { - if(frameIndex != m_VmaFrameIndex) - { - vmaSetCurrentFrameIndex(m_Allocator, frameIndex); - m_VmaFrameIndex = frameIndex; - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Incorrect frame index.\n", lineNumber); - } - } - - StrRange functionName = csvSplit.GetRange(3); - - if(StrRangeEq(functionName, "vmaCreateAllocator")) - { - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 0, false)) - { - // Nothing. - } - } - else if(StrRangeEq(functionName, "vmaDestroyAllocator")) - { - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 0, false)) - { - // Nothing. - } - } - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::CreatePool])) - ExecuteCreatePool(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::DestroyPool])) - ExecuteDestroyPool(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::SetAllocationUserData])) - ExecuteSetAllocationUserData(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::CreateBuffer])) - ExecuteCreateBuffer(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::DestroyBuffer])) - ExecuteDestroyBuffer(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::CreateImage])) - ExecuteCreateImage(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::DestroyImage])) - ExecuteDestroyImage(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::FreeMemory])) - ExecuteFreeMemory(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::FreeMemoryPages])) - ExecuteFreeMemoryPages(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::CreateLostAllocation])) - ExecuteCreateLostAllocation(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::AllocateMemory])) - ExecuteAllocateMemory(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::AllocateMemoryPages])) - ExecuteAllocateMemoryPages(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::AllocateMemoryForBuffer])) - ExecuteAllocateMemoryForBufferOrImage(lineNumber, csvSplit, OBJECT_TYPE::BUFFER); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::AllocateMemoryForImage])) - ExecuteAllocateMemoryForBufferOrImage(lineNumber, csvSplit, OBJECT_TYPE::IMAGE); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::MapMemory])) - ExecuteMapMemory(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::UnmapMemory])) - ExecuteUnmapMemory(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::FlushAllocation])) - ExecuteFlushAllocation(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::InvalidateAllocation])) - ExecuteInvalidateAllocation(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::TouchAllocation])) - ExecuteTouchAllocation(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::GetAllocationInfo])) - ExecuteGetAllocationInfo(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::MakePoolAllocationsLost])) - ExecuteMakePoolAllocationsLost(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::ResizeAllocation])) - ExecuteResizeAllocation(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::DefragmentationBegin])) - ExecuteDefragmentationBegin(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::DefragmentationEnd])) - ExecuteDefragmentationEnd(lineNumber, csvSplit); - else if(StrRangeEq(functionName, VMA_FUNCTION_NAMES[(uint32_t)VMA_FUNCTION::SetPoolName])) - ExecuteSetPoolName(lineNumber, csvSplit); - else - { - if(IssueWarning()) - { - printf("Line %zu: Unknown function.\n", lineNumber); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Too few columns.\n", lineNumber); - } - } -} - -void Player::DumpStats(const char* fileNameFormat, size_t lineNumber, bool detailed) -{ - char* pStatsString = nullptr; - vmaBuildStatsString(m_Allocator, &pStatsString, detailed ? VK_TRUE : VK_FALSE); - - char fileName[MAX_PATH]; - sprintf_s(fileName, fileNameFormat, lineNumber); - - FILE* file = nullptr; - errno_t err = fopen_s(&file, fileName, "wb"); - if(err == 0) - { - fwrite(pStatsString, 1, strlen(pStatsString), file); - fclose(file); - } - else - { - printf("ERROR: Failed to write file: %s\n", fileName); - } - - vmaFreeStatsString(m_Allocator, pStatsString); -} - -void Player::Destroy(const Allocation& alloc) -{ - if(alloc.buffer) - { - assert(alloc.image == VK_NULL_HANDLE); - vmaDestroyBuffer(m_Allocator, alloc.buffer, alloc.allocation); - } - else if(alloc.image) - { - vmaDestroyImage(m_Allocator, alloc.image, alloc.allocation); - } - else - vmaFreeMemory(m_Allocator, alloc.allocation); -} - -bool Player::FindPool(size_t lineNumber, uint64_t origPool, VmaPool& outPool) -{ - outPool = VK_NULL_HANDLE; - - if(origPool != 0) - { - const auto poolIt = m_Pools.find(origPool); - if(poolIt != m_Pools.end()) - { - outPool = poolIt->second.pool; - return true; - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Pool %llX not found.\n", lineNumber, origPool); - } - } - } - - return true; -} - -void Player::AddAllocation(size_t lineNumber, uint64_t origPtr, VkResult res, const char* functionName, Allocation&& allocDesc) -{ - if(origPtr) - { - if(res == VK_SUCCESS) - { - // Originally succeeded, currently succeeded. - // Just save pointer (done below). - } - else - { - // Originally succeeded, currently failed. - // Print warning. Save null pointer. - if(IssueWarning()) - { - printf("Line %zu: %s failed (%d), while originally succeeded.\n", lineNumber, functionName, res); - } - } - - const auto existingIt = m_Allocations.find(origPtr); - if(existingIt != m_Allocations.end()) - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX already exists.\n", lineNumber, origPtr); - } - } - m_Allocations[origPtr] = std::move(allocDesc); - } - else - { - if(res == VK_SUCCESS) - { - // Originally failed, currently succeeded. - // Print warning, destroy the object. - if(IssueWarning()) - { - printf("Line %zu: %s succeeded, originally failed.\n", lineNumber, functionName); - } - - Destroy(allocDesc); - } - else - { - // Originally failed, currently failed. - // Print warning. - if(IssueWarning()) - { - printf("Line %zu: %s failed (%d), originally also failed.\n", lineNumber, functionName, res); - } - } - } -} - -bool Player::IssueWarning() -{ - if(g_Verbosity < VERBOSITY::MAXIMUM) - { - return m_WarningCount++ < MAX_WARNINGS_TO_SHOW; - } - else - { - ++m_WarningCount; - return true; - } -} - -int Player::InitVulkan() -{ - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - printf("Initializing Vulkan...\n"); - } - - uint32_t instanceLayerPropCount = 0; - VkResult res = vkEnumerateInstanceLayerProperties(&instanceLayerPropCount, nullptr); - assert(res == VK_SUCCESS); - - std::vector<VkLayerProperties> instanceLayerProps(instanceLayerPropCount); - if(instanceLayerPropCount > 0) - { - res = vkEnumerateInstanceLayerProperties(&instanceLayerPropCount, instanceLayerProps.data()); - assert(res == VK_SUCCESS); - } - - const bool validationLayersAvailable = - IsLayerSupported(instanceLayerProps.data(), instanceLayerProps.size(), VALIDATION_LAYER_NAME); - - bool validationLayersEnabled = false; - switch(g_VK_LAYER_KHRONOS_validation) - { - case VULKAN_EXTENSION_REQUEST::DISABLED: - break; - case VULKAN_EXTENSION_REQUEST::DEFAULT: - validationLayersEnabled = validationLayersAvailable; - break; - case VULKAN_EXTENSION_REQUEST::ENABLED: - validationLayersEnabled = validationLayersAvailable; - if(!validationLayersAvailable) - { - printf("WARNING: %s layer cannot be enabled.\n", VALIDATION_LAYER_NAME); - } - break; - default: assert(0); - } - - uint32_t availableInstanceExtensionCount = 0; - res = vkEnumerateInstanceExtensionProperties(nullptr, &availableInstanceExtensionCount, nullptr); - assert(res == VK_SUCCESS); - std::vector<VkExtensionProperties> availableInstanceExtensions(availableInstanceExtensionCount); - if(availableInstanceExtensionCount > 0) - { - res = vkEnumerateInstanceExtensionProperties(nullptr, &availableInstanceExtensionCount, availableInstanceExtensions.data()); - assert(res == VK_SUCCESS); - } - - std::vector<const char*> enabledInstanceExtensions; - //enabledInstanceExtensions.push_back(VK_KHR_SURFACE_EXTENSION_NAME); - //enabledInstanceExtensions.push_back(VK_KHR_WIN32_SURFACE_EXTENSION_NAME); - - std::vector<const char*> instanceLayers; - if(validationLayersEnabled) - { - instanceLayers.push_back(VALIDATION_LAYER_NAME); - } - - bool VK_KHR_get_physical_device_properties2_enabled = false; - bool VK_EXT_debug_utils_enabled = false; - for(const auto& extensionProperties : availableInstanceExtensions) - { - if(strcmp(extensionProperties.extensionName, VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME) == 0) - { - enabledInstanceExtensions.push_back(VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME); - VK_KHR_get_physical_device_properties2_enabled = true; - } - else if(strcmp(extensionProperties.extensionName, VK_EXT_DEBUG_UTILS_EXTENSION_NAME) == 0) - { - if(validationLayersEnabled) - { - enabledInstanceExtensions.push_back("VK_EXT_debug_utils"); - VK_EXT_debug_utils_enabled = true; - } - } - } - - VkApplicationInfo appInfo = { VK_STRUCTURE_TYPE_APPLICATION_INFO }; - appInfo.pApplicationName = "VmaReplay"; - appInfo.applicationVersion = VK_MAKE_VERSION(2, 3, 0); - appInfo.pEngineName = "Vulkan Memory Allocator"; - appInfo.engineVersion = VK_MAKE_VERSION(2, 3, 0); - appInfo.apiVersion = VULKAN_API_VERSION; - - VkInstanceCreateInfo instInfo = { VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO }; - instInfo.pApplicationInfo = &appInfo; - instInfo.enabledExtensionCount = (uint32_t)enabledInstanceExtensions.size(); - instInfo.ppEnabledExtensionNames = enabledInstanceExtensions.data(); - instInfo.enabledLayerCount = (uint32_t)instanceLayers.size(); - instInfo.ppEnabledLayerNames = instanceLayers.data(); - - res = vkCreateInstance(&instInfo, NULL, &m_VulkanInstance); - if(res != VK_SUCCESS) - { - printf("ERROR: vkCreateInstance failed (%d)\n", res); - return RESULT_ERROR_VULKAN; - } - - if(VK_EXT_debug_utils_enabled) - { - RegisterDebugCallbacks(); - } - - // Find physical device - - uint32_t physicalDeviceCount = 0; - res = vkEnumeratePhysicalDevices(m_VulkanInstance, &physicalDeviceCount, nullptr); - assert(res == VK_SUCCESS); - if(physicalDeviceCount == 0) - { - printf("ERROR: No Vulkan physical devices found.\n"); - return RESULT_ERROR_VULKAN; - } - - std::vector<VkPhysicalDevice> physicalDevices(physicalDeviceCount); - res = vkEnumeratePhysicalDevices(m_VulkanInstance, &physicalDeviceCount, physicalDevices.data()); - assert(res == VK_SUCCESS); - - if(g_PhysicalDeviceIndex >= physicalDeviceCount) - { - printf("ERROR: Incorrect Vulkan physical device index %u. System has %u physical devices.\n", - g_PhysicalDeviceIndex, - physicalDeviceCount); - return RESULT_ERROR_VULKAN; - } - - m_PhysicalDevice = physicalDevices[0]; - - // Find queue family index - - uint32_t queueFamilyCount = 0; - vkGetPhysicalDeviceQueueFamilyProperties(m_PhysicalDevice, &queueFamilyCount, nullptr); - if(queueFamilyCount) - { - std::vector<VkQueueFamilyProperties> queueFamilies(queueFamilyCount); - vkGetPhysicalDeviceQueueFamilyProperties(m_PhysicalDevice, &queueFamilyCount, queueFamilies.data()); - for(uint32_t i = 0; i < queueFamilyCount; ++i) - { - if(queueFamilies[i].queueCount > 0) - { - if(m_GraphicsQueueFamilyIndex == UINT32_MAX && - (queueFamilies[i].queueFlags & VK_QUEUE_GRAPHICS_BIT) != 0) - { - m_GraphicsQueueFamilyIndex = i; - } - if(m_TransferQueueFamilyIndex == UINT32_MAX && - (queueFamilies[i].queueFlags & VK_QUEUE_TRANSFER_BIT) != 0) - { - m_TransferQueueFamilyIndex = i; - } - } - } - } - if(m_GraphicsQueueFamilyIndex == UINT_MAX) - { - printf("ERROR: Couldn't find graphics queue.\n"); - return RESULT_ERROR_VULKAN; - } - if(m_TransferQueueFamilyIndex == UINT_MAX) - { - printf("ERROR: Couldn't find transfer queue.\n"); - return RESULT_ERROR_VULKAN; - } - - VkPhysicalDeviceFeatures supportedFeatures; - vkGetPhysicalDeviceFeatures(m_PhysicalDevice, &supportedFeatures); - - // Create logical device - - const float queuePriority = 1.f; - - VkDeviceQueueCreateInfo deviceQueueCreateInfo[2] = {}; - deviceQueueCreateInfo[0].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; - deviceQueueCreateInfo[0].queueFamilyIndex = m_GraphicsQueueFamilyIndex; - deviceQueueCreateInfo[0].queueCount = 1; - deviceQueueCreateInfo[0].pQueuePriorities = &queuePriority; - - if(m_TransferQueueFamilyIndex != m_GraphicsQueueFamilyIndex) - { - deviceQueueCreateInfo[1].sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO; - deviceQueueCreateInfo[1].queueFamilyIndex = m_TransferQueueFamilyIndex; - deviceQueueCreateInfo[1].queueCount = 1; - deviceQueueCreateInfo[1].pQueuePriorities = &queuePriority; - } - - // Enable something what may interact with memory/buffer/image support. - VkPhysicalDeviceFeatures enabledFeatures; - InitVulkanFeatures(enabledFeatures, supportedFeatures); - - bool VK_KHR_get_memory_requirements2_available = false; - - // Determine list of device extensions to enable. - std::vector<const char*> enabledDeviceExtensions; - //enabledDeviceExtensions.push_back(VK_KHR_SWAPCHAIN_EXTENSION_NAME); - bool memoryBudgetAvailable = false; - { - uint32_t propertyCount = 0; - res = vkEnumerateDeviceExtensionProperties(m_PhysicalDevice, nullptr, &propertyCount, nullptr); - assert(res == VK_SUCCESS); - - if(propertyCount) - { - std::vector<VkExtensionProperties> properties{propertyCount}; - res = vkEnumerateDeviceExtensionProperties(m_PhysicalDevice, nullptr, &propertyCount, properties.data()); - assert(res == VK_SUCCESS); - - for(uint32_t i = 0; i < propertyCount; ++i) - { - if(strcmp(properties[i].extensionName, VK_KHR_GET_MEMORY_REQUIREMENTS_2_EXTENSION_NAME) == 0) - { - VK_KHR_get_memory_requirements2_available = true; - } - else if(strcmp(properties[i].extensionName, VK_EXT_MEMORY_BUDGET_EXTENSION_NAME) == 0) - { - if(VK_KHR_get_physical_device_properties2_enabled) - { - memoryBudgetAvailable = true; - } - } - } - } - } - - switch(g_VK_EXT_memory_budget_request) - { - case VULKAN_EXTENSION_REQUEST::DISABLED: - break; - case VULKAN_EXTENSION_REQUEST::DEFAULT: - m_MemoryBudgetEnabled = memoryBudgetAvailable; - break; - case VULKAN_EXTENSION_REQUEST::ENABLED: - m_MemoryBudgetEnabled = memoryBudgetAvailable; - if(!memoryBudgetAvailable) - { - printf("WARNING: VK_EXT_memory_budget extension cannot be enabled.\n"); - } - break; - default: assert(0); - } - - if(g_VK_AMD_device_coherent_memory_request == VULKAN_EXTENSION_REQUEST::ENABLED) - { - printf("WARNING: AMD_device_coherent_memory requested but not currently supported by the player.\n"); - } - - if(m_MemoryBudgetEnabled) - { - enabledDeviceExtensions.push_back(VK_EXT_MEMORY_BUDGET_EXTENSION_NAME); - } - - VkDeviceCreateInfo deviceCreateInfo = { VK_STRUCTURE_TYPE_DEVICE_CREATE_INFO }; - deviceCreateInfo.enabledExtensionCount = (uint32_t)enabledDeviceExtensions.size(); - deviceCreateInfo.ppEnabledExtensionNames = !enabledDeviceExtensions.empty() ? enabledDeviceExtensions.data() : nullptr; - deviceCreateInfo.queueCreateInfoCount = m_TransferQueueFamilyIndex != m_GraphicsQueueFamilyIndex ? 2 : 1; - deviceCreateInfo.pQueueCreateInfos = deviceQueueCreateInfo; - deviceCreateInfo.pEnabledFeatures = &enabledFeatures; - - res = vkCreateDevice(m_PhysicalDevice, &deviceCreateInfo, nullptr, &m_Device); - if(res != VK_SUCCESS) - { - printf("ERROR: vkCreateDevice failed (%d)\n", res); - return RESULT_ERROR_VULKAN; - } - - // Fetch queues - vkGetDeviceQueue(m_Device, m_GraphicsQueueFamilyIndex, 0, &m_GraphicsQueue); - vkGetDeviceQueue(m_Device, m_TransferQueueFamilyIndex, 0, &m_TransferQueue); - - // Create memory allocator - - VmaDeviceMemoryCallbacks deviceMemoryCallbacks = {}; - deviceMemoryCallbacks.pfnAllocate = AllocateDeviceMemoryCallback; - deviceMemoryCallbacks.pfnFree = FreeDeviceMemoryCallback; - - VmaAllocatorCreateInfo allocatorInfo = {}; - allocatorInfo.instance = m_VulkanInstance; - allocatorInfo.physicalDevice = m_PhysicalDevice; - allocatorInfo.device = m_Device; - allocatorInfo.flags = VMA_ALLOCATOR_CREATE_EXTERNALLY_SYNCHRONIZED_BIT; - allocatorInfo.pDeviceMemoryCallbacks = &deviceMemoryCallbacks; - allocatorInfo.vulkanApiVersion = VULKAN_API_VERSION; - - if(m_MemoryBudgetEnabled) - { - allocatorInfo.flags |= VMA_ALLOCATOR_CREATE_EXT_MEMORY_BUDGET_BIT; - } - - res = vmaCreateAllocator(&allocatorInfo, &m_Allocator); - if(res != VK_SUCCESS) - { - printf("ERROR: vmaCreateAllocator failed (%d)\n", res); - return RESULT_ERROR_VULKAN; - } - - vmaGetPhysicalDeviceProperties(m_Allocator, &m_DevProps); - vmaGetMemoryProperties(m_Allocator, &m_MemProps); - - // Create command pool - - VkCommandPoolCreateInfo cmdPoolCreateInfo = { VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO }; - cmdPoolCreateInfo.queueFamilyIndex = m_TransferQueueFamilyIndex; - cmdPoolCreateInfo.flags = VK_COMMAND_POOL_CREATE_TRANSIENT_BIT; - - res = vkCreateCommandPool(m_Device, &cmdPoolCreateInfo, nullptr, &m_CommandPool); - if(res != VK_SUCCESS) - { - printf("ERROR: vkCreateCommandPool failed (%d)\n", res); - return RESULT_ERROR_VULKAN; - } - - // Create command buffer - - VkCommandBufferAllocateInfo cmdBufAllocInfo = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO }; - cmdBufAllocInfo.commandBufferCount = 1; - cmdBufAllocInfo.commandPool = m_CommandPool; - cmdBufAllocInfo.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; - res = vkAllocateCommandBuffers(m_Device, &cmdBufAllocInfo, &m_CommandBuffer); - if(res != VK_SUCCESS) - { - printf("ERROR: vkAllocateCommandBuffers failed (%d)\n", res); - return RESULT_ERROR_VULKAN; - } - - return 0; -} - -void Player::FinalizeVulkan() -{ - if(!m_DefragmentationContexts.empty()) - { - printf("WARNING: Defragmentation contexts not destroyed: %zu.\n", m_DefragmentationContexts.size()); - - if(CLEANUP_LEAKED_OBJECTS) - { - for(const auto& it : m_DefragmentationContexts) - { - vmaDefragmentationEnd(m_Allocator, it.second); - } - } - - m_DefragmentationContexts.clear(); - } - - if(!m_Allocations.empty()) - { - printf("WARNING: Allocations not destroyed: %zu.\n", m_Allocations.size()); - - if(CLEANUP_LEAKED_OBJECTS) - { - for(const auto it : m_Allocations) - { - Destroy(it.second); - } - } - - m_Allocations.clear(); - } - - if(!m_Pools.empty()) - { - printf("WARNING: Custom pools not destroyed: %zu.\n", m_Pools.size()); - - if(CLEANUP_LEAKED_OBJECTS) - { - for(const auto it : m_Pools) - { - vmaDestroyPool(m_Allocator, it.second.pool); - } - } - - m_Pools.clear(); - } - - vkDeviceWaitIdle(m_Device); - - if(m_CommandBuffer != VK_NULL_HANDLE) - { - vkFreeCommandBuffers(m_Device, m_CommandPool, 1, &m_CommandBuffer); - m_CommandBuffer = VK_NULL_HANDLE; - } - - if(m_CommandPool != VK_NULL_HANDLE) - { - vkDestroyCommandPool(m_Device, m_CommandPool, nullptr); - m_CommandPool = VK_NULL_HANDLE; - } - - if(m_Allocator != VK_NULL_HANDLE) - { - vmaDestroyAllocator(m_Allocator); - m_Allocator = nullptr; - } - - if(m_Device != VK_NULL_HANDLE) - { - vkDestroyDevice(m_Device, nullptr); - m_Device = nullptr; - } - - UnregisterDebugCallbacks(); - - if(m_VulkanInstance != VK_NULL_HANDLE) - { - vkDestroyInstance(m_VulkanInstance, NULL); - m_VulkanInstance = VK_NULL_HANDLE; - } -} - -void Player::RegisterDebugCallbacks() -{ - static const VkDebugUtilsMessageSeverityFlagsEXT DEBUG_UTILS_MESSENGER_MESSAGE_SEVERITY = - //VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT | - //VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT; - static const VkDebugUtilsMessageTypeFlagsEXT DEBUG_UTILS_MESSENGER_MESSAGE_TYPE = - VK_DEBUG_UTILS_MESSAGE_TYPE_GENERAL_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_TYPE_VALIDATION_BIT_EXT | - VK_DEBUG_UTILS_MESSAGE_TYPE_PERFORMANCE_BIT_EXT; - - m_vkCreateDebugUtilsMessengerEXT = (PFN_vkCreateDebugUtilsMessengerEXT)vkGetInstanceProcAddr( - m_VulkanInstance, "vkCreateDebugUtilsMessengerEXT"); - m_vkDestroyDebugUtilsMessengerEXT = (PFN_vkDestroyDebugUtilsMessengerEXT)vkGetInstanceProcAddr( - m_VulkanInstance, "vkDestroyDebugUtilsMessengerEXT"); - assert(m_vkCreateDebugUtilsMessengerEXT); - assert(m_vkDestroyDebugUtilsMessengerEXT); - - VkDebugUtilsMessengerCreateInfoEXT messengerCreateInfo = { VK_STRUCTURE_TYPE_DEBUG_UTILS_MESSENGER_CREATE_INFO_EXT }; - messengerCreateInfo.messageSeverity = DEBUG_UTILS_MESSENGER_MESSAGE_SEVERITY; - messengerCreateInfo.messageType = DEBUG_UTILS_MESSENGER_MESSAGE_TYPE; - messengerCreateInfo.pfnUserCallback = MyDebugReportCallback; - VkResult res = m_vkCreateDebugUtilsMessengerEXT(m_VulkanInstance, &messengerCreateInfo, nullptr, &m_DebugUtilsMessenger); - if(res != VK_SUCCESS) - { - printf("ERROR: vkCreateDebugUtilsMessengerEXT failed (%d)\n", res); - m_DebugUtilsMessenger = VK_NULL_HANDLE; - } -} - -void Player::UnregisterDebugCallbacks() -{ - if(m_DebugUtilsMessenger) - { - m_vkDestroyDebugUtilsMessengerEXT(m_VulkanInstance, m_DebugUtilsMessenger, nullptr); - } -} - -void Player::Defragment() -{ - VmaStats stats; - vmaCalculateStats(m_Allocator, &stats); - PrintStats(stats, "before defragmentation"); - - const size_t allocCount = m_Allocations.size(); - std::vector<VmaAllocation> allocations(allocCount); - size_t notNullAllocCount = 0; - for(const auto& it : m_Allocations) - { - if(it.second.allocation != VK_NULL_HANDLE) - { - allocations[notNullAllocCount] = it.second.allocation; - ++notNullAllocCount; - } - } - if(notNullAllocCount == 0) - { - printf(" Nothing to defragment.\n"); - return; - } - - allocations.resize(notNullAllocCount); - std::vector<VkBool32> allocationsChanged(notNullAllocCount); - - VmaDefragmentationStats defragStats = {}; - - VkCommandBufferBeginInfo cmdBufBeginInfo = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO }; - cmdBufBeginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; - VkResult res = vkBeginCommandBuffer(m_CommandBuffer, &cmdBufBeginInfo); - if(res != VK_SUCCESS) - { - printf("ERROR: vkBeginCommandBuffer failed (%d)\n", res); - return; - } - - const time_point timeBeg = std::chrono::high_resolution_clock::now(); - - VmaDefragmentationInfo2 defragInfo = {}; - defragInfo.allocationCount = (uint32_t)notNullAllocCount; - defragInfo.pAllocations = allocations.data(); - defragInfo.pAllocationsChanged = allocationsChanged.data(); - defragInfo.maxCpuAllocationsToMove = UINT32_MAX; - defragInfo.maxCpuBytesToMove = VK_WHOLE_SIZE; - defragInfo.maxGpuAllocationsToMove = UINT32_MAX; - defragInfo.maxGpuBytesToMove = VK_WHOLE_SIZE; - defragInfo.flags = g_DefragmentationFlags; - defragInfo.commandBuffer = m_CommandBuffer; - - VmaDefragmentationContext defragCtx = VK_NULL_HANDLE; - res = vmaDefragmentationBegin(m_Allocator, &defragInfo, &defragStats, &defragCtx); - - const time_point timeAfterDefragBegin = std::chrono::high_resolution_clock::now(); - - vkEndCommandBuffer(m_CommandBuffer); - - if(res >= VK_SUCCESS) - { - VkSubmitInfo submitInfo = { VK_STRUCTURE_TYPE_SUBMIT_INFO }; - submitInfo.commandBufferCount = 1; - submitInfo.pCommandBuffers = &m_CommandBuffer; - vkQueueSubmit(m_TransferQueue, 1, &submitInfo, VK_NULL_HANDLE); - vkQueueWaitIdle(m_TransferQueue); - - const time_point timeAfterGpu = std::chrono::high_resolution_clock::now(); - - vmaDefragmentationEnd(m_Allocator, defragCtx); - - const time_point timeAfterDefragEnd = std::chrono::high_resolution_clock::now(); - - const duration defragDurationBegin = timeAfterDefragBegin - timeBeg; - const duration defragDurationGpu = timeAfterGpu - timeAfterDefragBegin; - const duration defragDurationEnd = timeAfterDefragEnd - timeAfterGpu; - - // If anything changed. - if(defragStats.allocationsMoved > 0) - { - // Go over allocation that changed and destroy their buffers and images. - size_t i = 0; - for(auto& it : m_Allocations) - { - if(allocationsChanged[i] != VK_FALSE) - { - if(it.second.buffer != VK_NULL_HANDLE) - { - vkDestroyBuffer(m_Device, it.second.buffer, nullptr); - it.second.buffer = VK_NULL_HANDLE; - } - if(it.second.image != VK_NULL_HANDLE) - { - vkDestroyImage(m_Device, it.second.image, nullptr); - it.second.image = VK_NULL_HANDLE; - } - } - ++i; - } - } - - // Print statistics - std::string defragDurationBeginStr; - std::string defragDurationGpuStr; - std::string defragDurationEndStr; - SecondsToFriendlyStr(ToFloatSeconds(defragDurationBegin), defragDurationBeginStr); - SecondsToFriendlyStr(ToFloatSeconds(defragDurationGpu), defragDurationGpuStr); - SecondsToFriendlyStr(ToFloatSeconds(defragDurationEnd), defragDurationEndStr); - - printf(" Defragmentation took:\n"); - printf(" vmaDefragmentationBegin: %s\n", defragDurationBeginStr.c_str()); - printf(" GPU: %s\n", defragDurationGpuStr.c_str()); - printf(" vmaDefragmentationEnd: %s\n", defragDurationEndStr.c_str()); - printf(" VmaDefragmentationStats:\n"); - printf(" bytesMoved: %llu\n", defragStats.bytesMoved); - printf(" bytesFreed: %llu\n", defragStats.bytesFreed); - printf(" allocationsMoved: %u\n", defragStats.allocationsMoved); - printf(" deviceMemoryBlocksFreed: %u\n", defragStats.deviceMemoryBlocksFreed); - - vmaCalculateStats(m_Allocator, &stats); - PrintStats(stats, "after defragmentation"); - } - else - { - printf("vmaDefragmentationBegin failed (%d).\n", res); - } - - vkResetCommandPool(m_Device, m_CommandPool, 0); -} - -void Player::PrintStats() -{ - if(g_Verbosity == VERBOSITY::MINIMUM) - { - return; - } - - m_Stats.PrintDeviceMemStats(); - - printf("Statistics:\n"); - if(m_Stats.GetAllocationCreationCount() > 0) - { - printf(" Total allocations created: %zu\n", m_Stats.GetAllocationCreationCount()); - } - - // Buffers - if(m_Stats.GetBufferCreationCount()) - { - printf(" Total buffers created: %zu\n", m_Stats.GetBufferCreationCount()); - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - printf(" Class 0 (indirect/vertex/index): %zu\n", m_Stats.GetBufferCreationCount(0)); - printf(" Class 1 (storage): %zu\n", m_Stats.GetBufferCreationCount(1)); - printf(" Class 2 (uniform): %zu\n", m_Stats.GetBufferCreationCount(2)); - printf(" Class 3 (other): %zu\n", m_Stats.GetBufferCreationCount(3)); - } - } - - // Images - const size_t imageCreationCount = - m_Stats.GetImageCreationCount(0) + - m_Stats.GetImageCreationCount(1) + - m_Stats.GetImageCreationCount(2) + - m_Stats.GetImageCreationCount(3) + - m_Stats.GetLinearImageCreationCount(); - if(imageCreationCount > 0) - { - printf(" Total images created: %zu\n", imageCreationCount); - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - printf(" Class 0 (depth/stencil): %zu\n", m_Stats.GetImageCreationCount(0)); - printf(" Class 1 (attachment): %zu\n", m_Stats.GetImageCreationCount(1)); - printf(" Class 2 (sampled): %zu\n", m_Stats.GetImageCreationCount(2)); - printf(" Class 3 (other): %zu\n", m_Stats.GetImageCreationCount(3)); - if(m_Stats.GetLinearImageCreationCount() > 0) - { - printf(" LINEAR tiling: %zu\n", m_Stats.GetLinearImageCreationCount()); - } - } - } - - if(m_Stats.GetPoolCreationCount() > 0) - { - printf(" Total custom pools created: %zu\n", m_Stats.GetPoolCreationCount()); - } - - float lastTime; - if(!m_LastLineTimeStr.empty() && StrRangeToFloat(StrRange(m_LastLineTimeStr), lastTime)) - { - std::string origTimeStr; - SecondsToFriendlyStr(lastTime, origTimeStr); - printf(" Original recording time: %s\n", origTimeStr.c_str()); - } - - // Thread statistics. - const size_t threadCount = m_Threads.size(); - if(threadCount > 1) - { - uint32_t threadCallCountMax = 0; - uint32_t threadCallCountSum = 0; - for(const auto& it : m_Threads) - { - threadCallCountMax = std::max(threadCallCountMax, it.second.callCount); - threadCallCountSum += it.second.callCount; - } - printf(" Threads making calls to VMA: %zu\n", threadCount); - printf(" %.2f%% calls from most active thread.\n", - (float)threadCallCountMax * 100.f / (float)threadCallCountSum); - } - else - { - printf(" VMA used from only one thread.\n"); - } - - // Function call count - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - printf(" Function call count:\n"); - const size_t* const functionCallCount = m_Stats.GetFunctionCallCount(); - for(size_t i = 0; i < (size_t)VMA_FUNCTION::Count; ++i) - { - if(functionCallCount[i] > 0) - { - printf(" %s %zu\n", VMA_FUNCTION_NAMES[i], functionCallCount[i]); - } - } - } - - // Detailed stats - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - m_Stats.PrintDetailedStats(); - } - - if(g_MemStatsEnabled) - { - m_Stats.PrintMemStats(); - } -} - -bool Player::ValidateFunctionParameterCount(size_t lineNumber, const CsvSplit& csvSplit, size_t expectedParamCount, bool lastUnbound) -{ - bool ok; - if(lastUnbound) - ok = csvSplit.GetCount() >= FIRST_PARAM_INDEX + expectedParamCount - 1; - else - ok = csvSplit.GetCount() == FIRST_PARAM_INDEX + expectedParamCount; - - if(!ok) - { - if(IssueWarning()) - { - printf("Line %zu: Incorrect number of function parameters.\n", lineNumber); - } - } - - return ok; -} - -bool Player::PrepareUserData(size_t lineNumber, uint32_t allocCreateFlags, const StrRange& userDataColumn, const StrRange& wholeLine, void*& outUserData) -{ - if(!g_UserDataEnabled) - { - outUserData = nullptr; - return true; - } - - // String - if((allocCreateFlags & VMA_ALLOCATION_CREATE_USER_DATA_COPY_STRING_BIT) != 0) - { - const size_t len = wholeLine.end - userDataColumn.beg; - m_UserDataTmpStr.resize(len + 1); - memcpy(m_UserDataTmpStr.data(), userDataColumn.beg, len); - m_UserDataTmpStr[len] = '\0'; - outUserData = m_UserDataTmpStr.data(); - return true; - } - // Pointer - else - { - uint64_t pUserData = 0; - if(StrRangeToPtr(userDataColumn, pUserData)) - { - outUserData = (void*)(uintptr_t)pUserData; - return true; - } - } - - if(IssueWarning()) - { - printf("Line %zu: Invalid pUserData.\n", lineNumber); - } - outUserData = 0; - return false; -} - -void Player::UpdateMemStats() -{ - if(!g_MemStatsEnabled) - { - return; - } - - VmaStats stats; - vmaCalculateStats(m_Allocator, &stats); - m_Stats.UpdateMemStats(stats); -} - -void Player::ExecuteCreatePool(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::CreatePool); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 7, false)) - { - VmaPoolCreateInfo poolCreateInfo = {}; - uint64_t origPtr = 0; - - if(StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX), poolCreateInfo.memoryTypeIndex) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), poolCreateInfo.flags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), poolCreateInfo.blockSize) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 3), poolCreateInfo.minBlockCount) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 4), poolCreateInfo.maxBlockCount) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 5), poolCreateInfo.frameInUseCount) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 6), origPtr)) - { - m_Stats.RegisterCreatePool(poolCreateInfo); - - Pool poolDesc = {}; - VkResult res = vmaCreatePool(m_Allocator, &poolCreateInfo, &poolDesc.pool); - - if(origPtr) - { - if(res == VK_SUCCESS) - { - // Originally succeeded, currently succeeded. - // Just save pointer (done below). - } - else - { - // Originally succeeded, currently failed. - // Print warning. Save null pointer. - if(IssueWarning()) - { - printf("Line %zu: vmaCreatePool failed (%d), while originally succeeded.\n", lineNumber, res); - } - } - - const auto existingIt = m_Pools.find(origPtr); - if(existingIt != m_Pools.end()) - { - if(IssueWarning()) - { - printf("Line %zu: Pool %llX already exists.\n", lineNumber, origPtr); - } - } - m_Pools[origPtr] = poolDesc; - } - else - { - if(res == VK_SUCCESS) - { - // Originally failed, currently succeeded. - // Print warning, destroy the pool. - if(IssueWarning()) - { - printf("Line %zu: vmaCreatePool succeeded, originally failed.\n", lineNumber); - } - - vmaDestroyPool(m_Allocator, poolDesc.pool); - } - else - { - // Originally failed, currently failed. - // Print warning. - if(IssueWarning()) - { - printf("Line %zu: vmaCreatePool failed (%d), originally also failed.\n", lineNumber, res); - } - } - } - - UpdateMemStats(); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaCreatePool.\n", lineNumber); - } - } - } -} - -void Player::ExecuteDestroyPool(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::DestroyPool); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origPtr = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - if(origPtr != 0) - { - const auto it = m_Pools.find(origPtr); - if(it != m_Pools.end()) - { - vmaDestroyPool(m_Allocator, it->second.pool); - UpdateMemStats(); - m_Pools.erase(it); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Pool %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaDestroyPool.\n", lineNumber); - } - } - } -} - -void Player::ExecuteSetAllocationUserData(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::SetAllocationUserData); - - if(!g_UserDataEnabled) - { - return; - } - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 2, true)) - { - uint64_t origPtr = 0; - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - const auto it = m_Allocations.find(origPtr); - if(it != m_Allocations.end()) - { - void* pUserData = nullptr; - if(csvSplit.GetCount() > FIRST_PARAM_INDEX + 1) - { - PrepareUserData( - lineNumber, - it->second.allocationFlags, - csvSplit.GetRange(FIRST_PARAM_INDEX + 1), - csvSplit.GetLine(), - pUserData); - } - - vmaSetAllocationUserData(m_Allocator, it->second.allocation, pUserData); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origPtr); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaSetAllocationUserData.\n", lineNumber); - } - } - } -} - -void Player::ExecuteCreateBuffer(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::CreateBuffer); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 12, true)) - { - VkBufferCreateInfo bufCreateInfo = { VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO }; - VmaAllocationCreateInfo allocCreateInfo = {}; - uint64_t origPool = 0; - uint64_t origPtr = 0; - - if(StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX), bufCreateInfo.flags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), bufCreateInfo.size) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), bufCreateInfo.usage) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 3), (uint32_t&)bufCreateInfo.sharingMode) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 4), allocCreateInfo.flags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 5), (uint32_t&)allocCreateInfo.usage) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 6), allocCreateInfo.requiredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 7), allocCreateInfo.preferredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 8), allocCreateInfo.memoryTypeBits) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 9), origPool) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 10), origPtr)) - { - FindPool(lineNumber, origPool, allocCreateInfo.pool); - - if(csvSplit.GetCount() > FIRST_PARAM_INDEX + 11) - { - PrepareUserData( - lineNumber, - allocCreateInfo.flags, - csvSplit.GetRange(FIRST_PARAM_INDEX + 11), - csvSplit.GetLine(), - allocCreateInfo.pUserData); - } - - m_Stats.RegisterCreateBuffer(bufCreateInfo); - m_Stats.RegisterCreateAllocation(allocCreateInfo); - - // Forcing VK_SHARING_MODE_EXCLUSIVE because we use only one queue anyway. - bufCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; - - Allocation allocDesc = { }; - allocDesc.allocationFlags = allocCreateInfo.flags; - VkResult res = vmaCreateBuffer(m_Allocator, &bufCreateInfo, &allocCreateInfo, &allocDesc.buffer, &allocDesc.allocation, nullptr); - UpdateMemStats(); - AddAllocation(lineNumber, origPtr, res, "vmaCreateBuffer", std::move(allocDesc)); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaCreateBuffer.\n", lineNumber); - } - } - } -} - -void Player::DestroyAllocation(size_t lineNumber, const CsvSplit& csvSplit, const char* functionName) -{ - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origAllocPtr = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origAllocPtr)) - { - if(origAllocPtr != 0) - { - const auto it = m_Allocations.find(origAllocPtr); - if(it != m_Allocations.end()) - { - Destroy(it->second); - UpdateMemStats(); - m_Allocations.erase(it); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origAllocPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for %s.\n", lineNumber, functionName); - } - } - } -} - -void Player::PrintStats(const VmaStats& stats, const char* suffix) -{ - printf(" VmaStats %s:\n", suffix); - printf(" total:\n"); - PrintStatInfo(stats.total); - - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - for(uint32_t i = 0; i < m_MemProps->memoryHeapCount; ++i) - { - printf(" memoryHeap[%u]:\n", i); - PrintStatInfo(stats.memoryHeap[i]); - } - for(uint32_t i = 0; i < m_MemProps->memoryTypeCount; ++i) - { - printf(" memoryType[%u]:\n", i); - PrintStatInfo(stats.memoryType[i]); - } - } -} - -void Player::PrintStatInfo(const VmaStatInfo& info) -{ - printf(" blockCount: %u\n", info.blockCount); - printf(" allocationCount: %u\n", info.allocationCount); - printf(" unusedRangeCount: %u\n", info.unusedRangeCount); - printf(" usedBytes: %llu\n", info.usedBytes); - printf(" unusedBytes: %llu\n", info.unusedBytes); - printf(" allocationSizeMin: %llu\n", info.allocationSizeMin); - printf(" allocationSizeAvg: %llu\n", info.allocationSizeAvg); - printf(" allocationSizeMax: %llu\n", info.allocationSizeMax); - printf(" unusedRangeSizeMin: %llu\n", info.unusedRangeSizeMin); - printf(" unusedRangeSizeAvg: %llu\n", info.unusedRangeSizeAvg); - printf(" unusedRangeSizeMax: %llu\n", info.unusedRangeSizeMax); -} - -void Player::ExecuteCreateImage(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::CreateImage); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 21, true)) - { - VkImageCreateInfo imageCreateInfo = { VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO }; - VmaAllocationCreateInfo allocCreateInfo = {}; - uint64_t origPool = 0; - uint64_t origPtr = 0; - - if(StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX), imageCreateInfo.flags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), (uint32_t&)imageCreateInfo.imageType) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), (uint32_t&)imageCreateInfo.format) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 3), imageCreateInfo.extent.width) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 4), imageCreateInfo.extent.height) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 5), imageCreateInfo.extent.depth) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 6), imageCreateInfo.mipLevels) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 7), imageCreateInfo.arrayLayers) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 8), (uint32_t&)imageCreateInfo.samples) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 9), (uint32_t&)imageCreateInfo.tiling) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 10), imageCreateInfo.usage) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 11), (uint32_t&)imageCreateInfo.sharingMode) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 12), (uint32_t&)imageCreateInfo.initialLayout) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 13), allocCreateInfo.flags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 14), (uint32_t&)allocCreateInfo.usage) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 15), allocCreateInfo.requiredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 16), allocCreateInfo.preferredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 17), allocCreateInfo.memoryTypeBits) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 18), origPool) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 19), origPtr)) - { - FindPool(lineNumber, origPool, allocCreateInfo.pool); - - if(csvSplit.GetCount() > FIRST_PARAM_INDEX + 20) - { - PrepareUserData( - lineNumber, - allocCreateInfo.flags, - csvSplit.GetRange(FIRST_PARAM_INDEX + 20), - csvSplit.GetLine(), - allocCreateInfo.pUserData); - } - - m_Stats.RegisterCreateImage(imageCreateInfo); - m_Stats.RegisterCreateAllocation(allocCreateInfo); - - // Forcing VK_SHARING_MODE_EXCLUSIVE because we use only one queue anyway. - imageCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE; - - Allocation allocDesc = {}; - allocDesc.allocationFlags = allocCreateInfo.flags; - VkResult res = vmaCreateImage(m_Allocator, &imageCreateInfo, &allocCreateInfo, &allocDesc.image, &allocDesc.allocation, nullptr); - UpdateMemStats(); - AddAllocation(lineNumber, origPtr, res, "vmaCreateImage", std::move(allocDesc)); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaCreateImage.\n", lineNumber); - } - } - } -} - -void Player::ExecuteFreeMemoryPages(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::FreeMemoryPages); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - std::vector<uint64_t> origAllocPtrs; - if(StrRangeToPtrList(csvSplit.GetRange(FIRST_PARAM_INDEX), origAllocPtrs)) - { - const size_t allocCount = origAllocPtrs.size(); - size_t notNullCount = 0; - for(size_t i = 0; i < allocCount; ++i) - { - const uint64_t origAllocPtr = origAllocPtrs[i]; - if(origAllocPtr != 0) - { - const auto it = m_Allocations.find(origAllocPtr); - if(it != m_Allocations.end()) - { - Destroy(it->second); - m_Allocations.erase(it); - ++notNullCount; - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origAllocPtr); - } - } - } - } - if(notNullCount) - { - UpdateMemStats(); - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaFreeMemoryPages.\n", lineNumber); - } - } - } -} - -void Player::ExecuteCreateLostAllocation(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::CreateLostAllocation); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origPtr = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - Allocation allocDesc = {}; - vmaCreateLostAllocation(m_Allocator, &allocDesc.allocation); - UpdateMemStats(); - m_Stats.RegisterCreateLostAllocation(); - - AddAllocation(lineNumber, origPtr, VK_SUCCESS, "vmaCreateLostAllocation", std::move(allocDesc)); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaCreateLostAllocation.\n", lineNumber); - } - } - } -} - -void Player::ExecuteAllocateMemory(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::AllocateMemory); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 11, true)) - { - VkMemoryRequirements memReq = {}; - VmaAllocationCreateInfo allocCreateInfo = {}; - uint64_t origPool = 0; - uint64_t origPtr = 0; - - if(StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX), memReq.size) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), memReq.alignment) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), memReq.memoryTypeBits) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 3), allocCreateInfo.flags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 4), (uint32_t&)allocCreateInfo.usage) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 5), allocCreateInfo.requiredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 6), allocCreateInfo.preferredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 7), allocCreateInfo.memoryTypeBits) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 8), origPool) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 9), origPtr)) - { - FindPool(lineNumber, origPool, allocCreateInfo.pool); - - if(csvSplit.GetCount() > FIRST_PARAM_INDEX + 10) - { - PrepareUserData( - lineNumber, - allocCreateInfo.flags, - csvSplit.GetRange(FIRST_PARAM_INDEX + 10), - csvSplit.GetLine(), - allocCreateInfo.pUserData); - } - - UpdateMemStats(); - m_Stats.RegisterCreateAllocation(allocCreateInfo); - - Allocation allocDesc = {}; - allocDesc.allocationFlags = allocCreateInfo.flags; - VkResult res = vmaAllocateMemory(m_Allocator, &memReq, &allocCreateInfo, &allocDesc.allocation, nullptr); - AddAllocation(lineNumber, origPtr, res, "vmaAllocateMemory", std::move(allocDesc)); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaAllocateMemory.\n", lineNumber); - } - } - } -} - -void Player::ExecuteAllocateMemoryPages(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::AllocateMemoryPages); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 11, true)) - { - VkMemoryRequirements memReq = {}; - VmaAllocationCreateInfo allocCreateInfo = {}; - uint64_t origPool = 0; - std::vector<uint64_t> origPtrs; - - if(StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX), memReq.size) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), memReq.alignment) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), memReq.memoryTypeBits) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 3), allocCreateInfo.flags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 4), (uint32_t&)allocCreateInfo.usage) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 5), allocCreateInfo.requiredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 6), allocCreateInfo.preferredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 7), allocCreateInfo.memoryTypeBits) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 8), origPool) && - StrRangeToPtrList(csvSplit.GetRange(FIRST_PARAM_INDEX + 9), origPtrs)) - { - const size_t allocCount = origPtrs.size(); - if(allocCount > 0) - { - FindPool(lineNumber, origPool, allocCreateInfo.pool); - - if(csvSplit.GetCount() > FIRST_PARAM_INDEX + 10) - { - PrepareUserData( - lineNumber, - allocCreateInfo.flags, - csvSplit.GetRange(FIRST_PARAM_INDEX + 10), - csvSplit.GetLine(), - allocCreateInfo.pUserData); - } - - UpdateMemStats(); - m_Stats.RegisterCreateAllocation(allocCreateInfo, allocCount); - m_Stats.RegisterAllocateMemoryPages(allocCount); - - std::vector<VmaAllocation> allocations(allocCount); - - VkResult res = vmaAllocateMemoryPages(m_Allocator, &memReq, &allocCreateInfo, allocCount, allocations.data(), nullptr); - for(size_t i = 0; i < allocCount; ++i) - { - Allocation allocDesc = {}; - allocDesc.allocationFlags = allocCreateInfo.flags; - allocDesc.allocation = allocations[i]; - AddAllocation(lineNumber, origPtrs[i], res, "vmaAllocateMemoryPages", std::move(allocDesc)); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaAllocateMemoryPages.\n", lineNumber); - } - } - } -} - -void Player::ExecuteAllocateMemoryForBufferOrImage(size_t lineNumber, const CsvSplit& csvSplit, OBJECT_TYPE objType) -{ - switch(objType) - { - case OBJECT_TYPE::BUFFER: - m_Stats.RegisterFunctionCall(VMA_FUNCTION::AllocateMemoryForBuffer); - break; - case OBJECT_TYPE::IMAGE: - m_Stats.RegisterFunctionCall(VMA_FUNCTION::AllocateMemoryForImage); - break; - default: assert(0); - } - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 13, true)) - { - VkMemoryRequirements memReq = {}; - VmaAllocationCreateInfo allocCreateInfo = {}; - bool requiresDedicatedAllocation = false; - bool prefersDedicatedAllocation = false; - uint64_t origPool = 0; - uint64_t origPtr = 0; - - if(StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX), memReq.size) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), memReq.alignment) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), memReq.memoryTypeBits) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 3), allocCreateInfo.flags) && - StrRangeToBool(csvSplit.GetRange(FIRST_PARAM_INDEX + 4), requiresDedicatedAllocation) && - StrRangeToBool(csvSplit.GetRange(FIRST_PARAM_INDEX + 5), prefersDedicatedAllocation) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 6), (uint32_t&)allocCreateInfo.usage) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 7), allocCreateInfo.requiredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 8), allocCreateInfo.preferredFlags) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 9), allocCreateInfo.memoryTypeBits) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 10), origPool) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 11), origPtr)) - { - FindPool(lineNumber, origPool, allocCreateInfo.pool); - - if(csvSplit.GetCount() > FIRST_PARAM_INDEX + 12) - { - PrepareUserData( - lineNumber, - allocCreateInfo.flags, - csvSplit.GetRange(FIRST_PARAM_INDEX + 12), - csvSplit.GetLine(), - allocCreateInfo.pUserData); - } - - UpdateMemStats(); - m_Stats.RegisterCreateAllocation(allocCreateInfo); - - if(requiresDedicatedAllocation || prefersDedicatedAllocation) - { - allocCreateInfo.flags |= VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT; - } - - if(!m_AllocateForBufferImageWarningIssued) - { - if(IssueWarning()) - { - printf("Line %zu: vmaAllocateMemoryForBuffer or vmaAllocateMemoryForImage cannot be replayed accurately. Using vmaCreateAllocation instead.\n", lineNumber); - } - m_AllocateForBufferImageWarningIssued = true; - } - - Allocation allocDesc = {}; - allocDesc.allocationFlags = allocCreateInfo.flags; - VkResult res = vmaAllocateMemory(m_Allocator, &memReq, &allocCreateInfo, &allocDesc.allocation, nullptr); - AddAllocation(lineNumber, origPtr, res, "vmaAllocateMemory (called as vmaAllocateMemoryForBuffer or vmaAllocateMemoryForImage)", std::move(allocDesc)); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaAllocateMemoryForBuffer or vmaAllocateMemoryForImage.\n", lineNumber); - } - } - } -} - -void Player::ExecuteMapMemory(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::MapMemory); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origPtr = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - if(origPtr != 0) - { - const auto it = m_Allocations.find(origPtr); - if(it != m_Allocations.end()) - { - if(it->second.allocation) - { - void* pData; - VkResult res = vmaMapMemory(m_Allocator, it->second.allocation, &pData); - if(res != VK_SUCCESS) - { - printf("Line %zu: vmaMapMemory failed (%d)\n", lineNumber, res); - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Cannot call vmaMapMemory - allocation is null.\n", lineNumber); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaMapMemory.\n", lineNumber); - } - } - } -} - -void Player::ExecuteUnmapMemory(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::UnmapMemory); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origPtr = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - if(origPtr != 0) - { - const auto it = m_Allocations.find(origPtr); - if(it != m_Allocations.end()) - { - if(it->second.allocation) - { - vmaUnmapMemory(m_Allocator, it->second.allocation); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Cannot call vmaUnmapMemory - allocation is null.\n", lineNumber); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaMapMemory.\n", lineNumber); - } - } - } -} - -void Player::ExecuteFlushAllocation(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::FlushAllocation); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 3, false)) - { - uint64_t origPtr = 0; - uint64_t offset = 0; - uint64_t size = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), offset) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), size)) - { - if(origPtr != 0) - { - const auto it = m_Allocations.find(origPtr); - if(it != m_Allocations.end()) - { - if(it->second.allocation) - { - vmaFlushAllocation(m_Allocator, it->second.allocation, offset, size); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Cannot call vmaFlushAllocation - allocation is null.\n", lineNumber); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaFlushAllocation.\n", lineNumber); - } - } - } -} - -void Player::ExecuteInvalidateAllocation(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::InvalidateAllocation); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 3, false)) - { - uint64_t origPtr = 0; - uint64_t offset = 0; - uint64_t size = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), offset) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), size)) - { - if(origPtr != 0) - { - const auto it = m_Allocations.find(origPtr); - if(it != m_Allocations.end()) - { - if(it->second.allocation) - { - vmaInvalidateAllocation(m_Allocator, it->second.allocation, offset, size); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Cannot call vmaInvalidateAllocation - allocation is null.\n", lineNumber); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaInvalidateAllocation.\n", lineNumber); - } - } - } -} - -void Player::ExecuteTouchAllocation(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::TouchAllocation); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origPtr = 0; - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - const auto it = m_Allocations.find(origPtr); - if(it != m_Allocations.end()) - { - if(it->second.allocation) - { - vmaTouchAllocation(m_Allocator, it->second.allocation); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Cannot call vmaTouchAllocation - allocation is null.\n", lineNumber); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origPtr); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaTouchAllocation.\n", lineNumber); - } - } - } -} - -void Player::ExecuteGetAllocationInfo(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::GetAllocationInfo); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origPtr = 0; - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - const auto it = m_Allocations.find(origPtr); - if(it != m_Allocations.end()) - { - if(it->second.allocation) - { - VmaAllocationInfo allocInfo; - vmaGetAllocationInfo(m_Allocator, it->second.allocation, &allocInfo); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Cannot call vmaGetAllocationInfo - allocation is null.\n", lineNumber); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origPtr); - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaGetAllocationInfo.\n", lineNumber); - } - } - } -} - -void Player::ExecuteMakePoolAllocationsLost(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::MakePoolAllocationsLost); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origPtr = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - if(origPtr != 0) - { - const auto it = m_Pools.find(origPtr); - if(it != m_Pools.end()) - { - vmaMakePoolAllocationsLost(m_Allocator, it->second.pool, nullptr); - UpdateMemStats(); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Pool %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaMakePoolAllocationsLost.\n", lineNumber); - } - } - } -} - -void Player::ExecuteResizeAllocation(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::ResizeAllocation); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 2, false)) - { - uint64_t origPtr = 0; - uint64_t newSize = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), newSize)) - { - if(origPtr != 0) - { - const auto it = m_Allocations.find(origPtr); - if(it != m_Allocations.end()) - { - // Do nothing - the function was deprecated and has been removed. - //vmaResizeAllocation(m_Allocator, it->second.allocation, newSize); - UpdateMemStats(); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Allocation %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaResizeAllocation.\n", lineNumber); - } - } - } -} - -void Player::ExecuteDefragmentationBegin(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::DefragmentationBegin); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 9, false)) - { - VmaDefragmentationInfo2 defragInfo = {}; - std::vector<uint64_t> allocationOrigPtrs; - std::vector<uint64_t> poolOrigPtrs; - uint64_t cmdBufOrigPtr = 0; - uint64_t defragCtxOrigPtr = 0; - - if(StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX), defragInfo.flags) && - StrRangeToPtrList(csvSplit.GetRange(FIRST_PARAM_INDEX + 1), allocationOrigPtrs) && - StrRangeToPtrList(csvSplit.GetRange(FIRST_PARAM_INDEX + 2), poolOrigPtrs) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 3), defragInfo.maxCpuBytesToMove) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 4), defragInfo.maxCpuAllocationsToMove) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 5), defragInfo.maxGpuBytesToMove) && - StrRangeToUint(csvSplit.GetRange(FIRST_PARAM_INDEX + 6), defragInfo.maxGpuAllocationsToMove) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 7), cmdBufOrigPtr) && - StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX + 8), defragCtxOrigPtr)) - { - const size_t allocationOrigPtrCount = allocationOrigPtrs.size(); - std::vector<VmaAllocation> allocations; - allocations.reserve(allocationOrigPtrCount); - for(size_t i = 0; i < allocationOrigPtrCount; ++i) - { - const auto it = m_Allocations.find(allocationOrigPtrs[i]); - if(it != m_Allocations.end() && it->second.allocation) - { - allocations.push_back(it->second.allocation); - } - } - if(!allocations.empty()) - { - defragInfo.allocationCount = (uint32_t)allocations.size(); - defragInfo.pAllocations = allocations.data(); - } - - const size_t poolOrigPtrCount = poolOrigPtrs.size(); - std::vector<VmaPool> pools; - pools.reserve(poolOrigPtrCount); - for(size_t i = 0; i < poolOrigPtrCount; ++i) - { - const auto it = m_Pools.find(poolOrigPtrs[i]); - if(it != m_Pools.end() && it->second.pool) - { - pools.push_back(it->second.pool); - } - } - if(!pools.empty()) - { - defragInfo.poolCount = (uint32_t)pools.size(); - defragInfo.pPools = pools.data(); - } - - if(allocations.size() != allocationOrigPtrCount || - pools.size() != poolOrigPtrCount) - { - if(IssueWarning()) - { - printf("Line %zu: Passing %zu allocations and %zu pools to vmaDefragmentationBegin, while originally %zu allocations and %zu pools were passed.\n", - lineNumber, - allocations.size(), pools.size(), - allocationOrigPtrCount, poolOrigPtrCount); - } - } - - if(cmdBufOrigPtr) - { - VkCommandBufferBeginInfo cmdBufBeginInfo = { VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO }; - cmdBufBeginInfo.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; - VkResult res = vkBeginCommandBuffer(m_CommandBuffer, &cmdBufBeginInfo); - if(res == VK_SUCCESS) - { - defragInfo.commandBuffer = m_CommandBuffer; - } - else - { - printf("Line %zu: vkBeginCommandBuffer failed (%d)\n", lineNumber, res); - } - } - - m_Stats.RegisterDefragmentation(defragInfo); - - VmaDefragmentationContext defragCtx = nullptr; - VkResult res = vmaDefragmentationBegin(m_Allocator, &defragInfo, nullptr, &defragCtx); - - if(defragInfo.commandBuffer) - { - vkEndCommandBuffer(m_CommandBuffer); - - VkSubmitInfo submitInfo = { VK_STRUCTURE_TYPE_SUBMIT_INFO }; - submitInfo.commandBufferCount = 1; - submitInfo.pCommandBuffers = &m_CommandBuffer; - vkQueueSubmit(m_TransferQueue, 1, &submitInfo, VK_NULL_HANDLE); - vkQueueWaitIdle(m_TransferQueue); - } - - if(res >= VK_SUCCESS) - { - if(defragCtx) - { - if(defragCtxOrigPtr) - { - // We have defragmentation context, originally had defragmentation context: Store it. - m_DefragmentationContexts[defragCtxOrigPtr] = defragCtx; - } - else - { - // We have defragmentation context, originally it was null: End immediately. - vmaDefragmentationEnd(m_Allocator, defragCtx); - } - } - else - { - if(defragCtxOrigPtr) - { - // We have no defragmentation context, originally there was one: Store null. - m_DefragmentationContexts[defragCtxOrigPtr] = nullptr; - } - else - { - // We have no defragmentation context, originally there wasn't as well - nothing to do. - } - } - } - else - { - if(defragCtxOrigPtr) - { - // Currently failed, originally succeeded. - if(IssueWarning()) - { - printf("Line %zu: vmaDefragmentationBegin failed (%d), while originally succeeded.\n", lineNumber, res); - } - } - else - { - // Currently failed, originally don't know. - if(IssueWarning()) - { - printf("Line %zu: vmaDefragmentationBegin failed (%d).\n", lineNumber, res); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaDefragmentationBegin.\n", lineNumber); - } - } - } -} - -void Player::ExecuteDefragmentationEnd(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::DefragmentationEnd); - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 1, false)) - { - uint64_t origPtr = 0; - - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - if(origPtr != 0) - { - const auto it = m_DefragmentationContexts.find(origPtr); - if(it != m_DefragmentationContexts.end()) - { - vmaDefragmentationEnd(m_Allocator, it->second); - m_DefragmentationContexts.erase(it); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Defragmentation context %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaDefragmentationEnd.\n", lineNumber); - } - } - } -} - -void Player::ExecuteSetPoolName(size_t lineNumber, const CsvSplit& csvSplit) -{ - m_Stats.RegisterFunctionCall(VMA_FUNCTION::SetPoolName); - - if(!g_UserDataEnabled) - { - return; - } - - if(ValidateFunctionParameterCount(lineNumber, csvSplit, 2, true)) - { - uint64_t origPtr = 0; - if(StrRangeToPtr(csvSplit.GetRange(FIRST_PARAM_INDEX), origPtr)) - { - if(origPtr != 0) - { - const auto it = m_Pools.find(origPtr); - if(it != m_Pools.end()) - { - std::string poolName; - csvSplit.GetRange(FIRST_PARAM_INDEX + 1).to_str(poolName); - vmaSetPoolName(m_Allocator, it->second.pool, !poolName.empty() ? poolName.c_str() : nullptr); - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Pool %llX not found.\n", lineNumber, origPtr); - } - } - } - } - else - { - if(IssueWarning()) - { - printf("Line %zu: Invalid parameters for vmaSetPoolName.\n", lineNumber); - } - } - } -} - -//////////////////////////////////////////////////////////////////////////////// -// Main functions - -static void PrintCommandLineSyntax() -{ - printf( - "Command line syntax:\n" - " VmaReplay [Options] <SrcFile.csv>\n" - "Available options:\n" - " -v <Number> - Verbosity level:\n" - " 0 - Minimum verbosity. Prints only warnings and errors.\n" - " 1 - Default verbosity. Prints important messages and statistics.\n" - " 2 - Maximum verbosity. Prints a lot of information.\n" - " -i <Number> - Repeat playback given number of times (iterations)\n" - " Default is 1. Vulkan is reinitialized with every iteration.\n" - " --MemStats <Value> - 0 to disable or 1 to enable memory statistics.\n" - " Default is 0. Enabling it may negatively impact playback performance.\n" - " --DumpStatsAfterLine <Line> - Dump VMA statistics to JSON file after specified source file line finishes execution.\n" - " File is written to current directory with name: VmaReplay_Line####.json.\n" - " This parameter can be repeated.\n" - " --DumpDetailedStatsAfterLine <Line> - Like command above, but includes detailed map.\n" - " --DefragmentAfterLine <Line> - Defragment memory after specified source file line and print statistics.\n" - " It also prints detailed statistics to files VmaReplay_Line####_Defragment*.json\n" - " --DefragmentationFlags <Flags> - Flags to be applied when using DefragmentAfterLine.\n" - " --Lines <Ranges> - Replay only limited set of lines from file\n" - " Ranges is comma-separated list of ranges, e.g. \"-10,15,18-25,31-\".\n" - " --PhysicalDevice <Index> - Choice of Vulkan physical device. Default: 0.\n" - " --UserData <Value> - 0 to disable or 1 to enable setting pUserData during playback.\n" - " Default is 1. Affects both creation of buffers and images, as well as calls to vmaSetAllocationUserData.\n" - " --VK_LAYER_KHRONOS_validation <Value> - 0 to disable or 1 to enable validation layers.\n" - " By default the layers are silently enabled if available.\n" - " --VK_EXT_memory_budget <Value> - 0 to disable or 1 to enable this extension.\n" - " By default the extension is silently enabled if available.\n" - ); -} - -static int ProcessFile(size_t iterationIndex, const char* data, size_t numBytes, duration& outDuration) -{ - outDuration = duration::max(); - - const bool useLineRanges = !g_LineRanges.IsEmpty(); - const bool useDumpStatsAfterLine = !g_DumpStatsAfterLine.empty(); - const bool useDefragmentAfterLine = !g_DefragmentAfterLine.empty(); - - LineSplit lineSplit(data, numBytes); - StrRange line; - - if(!lineSplit.GetNextLine(line) || - !StrRangeEq(line, "Vulkan Memory Allocator,Calls recording")) - { - printf("ERROR: Incorrect file format.\n"); - return RESULT_ERROR_FORMAT; - } - - if(!lineSplit.GetNextLine(line) || !ParseFileVersion(line) || !ValidateFileVersion()) - { - printf("ERROR: Incorrect file format version.\n"); - return RESULT_ERROR_FORMAT; - } - - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - printf("Format version: %u,%u\n", - GetVersionMajor(g_FileVersion), - GetVersionMinor(g_FileVersion)); - } - - // Parse configuration - const bool configEnabled = g_FileVersion >= MakeVersion(1, 3); - ConfigurationParser configParser; - if(configEnabled) - { - if(!configParser.Parse(lineSplit)) - { - return RESULT_ERROR_FORMAT; - } - } - - Player player; - int result = player.Init(); - - if(configEnabled) - { - player.ApplyConfig(configParser); - } - - size_t executedLineCount = 0; - if(result == 0) - { - if(g_Verbosity > VERBOSITY::MINIMUM) - { - if(useLineRanges) - { - printf("Playing #%zu (limited range of lines)...\n", iterationIndex + 1); - } - else - { - printf("Playing #%zu...\n", iterationIndex + 1); - } - } - - const time_point timeBeg = std::chrono::high_resolution_clock::now(); - - while(lineSplit.GetNextLine(line)) - { - const size_t currLineNumber = lineSplit.GetNextLineIndex(); - - bool execute = true; - if(useLineRanges) - { - execute = g_LineRanges.Includes(currLineNumber); - } - - if(execute) - { - player.ExecuteLine(currLineNumber, line); - ++executedLineCount; - } - - while(useDumpStatsAfterLine && - g_DumpStatsAfterLineNextIndex < g_DumpStatsAfterLine.size() && - currLineNumber >= g_DumpStatsAfterLine[g_DumpStatsAfterLineNextIndex].line) - { - const size_t requestedLine = g_DumpStatsAfterLine[g_DumpStatsAfterLineNextIndex].line; - const bool detailed = g_DumpStatsAfterLine[g_DumpStatsAfterLineNextIndex].detailed; - - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - printf("Dumping %sstats after line %zu actual line %zu...\n", - detailed ? "detailed " : "", - requestedLine, - currLineNumber); - } - - player.DumpStats("VmaReplay_Line%04zu.json", requestedLine, detailed); - - ++g_DumpStatsAfterLineNextIndex; - } - - while(useDefragmentAfterLine && - g_DefragmentAfterLineNextIndex < g_DefragmentAfterLine.size() && - currLineNumber >= g_DefragmentAfterLine[g_DefragmentAfterLineNextIndex]) - { - const size_t requestedLine = g_DefragmentAfterLine[g_DefragmentAfterLineNextIndex]; - if(g_Verbosity >= VERBOSITY::DEFAULT) - { - printf("Defragmenting after line %zu actual line %zu...\n", - requestedLine, - currLineNumber); - } - - player.DumpStats("VmaReplay_Line%04zu_Defragment_1Before.json", requestedLine, true); - player.Defragment(); - player.DumpStats("VmaReplay_Line%04zu_Defragment_2After.json", requestedLine, true); - - ++g_DefragmentAfterLineNextIndex; - } - } - - const duration playDuration = std::chrono::high_resolution_clock::now() - timeBeg; - outDuration = playDuration; - - // End stats. - if(g_Verbosity > VERBOSITY::MINIMUM) - { - std::string playDurationStr; - SecondsToFriendlyStr(ToFloatSeconds(playDuration), playDurationStr); - - printf("Done.\n"); - printf("Playback took: %s\n", playDurationStr.c_str()); - } - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - printf("File lines: %zu\n", lineSplit.GetNextLineIndex()); - printf("Executed %zu file lines\n", executedLineCount); - } - - player.PrintStats(); - } - - return result; -} - -static int ProcessFile() -{ - if(g_Verbosity > VERBOSITY::MINIMUM) - { - printf("Loading file \"%s\"...\n", g_FilePath.c_str()); - } - int result = 0; - - FILE* file = nullptr; - const errno_t err = fopen_s(&file, g_FilePath.c_str(), "rb"); - if(err == 0) - { - _fseeki64(file, 0, SEEK_END); - const size_t fileSize = (size_t)_ftelli64(file); - _fseeki64(file, 0, SEEK_SET); - - if(fileSize > 0) - { - std::vector<char> fileContents(fileSize); - fread(fileContents.data(), 1, fileSize, file); - - // Begin stats. - if(g_Verbosity == VERBOSITY::MAXIMUM) - { - printf("File size: %zu B\n", fileSize); - } - - duration durationSum = duration::zero(); - for(size_t i = 0; i < g_IterationCount; ++i) - { - duration currDuration; - ProcessFile(i, fileContents.data(), fileContents.size(), currDuration); - durationSum += currDuration; - } - - if(g_IterationCount > 1) - { - std::string playDurationStr; - SecondsToFriendlyStr(ToFloatSeconds(durationSum / g_IterationCount), playDurationStr); - printf("Average playback time from %zu iterations: %s\n", g_IterationCount, playDurationStr.c_str()); - } - } - else - { - printf("ERROR: Source file is empty.\n"); - result = RESULT_ERROR_SOURCE_FILE; - } - - fclose(file); - } - else - { - printf("ERROR: Couldn't open file (%i).\n", err); - result = RESULT_ERROR_SOURCE_FILE; - } - - return result; -} - -static int main2(int argc, char** argv) -{ - CmdLineParser cmdLineParser(argc, argv); - - cmdLineParser.RegisterOpt(CMD_LINE_OPT_VERBOSITY, 'v', true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_ITERATIONS, 'i', true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_LINES, "Lines", true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_PHYSICAL_DEVICE, "PhysicalDevice", true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_USER_DATA, "UserData", true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_VK_EXT_MEMORY_BUDGET, "VK_EXT_memory_budget", true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_VK_LAYER_KHRONOS_VALIDATION, VALIDATION_LAYER_NAME, true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_MEM_STATS, "MemStats", true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_DUMP_STATS_AFTER_LINE, "DumpStatsAfterLine", true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_DEFRAGMENT_AFTER_LINE, "DefragmentAfterLine", true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_DEFRAGMENTATION_FLAGS, "DefragmentationFlags", true); - cmdLineParser.RegisterOpt(CMD_LINE_OPT_DUMP_DETAILED_STATS_AFTER_LINE, "DumpDetailedStatsAfterLine", true); - - CmdLineParser::RESULT res; - while((res = cmdLineParser.ReadNext()) != CmdLineParser::RESULT_END) - { - switch(res) - { - case CmdLineParser::RESULT_OPT: - switch(cmdLineParser.GetOptId()) - { - case CMD_LINE_OPT_VERBOSITY: - { - uint32_t verbosityVal = UINT32_MAX; - if(StrRangeToUint(StrRange(cmdLineParser.GetParameter()), verbosityVal) && - verbosityVal < (uint32_t)VERBOSITY::COUNT) - { - g_Verbosity = (VERBOSITY)verbosityVal; - } - else - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - } - break; - case CMD_LINE_OPT_ITERATIONS: - if(!StrRangeToUint(StrRange(cmdLineParser.GetParameter()), g_IterationCount)) - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - break; - case CMD_LINE_OPT_LINES: - if(!g_LineRanges.Parse(StrRange(cmdLineParser.GetParameter()))) - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - break; - case CMD_LINE_OPT_PHYSICAL_DEVICE: - if(!StrRangeToUint(StrRange(cmdLineParser.GetParameter()), g_PhysicalDeviceIndex)) - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - break; - case CMD_LINE_OPT_USER_DATA: - if(!StrRangeToBool(StrRange(cmdLineParser.GetParameter()), g_UserDataEnabled)) - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - break; - case CMD_LINE_OPT_VK_EXT_MEMORY_BUDGET: - { - bool newValue; - if(StrRangeToBool(StrRange(cmdLineParser.GetParameter()), newValue)) - { - g_VK_EXT_memory_budget_request = newValue ? - VULKAN_EXTENSION_REQUEST::ENABLED : - VULKAN_EXTENSION_REQUEST::DISABLED; - } - else - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - } - break; - case CMD_LINE_OPT_VK_LAYER_KHRONOS_VALIDATION: - { - bool newValue; - if(StrRangeToBool(StrRange(cmdLineParser.GetParameter()), newValue)) - { - g_VK_LAYER_KHRONOS_validation = newValue ? - VULKAN_EXTENSION_REQUEST::ENABLED : - VULKAN_EXTENSION_REQUEST::DISABLED; - } - else - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - } - break; - case CMD_LINE_OPT_MEM_STATS: - if(!StrRangeToBool(StrRange(cmdLineParser.GetParameter()), g_MemStatsEnabled)) - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - break; - case CMD_LINE_OPT_DUMP_STATS_AFTER_LINE: - case CMD_LINE_OPT_DUMP_DETAILED_STATS_AFTER_LINE: - { - size_t line; - if(StrRangeToUint(StrRange(cmdLineParser.GetParameter()), line)) - { - const bool detailed = - cmdLineParser.GetOptId() == CMD_LINE_OPT_DUMP_DETAILED_STATS_AFTER_LINE; - g_DumpStatsAfterLine.push_back({line, detailed}); - } - else - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - } - break; - case CMD_LINE_OPT_DEFRAGMENT_AFTER_LINE: - { - size_t line; - if(StrRangeToUint(StrRange(cmdLineParser.GetParameter()), line)) - { - g_DefragmentAfterLine.push_back(line); - } - else - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - } - break; - case CMD_LINE_OPT_DEFRAGMENTATION_FLAGS: - { - if(!StrRangeToUint(StrRange(cmdLineParser.GetParameter()), g_DefragmentationFlags)) - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - } - break; - default: - assert(0); - } - break; - case CmdLineParser::RESULT_PARAMETER: - if(g_FilePath.empty()) - { - g_FilePath = cmdLineParser.GetParameter(); - } - else - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - break; - case CmdLineParser::RESULT_ERROR: - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - break; - default: - assert(0); - } - } - - // Postprocess command line parameters. - - if(g_FilePath.empty()) - { - PrintCommandLineSyntax(); - return RESULT_ERROR_COMMAND_LINE; - } - - // Sort g_DumpStatsAfterLine and make unique. - std::sort(g_DumpStatsAfterLine.begin(), g_DumpStatsAfterLine.end()); - g_DumpStatsAfterLine.erase( - std::unique(g_DumpStatsAfterLine.begin(), g_DumpStatsAfterLine.end()), - g_DumpStatsAfterLine.end()); - - // Sort g_DefragmentAfterLine and make unique. - std::sort(g_DefragmentAfterLine.begin(), g_DefragmentAfterLine.end()); - g_DefragmentAfterLine.erase( - std::unique(g_DefragmentAfterLine.begin(), g_DefragmentAfterLine.end()), - g_DefragmentAfterLine.end()); - - return ProcessFile(); -} - -int main(int argc, char** argv) -{ - try - { - return main2(argc, argv); - } - catch(const std::exception& e) - { - printf("ERROR: %s\n", e.what()); - return RESULT_EXCEPTION; - } - catch(...) - { - printf("UNKNOWN ERROR\n"); - return RESULT_EXCEPTION; - } -} diff --git a/src/VmaReplay/VmaUsage.cpp b/src/VmaReplay/VmaUsage.cpp deleted file mode 100644 index c4a6db2..0000000 --- a/src/VmaReplay/VmaUsage.cpp +++ /dev/null @@ -1,24 +0,0 @@ -// -// Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#define VMA_IMPLEMENTATION -#include "VmaUsage.h" diff --git a/src/VmaReplay/VmaUsage.h b/src/VmaReplay/VmaUsage.h deleted file mode 100644 index 68d30c1..0000000 --- a/src/VmaReplay/VmaUsage.h +++ /dev/null @@ -1,50 +0,0 @@ -// -// Copyright (c) 2017-2021 Advanced Micro Devices, Inc. All rights reserved. -// -// Permission is hereby granted, free of charge, to any person obtaining a copy -// of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights -// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the Software is -// furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -// THE SOFTWARE. -// - -#pragma once - -#define NOMINMAX -#define WIN32_LEAN_AND_MEAN -#include <Windows.h> - -#if !defined(VK_USE_PLATFORM_WIN32_KHR) - #define VK_USE_PLATFORM_WIN32_KHR -#endif // #if !defined(VK_USE_PLATFORM_WIN32_KHR) -#include <vulkan/vulkan.h> - -//#define VMA_HEAVY_ASSERT(expr) assert(expr) - -//#define VMA_DEDICATED_ALLOCATION 0 - -//#define VMA_DEBUG_MARGIN 16 -//#define VMA_DEBUG_DETECT_CORRUPTION 1 -//#define VMA_DEBUG_INITIALIZE_ALLOCATIONS 1 - -#pragma warning(push, 4) -#pragma warning(disable: 4127) // conditional expression is constant -#pragma warning(disable: 4100) // unreferenced formal parameter -#pragma warning(disable: 4189) // local variable is initialized but not referenced -#pragma warning(disable: 4324) // structure was padded due to alignment specifier - -#include "../../include/vk_mem_alloc.h" - -#pragma warning(pop)