Verzeichnis graphics/asymptote/VulkanMemoryAllocator/tools/GpuMemDumpVis
README.md
GpuMemDumpVis
Vulkan/D3D12 Memory Allocator Dump Visualization. It is an auxiliary tool that can visualize internal state of Vulkan Memory Allocator and D3D12 Memory Allocator libraries on a picture. It is a Python script that must be launched from command line with appropriate parameters.
Requirements
- Python 3 installed
- Pillow - Python Imaging Library (Fork) installed
Usage
python GpuMemDumpVis.py -o OUTPUT_FILE INPUT_FILE
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 usingvmaBuildStatsString()andD3D12MA::Allocator::BuildStatsString()functions.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 and includes: BMP, GIF, JPEG, PNG, TGA.
You can also use typical options:
-h- to see help on command line syntax-v- to see program version number
Example output

Legend
- Light gray without border - a space in Vulkan device memory block unused by any allocation.
- Buffer with usage containing INDIRECTBUFFER, VERTEXBUFFER, or INDEXBUFFER (Vulkan).
- Buffer with usage containing STORAGEBUFFER or STORAGETEXELBUFFER (Vulkan).
- Buffer with usage containing UNIFORMBUFFER or UNIFORMTEXELBUFFER (Vulkan).
- Other buffer.
- Image with OPTIMAL tiling and usage containing DEPTHSTENCILATTACHMENT (Vulkan) or a texture with usage containing D3D12RESOURCEFLAGALLOWDEPTHSTENCIL (D3D12).
- Image with OPTIMAL tiling and usage containing INPUTATTACHMENT, TRANSIENTATTACHMENT, COLORATTACHMENT, or STORAGE (Vulkan), or a texture with usage containing D3D12RESOURCEFLAGALLOWRENDERTARGET or D3D12RESOURCEFLAGALLOWUNORDEREDACCESS (D3D12).
- Image with OPTIMAL tiling and usage containing SAMPLED (Vulkan) or a texture with usage not containing D3D12RESOURCEFLAGDENYSHAREDRESOURCE (D3D12).
- Other image with OPTIMAL tiling (Vulkan) or a texture (D3D12).
- Image with LINEAR tiling (Vulkan).
- Image with tiling unknown to the allocator (Vulkan).
- Allocation of unknown type.
- Black bar - one or more allocations of any kind too small to be visualized as filled rectangles.













Additional notes
Warning! Current version of the tool shows incorrect result when allocations alias (overlap) in memory, as it only looks at sizes of the allocations, not their offsets.