mirror of
https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator.git
synced 2024-11-26 16:34:35 +00:00
Merge branch 'development' into linear_allocator
This commit is contained in:
commit
0c6ca87695
@ -51,6 +51,7 @@ Additional features:
|
||||
- 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.
|
||||
|
||||
# Prequisites
|
||||
|
||||
|
BIN
bin/VmaReplay_Release_vs2015.exe
Normal file
BIN
bin/VmaReplay_Release_vs2015.exe
Normal file
Binary file not shown.
Binary file not shown.
287
docs/Recording file format.md
Normal file
287
docs/Recording file format.md
Normal file
@ -0,0 +1,287 @@
|
||||
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,3
|
||||
|
||||
# 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:
|
||||
|
||||
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>
|
||||
|
||||
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
|
||||
|
||||
**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)
|
||||
|
||||
**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
|
||||
|
||||
# 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.
|
||||
|
||||
# Example file
|
||||
|
||||
Vulkan Memory Allocator,Calls recording
|
||||
1,3
|
||||
Config,Begin
|
||||
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
|
||||
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
|
@ -75,9 +75,10 @@ $(function() {
|
||||
<tr id="row_8_" 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_9_"><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_10_" 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_11_"><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_12_" 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_13_"><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_11_"><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_12_" 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_13_"><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_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_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 -->
|
||||
|
@ -65,10 +65,10 @@ $(function() {
|
||||
<div class="qindex"><a class="qindex" href="#letter_v">v</a></div>
|
||||
<table class="classindex">
|
||||
<tr><td rowspan="2" valign="bottom"><a name="letter_v"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">  v  </div></td></tr></table>
|
||||
</td><td valign="top"><a class="el" href="struct_vma_allocation_info.html">VmaAllocationInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_defragmentation_stats.html">VmaDefragmentationStats</a>   </td><td valign="top"><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a>   </td><td></td></tr>
|
||||
<tr><td valign="top"><a class="el" href="struct_vma_allocator.html">VmaAllocator</a>   </td><td valign="top"><a class="el" href="struct_vma_device_memory_callbacks.html">VmaDeviceMemoryCallbacks</a>   </td><td valign="top"><a class="el" href="struct_vma_stat_info.html">VmaStatInfo</a>   </td><td></td></tr>
|
||||
<tr><td valign="top"><a class="el" href="struct_vma_allocation.html">VmaAllocation</a>   </td><td valign="top"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_pool.html">VmaPool</a>   </td><td valign="top"><a class="el" href="struct_vma_stats.html">VmaStats</a>   </td><td></td></tr>
|
||||
<tr><td valign="top"><a class="el" href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_defragmentation_info.html">VmaDefragmentationInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_vulkan_functions.html">VmaVulkanFunctions</a>   </td><td></td></tr>
|
||||
</td><td valign="top"><a class="el" href="struct_vma_allocation_info.html">VmaAllocationInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_defragmentation_stats.html">VmaDefragmentationStats</a>   </td><td valign="top"><a class="el" href="struct_vma_pool_stats.html">VmaPoolStats</a>   </td><td valign="top"><a class="el" href="struct_vma_vulkan_functions.html">VmaVulkanFunctions</a>   </td></tr>
|
||||
<tr><td valign="top"><a class="el" href="struct_vma_allocator.html">VmaAllocator</a>   </td><td valign="top"><a class="el" href="struct_vma_device_memory_callbacks.html">VmaDeviceMemoryCallbacks</a>   </td><td valign="top"><a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a>   </td><td></td></tr>
|
||||
<tr><td valign="top"><a class="el" href="struct_vma_allocation.html">VmaAllocation</a>   </td><td valign="top"><a class="el" href="struct_vma_allocator_create_info.html">VmaAllocatorCreateInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_pool.html">VmaPool</a>   </td><td valign="top"><a class="el" href="struct_vma_stat_info.html">VmaStatInfo</a>   </td><td></td></tr>
|
||||
<tr><td valign="top"><a class="el" href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_defragmentation_info.html">VmaDefragmentationInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_pool_create_info.html">VmaPoolCreateInfo</a>   </td><td valign="top"><a class="el" href="struct_vma_stats.html">VmaStats</a>   </td><td></td></tr>
|
||||
<tr><td></td><td></td><td></td><td></td><td></td></tr>
|
||||
</table>
|
||||
<div class="qindex"><a class="qindex" href="#letter_v">v</a></div>
|
||||
|
@ -114,6 +114,7 @@ $(function() {
|
||||
: <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_pool_create_info.html#a8405139f63d078340ae74513a59f5446">VmaPoolCreateInfo</a>
|
||||
, <a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a">VmaRecordSettings</a>
|
||||
</li>
|
||||
<li>frameInUseCount
|
||||
: <a class="el" href="struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7">VmaAllocatorCreateInfo</a>
|
||||
@ -165,6 +166,9 @@ $(function() {
|
||||
<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>
|
||||
@ -183,6 +187,9 @@ $(function() {
|
||||
<li>pool
|
||||
: <a class="el" href="struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150">VmaAllocationCreateInfo</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>
|
||||
|
@ -114,6 +114,7 @@ $(function() {
|
||||
: <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_pool_create_info.html#a8405139f63d078340ae74513a59f5446">VmaPoolCreateInfo</a>
|
||||
, <a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a">VmaRecordSettings</a>
|
||||
</li>
|
||||
<li>frameInUseCount
|
||||
: <a class="el" href="struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7">VmaAllocatorCreateInfo</a>
|
||||
@ -165,6 +166,9 @@ $(function() {
|
||||
<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>
|
||||
@ -183,6 +187,9 @@ $(function() {
|
||||
<li>pool
|
||||
: <a class="el" href="struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150">VmaAllocationCreateInfo</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>
|
||||
|
@ -74,6 +74,23 @@ Thread safety</h1>
|
||||
<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>
|
||||
</ul>
|
||||
<h1><a class="anchor" id="general_considerations_validation_layer_warnings"></a>
|
||||
Validation layer warnings</h1>
|
||||
<p>When using this library, you can meet following types of warnings issued by Vulkan validation layer. They don't necessarily indicate a bug, so you may need to just ignore them.</p>
|
||||
<ul>
|
||||
<li><em>vkBindBufferMemory(): Binding memory to buffer 0xeb8e4 but vkGetBufferMemoryRequirements() has not been called on that buffer.</em><ul>
|
||||
<li>It happens when VK_KHR_dedicated_allocation extension is enabled. <code>vkGetBufferMemoryRequirements2KHR</code> function is used instead, while validation layer seems to be unaware of it.</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li><em>Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used.</em><ul>
|
||||
<li>It happens when you map a buffer or image, because the library maps entire <code>VkDeviceMemory</code> block, where different types of images and buffers may end up together, especially on GPUs with unified memory like Intel.</li>
|
||||
</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 bacame lost.</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<h1><a class="anchor" id="general_considerations_allocation_algorithm"></a>
|
||||
Allocation algorithm</h1>
|
||||
<p>The library uses following algorithm for allocation, in order:</p>
|
||||
@ -90,7 +107,7 @@ Allocation algorithm</h1>
|
||||
Features not supported</h1>
|
||||
<p>Features deliberately excluded from the scope of this library:</p>
|
||||
<ul>
|
||||
<li>Data transfer - issuing commands that transfer data between buffers or images, any usage of <code>VkCommandList</code> or <code>VkCommandQueue</code> and related synchronization is responsibility of the user.</li>
|
||||
<li>Data transfer - issuing commands that transfer data between buffers or images, any usage of <code>VkCommandList</code> or <code>VkQueue</code> and related synchronization is responsibility of the user.</li>
|
||||
<li>Allocations for imported/exported external memory. They tend to require explicit memory type index and dedicated allocation anyway, so they don't interact with main features of this library. Such special purpose allocations should be made manually, using <code>vkCreateBuffer()</code> and <code>vkAllocateMemory()</code>.</li>
|
||||
<li>Support for any programming languages other than C/C++. Bindings to other languages are welcomed as external projects. </li>
|
||||
</ul>
|
||||
|
@ -128,6 +128,15 @@ $(function() {
|
||||
<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_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>
|
||||
@ -275,6 +284,15 @@ $(function() {
|
||||
<li>VmaPoolStats
|
||||
: <a class="el" href="vk__mem__alloc_8h.html#a2e5612d871d64c5624087b837a338c34">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#a0ab61e87ff6365f1d59915eadc37a9f0">vk_mem_alloc.h</a>
|
||||
</li>
|
||||
<li>vmaSetAllocationUserData()
|
||||
: <a class="el" href="vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f">vk_mem_alloc.h</a>
|
||||
</li>
|
||||
|
@ -62,6 +62,9 @@ $(function() {
|
||||
<li>VMA_DEDICATED_ALLOCATION
|
||||
: <a class="el" href="vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4">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>
|
||||
|
@ -71,6 +71,9 @@ $(function() {
|
||||
<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>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
|
@ -113,6 +113,12 @@ $(function() {
|
||||
<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_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>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
|
@ -110,6 +110,15 @@ $(function() {
|
||||
<li>VmaPoolStats
|
||||
: <a class="el" href="vk__mem__alloc_8h.html#a2e5612d871d64c5624087b837a338c34">vk_mem_alloc.h</a>
|
||||
</li>
|
||||
<li>VmaRecordFlagBits
|
||||
: <a class="el" href="vk__mem__alloc_8h.html#ade20b626a6635ce1bf30ea53dea774e4">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#a0ab61e87ff6365f1d59915eadc37a9f0">vk_mem_alloc.h</a>
|
||||
</li>
|
||||
<li>VmaStatInfo
|
||||
: <a class="el" href="vk__mem__alloc_8h.html#a810b009a788ee8aac72a25b42ffbe31c">vk_mem_alloc.h</a>
|
||||
</li>
|
||||
|
@ -112,6 +112,7 @@ 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>
|
||||
</ul>
|
||||
</li>
|
||||
<li><a class="el" href="usage_patterns.html">Recommended usage patterns</a><ul>
|
||||
|
@ -69,8 +69,11 @@ $(function() {
|
||||
<div class="textblock"><p>To "map memory" in Vulkan means to obtain a CPU pointer to <code>VkDeviceMemory</code>, to be able to read from it or write to it in CPU code. Mapping is possible only of memory allocated from a memory type that has <code>VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT</code> flag. Functions <code>vkMapMemory()</code>, <code>vkUnmapMemory()</code> are designed for this purpose. You can use them directly with memory allocated by this library, but it is not recommended because of following issue: Mapping the same <code>VkDeviceMemory</code> block multiple times is illegal - only one mapping at a time is allowed. This includes mapping disjoint regions. Mapping is not reference-counted internally by Vulkan. Because of this, Vulkan Memory Allocator provides following facilities:</p>
|
||||
<h1><a class="anchor" id="memory_mapping_mapping_functions"></a>
|
||||
Mapping functions</h1>
|
||||
<p>The library provides following functions for mapping of a specific <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation. ">VmaAllocation</a>: <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#a9bc268595cb33f6ec4d519cfce81ff45" title="Unmaps memory represented by given allocation, mapped previously using vmaMapMemory(). ">vmaUnmapMemory()</a>. They are safer and more convenient to use than standard Vulkan functions. You can map an allocation multiple times simultaneously - mapping is reference-counted internally. You can also map different allocations simultaneously regardless of whether they use the same <code>VkDeviceMemory</code> block. They way it's implemented is that the library always maps entire memory block, not just region of the allocation. For further details, see description of <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069" title="Maps memory represented by given allocation and returns pointer to it. ">vmaMapMemory()</a> function. Example:</p>
|
||||
<div class="fragment"><div class="line"><span class="comment">// Having these objects initialized:</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>ConstantBuffer</div><div class="line">{</div><div class="line"> ...</div><div class="line">};</div><div class="line">ConstantBuffer constantBufferData;</div><div class="line"></div><div class="line"><a class="code" href="struct_vma_allocator.html">VmaAllocator</a> allocator;</div><div class="line">VmaBuffer constantBuffer;</div><div class="line"><a class="code" href="struct_vma_allocation.html">VmaAllocation</a> constantBufferAllocation;</div><div class="line"></div><div class="line"><span class="comment">// You can map and fill your buffer using following code:</span></div><div class="line"></div><div class="line"><span class="keywordtype">void</span>* mappedData;</div><div class="line"><a class="code" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069">vmaMapMemory</a>(allocator, constantBufferAllocation, &mappedData);</div><div class="line">memcpy(mappedData, &constantBufferData, <span class="keyword">sizeof</span>(constantBufferData));</div><div class="line"><a class="code" href="vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45">vmaUnmapMemory</a>(allocator, constantBufferAllocation);</div></div><!-- fragment --><h1><a class="anchor" id="memory_mapping_persistently_mapped_memory"></a>
|
||||
<p>The library provides following functions for mapping of a specific <a class="el" href="struct_vma_allocation.html" title="Represents single memory allocation. ">VmaAllocation</a>: <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#a9bc268595cb33f6ec4d519cfce81ff45" title="Unmaps memory represented by given allocation, mapped previously using vmaMapMemory(). ">vmaUnmapMemory()</a>. They are safer and more convenient to use than standard Vulkan functions. You can map an allocation multiple times simultaneously - mapping is reference-counted internally. You can also map different allocations simultaneously regardless of whether they use the same <code>VkDeviceMemory</code> block. The way it's implemented is that the library always maps entire memory block, not just region of the allocation. For further details, see description of <a class="el" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069" title="Maps memory represented by given allocation and returns pointer to it. ">vmaMapMemory()</a> function. Example:</p>
|
||||
<div class="fragment"><div class="line"><span class="comment">// Having these objects initialized:</span></div><div class="line"></div><div class="line"><span class="keyword">struct </span>ConstantBuffer</div><div class="line">{</div><div class="line"> ...</div><div class="line">};</div><div class="line">ConstantBuffer constantBufferData;</div><div class="line"></div><div class="line"><a class="code" href="struct_vma_allocator.html">VmaAllocator</a> allocator;</div><div class="line">VkBuffer constantBuffer;</div><div class="line"><a class="code" href="struct_vma_allocation.html">VmaAllocation</a> constantBufferAllocation;</div><div class="line"></div><div class="line"><span class="comment">// You can map and fill your buffer using following code:</span></div><div class="line"></div><div class="line"><span class="keywordtype">void</span>* mappedData;</div><div class="line"><a class="code" href="vk__mem__alloc_8h.html#ad5bd1243512d099706de88168992f069">vmaMapMemory</a>(allocator, constantBufferAllocation, &mappedData);</div><div class="line">memcpy(mappedData, &constantBufferData, <span class="keyword">sizeof</span>(constantBufferData));</div><div class="line"><a class="code" href="vk__mem__alloc_8h.html#a9bc268595cb33f6ec4d519cfce81ff45">vmaUnmapMemory</a>(allocator, constantBufferAllocation);</div></div><!-- fragment --><p>When mapping, you may see a warning from Vulkan validation layer similar to this one:</p>
|
||||
<p><em>Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used.</em></p>
|
||||
<p>It happens because the library maps entire <code>VkDeviceMemory</code> block, where different types of images and buffers may end up together, especially on GPUs with unified memory like Intel. You can safely ignore it if you are sure you access only memory of the intended object that you wanted to map.</p>
|
||||
<h1><a class="anchor" id="memory_mapping_persistently_mapped_memory"></a>
|
||||
Persistently mapped memory</h1>
|
||||
<p>Kepping your memory persistently mapped is generally OK in Vulkan. You don't need to unmap it before using its data on the GPU. The library provides a special feature designed for that: Allocations made with <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 set in <a class="el" href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b" title="Use VmaAllocationCreateFlagBits enum. ">VmaAllocationCreateInfo::flags</a> stay mapped all the time, so you can just access CPU pointer to it any time without a need to call any "map" or "unmap" function. Example:</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><div class="line">bufCreateInfo.usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT;</div><div class="line"></div><div class="line"><a class="code" href="struct_vma_allocation_create_info.html">VmaAllocationCreateInfo</a> allocCreateInfo = {};</div><div class="line">allocCreateInfo.<a class="code" href="struct_vma_allocation_create_info.html#accb8b06b1f677d858cb9af20705fa910">usage</a> = <a class="code" href="vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca40bdf4cddeffeb12f43d45ca1286e0a5">VMA_MEMORY_USAGE_CPU_ONLY</a>;</div><div class="line">allocCreateInfo.<a class="code" href="struct_vma_allocation_create_info.html#add09658ac14fe290ace25470ddd6d41b">flags</a> = <a class="code" href="vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597a11da372cc3a82931c5e5d6146cd9dd1f">VMA_ALLOCATION_CREATE_MAPPED_BIT</a>;</div><div class="line"></div><div class="line">VkBuffer buf;</div><div class="line"><a class="code" href="struct_vma_allocation.html">VmaAllocation</a> alloc;</div><div class="line"><a class="code" href="struct_vma_allocation_info.html">VmaAllocationInfo</a> allocInfo;</div><div class="line"><a class="code" href="vk__mem__alloc_8h.html#ac72ee55598617e8eecca384e746bab51">vmaCreateBuffer</a>(allocator, &bufCreateInfo, &allocCreateInfo, &buf, &alloc, &allocInfo);</div><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" href="struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2">pMappedData</a>, &constantBufferData, <span class="keyword">sizeof</span>(constantBufferData));</div></div><!-- fragment --><p>There are some exceptions though, when you should consider mapping memory only for a short period of time:</p>
|
||||
|
97
docs/html/record_and_replay.html
Normal file
97
docs/html/record_and_replay.html
Normal file
@ -0,0 +1,97 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.13"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Vulkan Memory Allocator: Record and replay</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">Vulkan Memory Allocator
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.13 -->
|
||||
<script type="text/javascript">
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
<div id="nav-path" class="navpath">
|
||||
<ul>
|
||||
<li class="navelem"><a class="el" href="index.html">Vulkan Memory Allocator</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">Record and replay </div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
<div class="textblock"><h1><a class="anchor" id="record_and_replay_introduction"></a>
|
||||
Introduction</h1>
|
||||
<p>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:</p>
|
||||
<ul>
|
||||
<li>Test correctness - check if same sequence of calls will not cause crash or failures on a target platform.</li>
|
||||
<li>Gather statistics - see number of allocations, peak memory usage, number of calls etc.</li>
|
||||
<li>Benchmark performance - see how much time it takes to replay the whole sequence.</li>
|
||||
</ul>
|
||||
<h1><a class="anchor" id="record_and_replay_usage"></a>
|
||||
Usage</h1>
|
||||
<p><b>To record sequence of calls to a file:</b> Fill 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> member while creating <a class="el" href="struct_vma_allocator.html" title="Represents main object of this library initialized. ">VmaAllocator</a> object. File is opened and written during whole lifetime of the allocator.</p>
|
||||
<p><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: </p><pre class="fragment">VmaReplay.exe MyRecording.csv
|
||||
</pre><p><b>Documentation of file format</b> can be found in file: "docs/Recording file format.md". It's a human-readable, text file in CSV format (Comma Separated Values).</p>
|
||||
<h1><a class="anchor" id="record_and_replay_additional_considerations"></a>
|
||||
Additional considerations</h1>
|
||||
<ul>
|
||||
<li>Replaying file that was recorded on a different GPU (with different parameters like <code>bufferImageGranularity</code>, <code>nonCoherentAtomSize</code>, 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.</li>
|
||||
<li>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 <code>VMA_RECORDING_ENABLED</code> macro. Support for other platforms should be easy to add. Contributions are welcomed.</li>
|
||||
<li>Currently calls to <a class="el" href="vk__mem__alloc_8h.html#a6aced90fcc7b39882b6654a740a0b9bb" title="Compacts memory by moving allocations. ">vmaDefragment()</a> function are not recorded. </li>
|
||||
</ul>
|
||||
</div></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.13
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -1,5 +1,5 @@
|
||||
var searchData=
|
||||
[
|
||||
['flags',['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()']]],
|
||||
['flags',['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()']]],
|
||||
['frameinusecount',['frameInUseCount',['../struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7',1,'VmaAllocatorCreateInfo::frameInUseCount()'],['../struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa',1,'VmaPoolCreateInfo::frameInUseCount()']]]
|
||||
];
|
||||
|
@ -2,6 +2,7 @@ var searchData=
|
||||
[
|
||||
['pallocationcallbacks',['pAllocationCallbacks',['../struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d',1,'VmaAllocatorCreateInfo']]],
|
||||
['pdevicememorycallbacks',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]],
|
||||
['pfilepath',['pFilePath',['../struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d',1,'VmaRecordSettings']]],
|
||||
['pfn_5fvmaallocatedevicememoryfunction',['PFN_vmaAllocateDeviceMemoryFunction',['../vk__mem__alloc_8h.html#ab6a6477cda1ce775b30bde96d766203b',1,'vk_mem_alloc.h']]],
|
||||
['pfn_5fvmafreedevicememoryfunction',['PFN_vmaFreeDeviceMemoryFunction',['../vk__mem__alloc_8h.html#aef2545dc2e9dd4f29ab9ba6ac6fe2f49',1,'vk_mem_alloc.h']]],
|
||||
['pfnallocate',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]],
|
||||
@ -10,6 +11,7 @@ var searchData=
|
||||
['physicaldevice',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo']]],
|
||||
['pmappeddata',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]],
|
||||
['pool',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]],
|
||||
['precordsettings',['pRecordSettings',['../struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee',1,'VmaAllocatorCreateInfo']]],
|
||||
['preferredflags',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]],
|
||||
['preferredlargeheapblocksize',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]],
|
||||
['puserdata',['pUserData',['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()']]],
|
||||
|
@ -1,5 +1,6 @@
|
||||
var searchData=
|
||||
[
|
||||
['record_20and_20replay',['Record and replay',['../record_and_replay.html',1,'index']]],
|
||||
['requiredflags',['requiredFlags',['../struct_vma_allocation_create_info.html#a9166390303ff42d783305bc31c2b6b90',1,'VmaAllocationCreateInfo']]],
|
||||
['recommended_20usage_20patterns',['Recommended usage patterns',['../usage_patterns.html',1,'index']]]
|
||||
];
|
||||
|
@ -38,6 +38,9 @@ var searchData=
|
||||
['vma_5fmemory_5fusage_5funknown',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]],
|
||||
['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum',['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',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]],
|
||||
['vma_5frecord_5fflag_5fbits_5fmax_5fenum',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]],
|
||||
['vma_5frecord_5fflush_5fafter_5fcall_5fbit',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]],
|
||||
['vma_5frecording_5fenabled',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]],
|
||||
['vma_5fstats_5fstring_5fenabled',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]],
|
||||
['vmaallocatememory',['vmaAllocateMemory',['../vk__mem__alloc_8h.html#abf28077dbf82d0908b8acbe8ee8dd9b8',1,'vk_mem_alloc.h']]],
|
||||
['vmaallocatememoryforbuffer',['vmaAllocateMemoryForBuffer',['../vk__mem__alloc_8h.html#a7fdf64415b6c3d83c454f28d2c53df7b',1,'vk_mem_alloc.h']]],
|
||||
@ -90,6 +93,9 @@ var searchData=
|
||||
['vmapoolcreateflags',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]],
|
||||
['vmapoolcreateinfo',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'VmaPoolCreateInfo'],['../vk__mem__alloc_8h.html#a211706e9348dcee25a843ed4ea69bce7',1,'VmaPoolCreateInfo(): vk_mem_alloc.h']]],
|
||||
['vmapoolstats',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'VmaPoolStats'],['../vk__mem__alloc_8h.html#a2e5612d871d64c5624087b837a338c34',1,'VmaPoolStats(): vk_mem_alloc.h']]],
|
||||
['vmarecordflagbits',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2',1,'VmaRecordFlagBits(): vk_mem_alloc.h'],['../vk__mem__alloc_8h.html#ade20b626a6635ce1bf30ea53dea774e4',1,'VmaRecordFlagBits(): vk_mem_alloc.h']]],
|
||||
['vmarecordflags',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]],
|
||||
['vmarecordsettings',['VmaRecordSettings',['../struct_vma_record_settings.html',1,'VmaRecordSettings'],['../vk__mem__alloc_8h.html#a0ab61e87ff6365f1d59915eadc37a9f0',1,'VmaRecordSettings(): vk_mem_alloc.h']]],
|
||||
['vmasetallocationuserdata',['vmaSetAllocationUserData',['../vk__mem__alloc_8h.html#af9147d31ffc11d62fc187bde283ed14f',1,'vk_mem_alloc.h']]],
|
||||
['vmasetcurrentframeindex',['vmaSetCurrentFrameIndex',['../vk__mem__alloc_8h.html#ade56bf8dc9f5a5eaddf5f119ed525236',1,'vk_mem_alloc.h']]],
|
||||
['vmastatinfo',['VmaStatInfo',['../struct_vma_stat_info.html',1,'VmaStatInfo'],['../vk__mem__alloc_8h.html#a810b009a788ee8aac72a25b42ffbe31c',1,'VmaStatInfo(): vk_mem_alloc.h']]],
|
||||
|
@ -11,6 +11,7 @@ var searchData=
|
||||
['vmapool',['VmaPool',['../struct_vma_pool.html',1,'']]],
|
||||
['vmapoolcreateinfo',['VmaPoolCreateInfo',['../struct_vma_pool_create_info.html',1,'']]],
|
||||
['vmapoolstats',['VmaPoolStats',['../struct_vma_pool_stats.html',1,'']]],
|
||||
['vmarecordsettings',['VmaRecordSettings',['../struct_vma_record_settings.html',1,'']]],
|
||||
['vmastatinfo',['VmaStatInfo',['../struct_vma_stat_info.html',1,'']]],
|
||||
['vmastats',['VmaStats',['../struct_vma_stats.html',1,'']]],
|
||||
['vmavulkanfunctions',['VmaVulkanFunctions',['../struct_vma_vulkan_functions.html',1,'']]]
|
||||
|
@ -1,5 +1,6 @@
|
||||
var searchData=
|
||||
[
|
||||
['vma_5fdedicated_5fallocation',['VMA_DEDICATED_ALLOCATION',['../vk__mem__alloc_8h.html#af7b860e63b96d11e44ae8587ba06bbf4',1,'vk_mem_alloc.h']]],
|
||||
['vma_5frecording_5fenabled',['VMA_RECORDING_ENABLED',['../vk__mem__alloc_8h.html#a1f0c126759fc96ccb6e2d23c101d770c',1,'vk_mem_alloc.h']]],
|
||||
['vma_5fstats_5fstring_5fenabled',['VMA_STATS_STRING_ENABLED',['../vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1',1,'vk_mem_alloc.h']]]
|
||||
];
|
||||
|
@ -3,5 +3,6 @@ var searchData=
|
||||
['vmaallocationcreateflagbits',['VmaAllocationCreateFlagBits',['../vk__mem__alloc_8h.html#ad9889c10c798b040d59c92f257cae597',1,'vk_mem_alloc.h']]],
|
||||
['vmaallocatorcreateflagbits',['VmaAllocatorCreateFlagBits',['../vk__mem__alloc_8h.html#a4f87c9100d154a65a4ad495f7763cf7c',1,'vk_mem_alloc.h']]],
|
||||
['vmamemoryusage',['VmaMemoryUsage',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cc',1,'vk_mem_alloc.h']]],
|
||||
['vmapoolcreateflagbits',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'vk_mem_alloc.h']]]
|
||||
['vmapoolcreateflagbits',['VmaPoolCreateFlagBits',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7',1,'vk_mem_alloc.h']]],
|
||||
['vmarecordflagbits',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2',1,'vk_mem_alloc.h']]]
|
||||
];
|
||||
|
@ -17,5 +17,7 @@ var searchData=
|
||||
['vma_5fmemory_5fusage_5fmax_5fenum',['VMA_MEMORY_USAGE_MAX_ENUM',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305cca091e69437ef693e8d0d287f1c719ba6e',1,'vk_mem_alloc.h']]],
|
||||
['vma_5fmemory_5fusage_5funknown',['VMA_MEMORY_USAGE_UNKNOWN',['../vk__mem__alloc_8h.html#aa5846affa1e9da3800e3e78fae2305ccaf50d27e34e0925cf3a63db8c839121dd',1,'vk_mem_alloc.h']]],
|
||||
['vma_5fpool_5fcreate_5fflag_5fbits_5fmax_5fenum',['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',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]]
|
||||
['vma_5fpool_5fcreate_5fignore_5fbuffer_5fimage_5fgranularity_5fbit',['VMA_POOL_CREATE_IGNORE_BUFFER_IMAGE_GRANULARITY_BIT',['../vk__mem__alloc_8h.html#a9a7c45f9c863695d98c83fa5ac940fe7a9f1a499508a8edb4e8ba40aa0290a3d2',1,'vk_mem_alloc.h']]],
|
||||
['vma_5frecord_5fflag_5fbits_5fmax_5fenum',['VMA_RECORD_FLAG_BITS_MAX_ENUM',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a20dd17d69966dbffa054739d6090b85e',1,'vk_mem_alloc.h']]],
|
||||
['vma_5frecord_5fflush_5fafter_5fcall_5fbit',['VMA_RECORD_FLUSH_AFTER_CALL_BIT',['../vk__mem__alloc_8h.html#a4dd2c44642312a147a4e93373a6e64d2a8e7ab322e8732654be627c4ea8f36cc7',1,'vk_mem_alloc.h']]]
|
||||
];
|
||||
|
@ -1,4 +1,5 @@
|
||||
var searchData=
|
||||
[
|
||||
['record_20and_20replay',['Record and replay',['../record_and_replay.html',1,'index']]],
|
||||
['recommended_20usage_20patterns',['Recommended usage patterns',['../usage_patterns.html',1,'index']]]
|
||||
];
|
||||
|
@ -15,6 +15,9 @@ var searchData=
|
||||
['vmapoolcreateflags',['VmaPoolCreateFlags',['../vk__mem__alloc_8h.html#a2770e325ea42e087c1b91fdf46d0292a',1,'vk_mem_alloc.h']]],
|
||||
['vmapoolcreateinfo',['VmaPoolCreateInfo',['../vk__mem__alloc_8h.html#a211706e9348dcee25a843ed4ea69bce7',1,'vk_mem_alloc.h']]],
|
||||
['vmapoolstats',['VmaPoolStats',['../vk__mem__alloc_8h.html#a2e5612d871d64c5624087b837a338c34',1,'vk_mem_alloc.h']]],
|
||||
['vmarecordflagbits',['VmaRecordFlagBits',['../vk__mem__alloc_8h.html#ade20b626a6635ce1bf30ea53dea774e4',1,'vk_mem_alloc.h']]],
|
||||
['vmarecordflags',['VmaRecordFlags',['../vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828',1,'vk_mem_alloc.h']]],
|
||||
['vmarecordsettings',['VmaRecordSettings',['../vk__mem__alloc_8h.html#a0ab61e87ff6365f1d59915eadc37a9f0',1,'vk_mem_alloc.h']]],
|
||||
['vmastatinfo',['VmaStatInfo',['../vk__mem__alloc_8h.html#a810b009a788ee8aac72a25b42ffbe31c',1,'vk_mem_alloc.h']]],
|
||||
['vmastats',['VmaStats',['../vk__mem__alloc_8h.html#a732be855fb4a7c248e6853d928a729af',1,'vk_mem_alloc.h']]],
|
||||
['vmavulkanfunctions',['VmaVulkanFunctions',['../vk__mem__alloc_8h.html#a97064a1a271b0061ebfc3a079862d0c5',1,'vk_mem_alloc.h']]]
|
||||
|
@ -1,5 +1,5 @@
|
||||
var searchData=
|
||||
[
|
||||
['flags',['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()']]],
|
||||
['flags',['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()']]],
|
||||
['frameinusecount',['frameInUseCount',['../struct_vma_allocator_create_info.html#a21ea188dd212b8171cb9ecbed4a2a3a7',1,'VmaAllocatorCreateInfo::frameInUseCount()'],['../struct_vma_pool_create_info.html#a9437e43ffbb644dbbf7fc4e50cfad6aa',1,'VmaPoolCreateInfo::frameInUseCount()']]]
|
||||
];
|
||||
|
@ -2,12 +2,14 @@ var searchData=
|
||||
[
|
||||
['pallocationcallbacks',['pAllocationCallbacks',['../struct_vma_allocator_create_info.html#a6e409087e3be55400d0e4ccbe43c608d',1,'VmaAllocatorCreateInfo']]],
|
||||
['pdevicememorycallbacks',['pDeviceMemoryCallbacks',['../struct_vma_allocator_create_info.html#af1380969b5e1ea4c3184a877892d260e',1,'VmaAllocatorCreateInfo']]],
|
||||
['pfilepath',['pFilePath',['../struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d',1,'VmaRecordSettings']]],
|
||||
['pfnallocate',['pfnAllocate',['../struct_vma_device_memory_callbacks.html#a4f17f7b255101e733b44d5633aceabfb',1,'VmaDeviceMemoryCallbacks']]],
|
||||
['pfnfree',['pfnFree',['../struct_vma_device_memory_callbacks.html#abe8a3328bbc916f6f712fdb6b299444c',1,'VmaDeviceMemoryCallbacks']]],
|
||||
['pheapsizelimit',['pHeapSizeLimit',['../struct_vma_allocator_create_info.html#a31c192aa6cbffa33279f6d9f0c47c44b',1,'VmaAllocatorCreateInfo']]],
|
||||
['physicaldevice',['physicalDevice',['../struct_vma_allocator_create_info.html#a08230f04ae6ccf8a78150a9e829a7156',1,'VmaAllocatorCreateInfo']]],
|
||||
['pmappeddata',['pMappedData',['../struct_vma_allocation_info.html#a5eeffbe2d2f30f53370ff14aefbadbe2',1,'VmaAllocationInfo']]],
|
||||
['pool',['pool',['../struct_vma_allocation_create_info.html#a6272c0555cfd1fe28bff1afeb6190150',1,'VmaAllocationCreateInfo']]],
|
||||
['precordsettings',['pRecordSettings',['../struct_vma_allocator_create_info.html#ace2aa4877b16a42b0b7673d4e26000ee',1,'VmaAllocatorCreateInfo']]],
|
||||
['preferredflags',['preferredFlags',['../struct_vma_allocation_create_info.html#a7fe8d81a1ad10b2a2faacacee5b15d6d',1,'VmaAllocationCreateInfo']]],
|
||||
['preferredlargeheapblocksize',['preferredLargeHeapBlockSize',['../struct_vma_allocator_create_info.html#a8e4714298e3121cdd8b214a1ae7a637a',1,'VmaAllocatorCreateInfo']]],
|
||||
['puserdata',['pUserData',['../struct_vma_allocation_create_info.html#a8259e85c272683434f4abb4ddddffe19',1,'VmaAllocationCreateInfo::pUserData()'],['../struct_vma_allocation_info.html#adc507656149c04de7ed95d0042ba2a13',1,'VmaAllocationInfo::pUserData()']]],
|
||||
|
@ -72,8 +72,9 @@ $(function() {
|
||||
<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><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><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#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>
|
||||
<tr><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#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><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>
|
||||
</table></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
|
@ -100,6 +100,9 @@ Public Attributes</h2></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 if you leave define <code>VMA_STATIC_VULKAN_FUNCTIONS 1</code>. <a href="#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="#ace2aa4877b16a42b0b7673d4e26000ee">More...</a><br /></td></tr>
|
||||
<tr class="separator:ace2aa4877b16a42b0b7673d4e26000ee"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table>
|
||||
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||||
<div class="textblock"><p>Description of a Allocator to be created. </p>
|
||||
@ -229,6 +232,23 @@ 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"></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"></a>
|
||||
|
78
docs/html/struct_vma_record_settings-members.html
Normal file
78
docs/html/struct_vma_record_settings-members.html
Normal file
@ -0,0 +1,78 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.13"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Vulkan Memory Allocator: Member List</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">Vulkan Memory Allocator
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.13 -->
|
||||
<script type="text/javascript">
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="headertitle">
|
||||
<div class="title">VmaRecordSettings Member List</div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<p>This is the complete list of members for <a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a>, including all inherited members.</p>
|
||||
<table class="directory">
|
||||
<tr class="even"><td class="entry"><a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a">flags</a></td><td class="entry"><a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a></td><td class="entry"></td></tr>
|
||||
<tr><td class="entry"><a class="el" href="struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d">pFilePath</a></td><td class="entry"><a class="el" href="struct_vma_record_settings.html">VmaRecordSettings</a></td><td class="entry"></td></tr>
|
||||
</table></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.13
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
130
docs/html/struct_vma_record_settings.html
Normal file
130
docs/html/struct_vma_record_settings.html
Normal file
@ -0,0 +1,130 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||
<meta name="generator" content="Doxygen 1.8.13"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>Vulkan Memory Allocator: VmaRecordSettings Struct Reference</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
<script type="text/javascript" src="search/search.js"></script>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||
<div id="titlearea">
|
||||
<table cellspacing="0" cellpadding="0">
|
||||
<tbody>
|
||||
<tr style="height: 56px;">
|
||||
<td id="projectalign" style="padding-left: 0.5em;">
|
||||
<div id="projectname">Vulkan Memory Allocator
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.8.13 -->
|
||||
<script type="text/javascript">
|
||||
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
$(document).ready(function() { init_search(); });
|
||||
});
|
||||
</script>
|
||||
<div id="main-nav"></div>
|
||||
<!-- window showing the filter options -->
|
||||
<div id="MSearchSelectWindow"
|
||||
onmouseover="return searchBox.OnSearchSelectShow()"
|
||||
onmouseout="return searchBox.OnSearchSelectHide()"
|
||||
onkeydown="return searchBox.OnSearchSelectKey(event)">
|
||||
</div>
|
||||
|
||||
<!-- iframe showing the search results (closed by default) -->
|
||||
<div id="MSearchResultsWindow">
|
||||
<iframe src="javascript:void(0)" frameborder="0"
|
||||
name="MSearchResults" id="MSearchResults">
|
||||
</iframe>
|
||||
</div>
|
||||
|
||||
</div><!-- top -->
|
||||
<div class="header">
|
||||
<div class="summary">
|
||||
<a href="#pub-attribs">Public Attributes</a> |
|
||||
<a href="struct_vma_record_settings-members.html">List of all members</a> </div>
|
||||
<div class="headertitle">
|
||||
<div class="title">VmaRecordSettings Struct Reference</div> </div>
|
||||
</div><!--header-->
|
||||
<div class="contents">
|
||||
|
||||
<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>.
|
||||
<a href="struct_vma_record_settings.html#details">More...</a></p>
|
||||
|
||||
<p><code>#include <<a class="el" href="vk__mem__alloc_8h_source.html">vk_mem_alloc.h</a>></code></p>
|
||||
<table class="memberdecls">
|
||||
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-attribs"></a>
|
||||
Public Attributes</h2></td></tr>
|
||||
<tr class="memitem:ad8fdcc92119ae7a8c08c1a564c01d63a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828">VmaRecordFlags</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_record_settings.html#ad8fdcc92119ae7a8c08c1a564c01d63a">flags</a></td></tr>
|
||||
<tr class="memdesc:ad8fdcc92119ae7a8c08c1a564c01d63a"><td class="mdescLeft"> </td><td class="mdescRight">Flags for recording. Use <a class="el" href="vk__mem__alloc_8h.html#ade20b626a6635ce1bf30ea53dea774e4" title="Flags to be used in VmaRecordSettings::flags. ">VmaRecordFlagBits</a> enum. <a href="#ad8fdcc92119ae7a8c08c1a564c01d63a">More...</a><br /></td></tr>
|
||||
<tr class="separator:ad8fdcc92119ae7a8c08c1a564c01d63a"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:a6cb1fdbf6bcb610b68f2010dd629e89d"><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_vma_record_settings.html#a6cb1fdbf6bcb610b68f2010dd629e89d">pFilePath</a></td></tr>
|
||||
<tr class="memdesc:a6cb1fdbf6bcb610b68f2010dd629e89d"><td class="mdescLeft"> </td><td class="mdescRight">Path to the file that should be written by the recording. <a href="#a6cb1fdbf6bcb610b68f2010dd629e89d">More...</a><br /></td></tr>
|
||||
<tr class="separator:a6cb1fdbf6bcb610b68f2010dd629e89d"><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 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><h2 class="groupheader">Member Data Documentation</h2>
|
||||
<a id="ad8fdcc92119ae7a8c08c1a564c01d63a"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ad8fdcc92119ae7a8c08c1a564c01d63a">◆ </a></span>flags</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname"><a class="el" href="vk__mem__alloc_8h.html#af3929a1a4547c592fc0b0e55ef452828">VmaRecordFlags</a> VmaRecordSettings::flags</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Flags for recording. Use <a class="el" href="vk__mem__alloc_8h.html#ade20b626a6635ce1bf30ea53dea774e4" title="Flags to be used in VmaRecordSettings::flags. ">VmaRecordFlagBits</a> enum. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="a6cb1fdbf6bcb610b68f2010dd629e89d"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a6cb1fdbf6bcb610b68f2010dd629e89d">◆ </a></span>pFilePath</h2>
|
||||
|
||||
<div class="memitem">
|
||||
<div class="memproto">
|
||||
<table class="memname">
|
||||
<tr>
|
||||
<td class="memname">const char* VmaRecordSettings::pFilePath</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
<p>Path to the file that should be written by the recording. </p>
|
||||
<p>Suggested extension: "csv". If the file already exists, it will be overwritten. It will be opened for the whole time <a class="el" href="struct_vma_allocator.html" title="Represents main object of this library initialized. ">VmaAllocator</a> object is alive. If opening this file fails, creation of the whole allocator object fails. </p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<hr/>The documentation for this struct was generated from the following file:<ul>
|
||||
<li><a class="el" href="vk__mem__alloc_8h_source.html">vk_mem_alloc.h</a></li>
|
||||
</ul>
|
||||
</div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by  <a href="http://www.doxygen.org/index.html">
|
||||
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||||
</a> 1.8.13
|
||||
</small></address>
|
||||
</body>
|
||||
</html>
|
@ -80,6 +80,9 @@ 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>
|
||||
@ -111,6 +114,8 @@ Classes</h2></td></tr>
|
||||
Macros</h2></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>
|
||||
<tr class="separator:af7b860e63b96d11e44ae8587ba06bbf4"><td class="memSeparator" colspan="2"> </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:ae25f0d55fd91cb166f002b63244800e1"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="vk__mem__alloc_8h.html#ae25f0d55fd91cb166f002b63244800e1">VMA_STATS_STRING_ENABLED</a>   1</td></tr>
|
||||
<tr class="separator:ae25f0d55fd91cb166f002b63244800e1"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
</table><table class="memberdecls">
|
||||
@ -133,6 +138,14 @@ Typedefs</h2></td></tr>
|
||||
<tr class="memitem:a97064a1a271b0061ebfc3a079862d0c5"><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#a97064a1a271b0061ebfc3a079862d0c5">VmaVulkanFunctions</a></td></tr>
|
||||
<tr class="memdesc:a97064a1a271b0061ebfc3a079862d0c5"><td class="mdescLeft"> </td><td class="mdescRight">Pointers to some Vulkan functions - a subset used by the library. <a href="#a97064a1a271b0061ebfc3a079862d0c5">More...</a><br /></td></tr>
|
||||
<tr class="separator:a97064a1a271b0061ebfc3a079862d0c5"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ade20b626a6635ce1bf30ea53dea774e4"><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#ade20b626a6635ce1bf30ea53dea774e4">VmaRecordFlagBits</a></td></tr>
|
||||
<tr class="memdesc:ade20b626a6635ce1bf30ea53dea774e4"><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="#ade20b626a6635ce1bf30ea53dea774e4">More...</a><br /></td></tr>
|
||||
<tr class="separator:ade20b626a6635ce1bf30ea53dea774e4"><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:a0ab61e87ff6365f1d59915eadc37a9f0"><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#a0ab61e87ff6365f1d59915eadc37a9f0">VmaRecordSettings</a></td></tr>
|
||||
<tr class="memdesc:a0ab61e87ff6365f1d59915eadc37a9f0"><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="#a0ab61e87ff6365f1d59915eadc37a9f0">More...</a><br /></td></tr>
|
||||
<tr class="separator:a0ab61e87ff6365f1d59915eadc37a9f0"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
<tr class="memitem:ae0f6d1d733dded220d28134da46b4283"><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#ae0f6d1d733dded220d28134da46b4283">VmaAllocatorCreateInfo</a></td></tr>
|
||||
<tr class="memdesc:ae0f6d1d733dded220d28134da46b4283"><td class="mdescLeft"> </td><td class="mdescRight">Description of a Allocator to be created. <a href="#ae0f6d1d733dded220d28134da46b4283">More...</a><br /></td></tr>
|
||||
<tr class="separator:ae0f6d1d733dded220d28134da46b4283"><td class="memSeparator" colspan="2"> </td></tr>
|
||||
@ -180,6 +193,11 @@ Enumerations</h2></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>
|
||||
</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
|
||||
}<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>
|
||||
</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,
|
||||
@ -332,6 +350,20 @@ Functions</h2></td></tr>
|
||||
</table>
|
||||
</div><div class="memdoc">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="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"></a>
|
||||
@ -611,6 +643,52 @@ 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="ade20b626a6635ce1bf30ea53dea774e4"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#ade20b626a6635ce1bf30ea53dea774e4">◆ </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"></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="a0ab61e87ff6365f1d59915eadc37a9f0"></a>
|
||||
<h2 class="memtitle"><span class="permalink"><a href="#a0ab61e87ff6365f1d59915eadc37a9f0">◆ </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="a810b009a788ee8aac72a25b42ffbe31c"></a>
|
||||
@ -803,6 +881,28 @@ Functions</h2></td></tr>
|
||||
<tr><td class="fieldname"><a id="a9a7c45f9c863695d98c83fa5ac940fe7a1c7312bea9ea246846b9054fd6bd6aec"></a>VMA_POOL_CREATE_FLAG_BITS_MAX_ENUM </td><td class="fielddoc"></td></tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<a id="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"></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"></a>VMA_RECORD_FLAG_BITS_MAX_ENUM </td><td class="fielddoc"></td></tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="groupheader">Function Documentation</h2>
|
||||
|
File diff suppressed because one or more lines are too long
@ -12,7 +12,7 @@ startproject "VulkanSample"
|
||||
filter "platforms:x64"
|
||||
system "Windows"
|
||||
architecture "x64"
|
||||
includedirs { "../third_party/mathfu-1.1.0/include", "$(VULKAN_SDK)/Include" }
|
||||
includedirs { "$(VULKAN_SDK)/Include" }
|
||||
libdirs { "$(VULKAN_SDK)/Lib" }
|
||||
|
||||
filter "platforms:Linux-x64"
|
||||
@ -21,6 +21,7 @@ architecture "x64"
|
||||
includedirs { "$(VULKAN_SDK)/include" }
|
||||
libdirs { "$(VULKAN_SDK)/lib" }
|
||||
|
||||
|
||||
project "VulkanSample"
|
||||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
@ -57,3 +58,41 @@ buildoptions { "/MDd" }
|
||||
|
||||
filter { "configurations:Release", "platforms:Windows-x64" }
|
||||
buildoptions { "/MD" }
|
||||
|
||||
|
||||
project "VmaReplay"
|
||||
kind "ConsoleApp"
|
||||
language "C++"
|
||||
location "../build"
|
||||
filename ("VmaReplay_" .. _SUFFIX)
|
||||
targetdir "../bin"
|
||||
objdir "../build/Desktop_%{_SUFFIX}/%{cfg.platform}/%{cfg.buildcfg}"
|
||||
floatingpoint "Fast"
|
||||
files { "../src/VmaReplay/*.h", "../src/VmaReplay/*.cpp" }
|
||||
flags { "NoPCH", "FatalWarnings" }
|
||||
characterset "Default"
|
||||
|
||||
filter "configurations:Debug"
|
||||
defines { "_DEBUG", "DEBUG" }
|
||||
flags { }
|
||||
targetsuffix ("_Debug_" .. _SUFFIX)
|
||||
|
||||
filter "configurations:Release"
|
||||
defines { "NDEBUG" }
|
||||
optimize "On"
|
||||
flags { "LinkTimeOptimization" }
|
||||
targetsuffix ("_Release_" .. _SUFFIX)
|
||||
|
||||
filter { "platforms:x64" }
|
||||
defines { "WIN32", "_CONSOLE", "PROFILE", "_WINDOWS", "_WIN32_WINNT=0x0601" }
|
||||
links { "vulkan-1" }
|
||||
|
||||
filter { "platforms:Linux-x64" }
|
||||
buildoptions { "-std=c++0x" }
|
||||
links { "vulkan" }
|
||||
|
||||
filter { "configurations:Debug", "platforms:x64" }
|
||||
buildoptions { "/MDd" }
|
||||
|
||||
filter { "configurations:Release", "platforms:Windows-x64" }
|
||||
buildoptions { "/MD" }
|
||||
|
670
src/VmaReplay/Common.cpp
Normal file
670
src/VmaReplay/Common.cpp
Normal file
@ -0,0 +1,670 @@
|
||||
#include "Common.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// 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;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
391
src/VmaReplay/Common.h
Normal file
391
src/VmaReplay/Common.h
Normal file
@ -0,0 +1,391 @@
|
||||
#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 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;
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
return StrRange {
|
||||
m_Line.beg + m_Ranges[index * 2],
|
||||
m_Line.beg + m_Ranges[index * 2 + 1] };
|
||||
}
|
||||
|
||||
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, ...);
|
||||
*/
|
3000
src/VmaReplay/VmaReplay.cpp
Normal file
3000
src/VmaReplay/VmaReplay.cpp
Normal file
File diff suppressed because it is too large
Load Diff
2
src/VmaReplay/VmaUsage.cpp
Normal file
2
src/VmaReplay/VmaUsage.cpp
Normal file
@ -0,0 +1,2 @@
|
||||
#define VMA_IMPLEMENTATION
|
||||
#include "VmaUsage.h"
|
27
src/VmaReplay/VmaUsage.h
Normal file
27
src/VmaReplay/VmaUsage.h
Normal file
@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#define NOMINMAX
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#define VK_USE_PLATFORM_WIN32_KHR
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
//#define VMA_USE_STL_CONTAINERS 1
|
||||
|
||||
//#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
|
||||
|
||||
#include "../vk_mem_alloc.h"
|
||||
|
||||
#pragma warning(pop)
|
@ -25,6 +25,7 @@ include all public interface declarations. Example:
|
||||
//#define VMA_DEBUG_MARGIN 16
|
||||
//#define VMA_DEBUG_DETECT_CORRUPTION 1
|
||||
//#define VMA_DEBUG_INITIALIZE_ALLOCATIONS 1
|
||||
//#define VMA_RECORDING_ENABLED 0
|
||||
|
||||
#pragma warning(push, 4)
|
||||
#pragma warning(disable: 4127) // conditional expression is constant
|
||||
|
@ -190,6 +190,18 @@ VKAPI_ATTR VkBool32 VKAPI_CALL MyDebugReportCallback(
|
||||
{
|
||||
return VK_FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
"Mapping an image with layout VK_IMAGE_LAYOUT_DEPTH_STENCIL_ATTACHMENT_OPTIMAL can result in undefined behavior if this memory is used by the device. Only GENERAL or PREINITIALIZED should be used."
|
||||
Ignoring because we map entire VkDeviceMemory blocks, where different types of
|
||||
images and buffers may end up together, especially on GPUs with unified memory
|
||||
like Intel.
|
||||
*/
|
||||
if(strstr(pMessage, "Mapping an image with layout") != nullptr &&
|
||||
strstr(pMessage, "can result in undefined behavior if this memory is used by the device") != nullptr)
|
||||
{
|
||||
return VK_FALSE;
|
||||
}
|
||||
|
||||
switch(flags)
|
||||
{
|
||||
|
1060
src/vk_mem_alloc.h
1060
src/vk_mem_alloc.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user