README.md
1# GpuMemDumpVis
2
3Vulkan/D3D12 Memory Allocator Dump Visualization.
4It is an auxiliary tool that can visualize internal state of [Vulkan Memory Allocator](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator) and
5[D3D12 Memory Allocator](https://github.com/GPUOpen-LibrariesAndSDKs/D3D12MemoryAllocator) libraries on a picture.
6It is a Python script that must be launched from command line with appropriate parameters.
7
8## Requirements
9
10- Python 3 installed
11- [Pillow](http://python-pillow.org/) - Python Imaging Library (Fork) installed
12
13## Usage
14
15```
16python GpuMemDumpVis.py -o OUTPUT_FILE INPUT_FILE
17```
18
19* `INPUT_FILE` - path to source file to be read, containing dump of internal state of the VMA/D3D12MA library in JSON format (encoding: UTF-8/UTF-16), generated using `vmaBuildStatsString()` and `D3D12MA::Allocator::BuildStatsString()` functions.
20* `OUTPUT_FILE` - path to destination file to be written that will contain generated image. Image format is automatically recognized based on file extension. List of supported formats can be found [here](http://pillow.readthedocs.io/en/latest/handbook/image-file-formats.html) and includes: BMP, GIF, JPEG, PNG, TGA.
21
22You can also use typical options:
23
24* `-h` - to see help on command line syntax
25* `-v` - to see program version number
26
27## Example output
28
29
30
31## Legend
32
33*  Light gray without border - a space in Vulkan device memory block unused by any allocation.
34*  Buffer with usage containing INDIRECT_BUFFER, VERTEX_BUFFER, or INDEX_BUFFER (Vulkan).
35*  Buffer with usage containing STORAGE_BUFFER or STORAGE_TEXEL_BUFFER (Vulkan).
36*  Buffer with usage containing UNIFORM_BUFFER or UNIFORM_TEXEL_BUFFER (Vulkan).
37*  Other buffer.
38*  Image with OPTIMAL tiling and usage containing DEPTH_STENCIL_ATTACHMENT (Vulkan) or a texture with usage containing D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL (D3D12).
39*  Image with OPTIMAL tiling and usage containing INPUT_ATTACHMENT, TRANSIENT_ATTACHMENT or COLOR_ATTACHMENT (Vulkan), or a texture with usage containing D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET or D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS (D3D12).
40*  Image with OPTIMAL tiling and usage containing SAMPLED (Vulkan) or a texture with usage not containing D3D12_RESOURCE_FLAG_DENY_SHARED_RESOURCE (D3D12).
41*  Other image with OPTIMAL tiling (Vulkan) or a texture (D3D12).
42*  Image with LINEAR tiling (Vulkan).
43*  Image with tiling unknown to the allocator (Vulkan).
44*  Allocation of unknown type.
45*  Black bar - one or more allocations of any kind too small to be visualized as filled rectangles.
46