Added documentation of the whole "Record and replay" feature to Doxygen docs and README.md.

This commit is contained in:
Adam Sawicki 2018-08-21 11:38:32 +02:00
parent 6ea177877a
commit fd64a60957
8 changed files with 268 additions and 120 deletions

View file

@ -67,6 +67,7 @@ Documentation of all members: vk_mem_alloc.h
- [Memory initialization](@ref debugging_memory_usage_initialization)
- [Margins](@ref debugging_memory_usage_margins)
- [Corruption detection](@ref debugging_memory_usage_corruption_detection)
- \subpage record_and_replay
- \subpage usage_patterns
- [Simple patterns](@ref usage_patterns_simple)
- [Advanced patterns](@ref usage_patterns_advanced)
@ -920,6 +921,52 @@ Margin validation (corruption detection) works only for memory types that are
`HOST_VISIBLE` and `HOST_COHERENT`.
\page record_and_replay Record and replay
\section record_and_replay_introduction Introduction
While using the library, sequence of calls to its functions together with their
parameters can be recorded to a file and later replayed using standalone player
application. It can be useful to:
- Test correctness - check if same sequence of calls will not cause crash or
failures on a target platform.
- Gather statistics - see number of allocations, peak memory usage, number of
calls etc.
- Benchmark performance - see how much time it takes to replay the whole
sequence.
\section record_and_replay_usage Usage
<b>To record sequence of calls to a file:</b> Fill in
VmaAllocatorCreateInfo::pRecordSettings member while creating #VmaAllocator
object. File is opened and written during whole lifetime of the allocator.
<b>To replay file:</b> Use VmaReplay - standalone command-line program.
Precompiled binary can be found in "bin" directory.
Its source can be found in "src/VmaReplay" directory.
Its project is generated by Premake.
Command line syntax is printed when the program is launched without parameters.
Basic usage:
VmaReplay.exe MyRecording.csv
<b>Documentation of file format</b> can be found in file: "docs/Recording file format.md".
It's a human-readable, text file in CSV format (Comma Separated Values).
\section record_and_replay_additional_considerations Additional considerations
- Replaying file that was recorded on a different GPU (with different parameters
like `bufferImageGranularity`, `nonCoherentAtomSize`, and especially different
set of memory heaps and types) may give different performance and memory usage
results, as well as issue some warnings and errors.
- Current implementation of recording in VMA, as well as VmaReplay application, is
coded and tested only on Windows. Inclusion of recording code is driven by
`VMA_RECORDING_ENABLED` macro. Support for other platforms should be easy to
add. Contributions are welcomed.
- Currently calls to vmaDefragment() function are not recorded.
\page usage_patterns Recommended usage patterns
See also slides from talk:
@ -1198,7 +1245,7 @@ The library uses following algorithm for allocation, in order:
Features deliberately excluded from the scope of this library:
- Data transfer - issuing commands that transfer data between buffers or images, any usage of
`VkCommandList` or `VkCommandQueue` and related synchronization is responsibility of the user.
`VkCommandList` or `VkQueue` and related synchronization is responsibility of the user.
- 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