D3D12MemoryAllocator/tools/GpuMemDumpVis
2022-04-05 13:34:45 +02:00
..
README_files New JSON dump format 2022-03-24 12:14:27 +01:00
GpuMemDump.schema.json Fixes in JSON dump format. Fixes in GpuMemDumpVis.py regarding image height calculation. 2022-04-05 13:34:45 +02:00
GpuMemDumpVis.py Fixes in JSON dump format. Fixes in GpuMemDumpVis.py regarding image height calculation. 2022-04-05 13:34:45 +02:00
README.md New JSON dump format 2022-03-24 12:14:27 +01:00
Sample.json New JSON dump format 2022-03-24 12:14:27 +01:00

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 using vmaBuildStatsString() and D3D12MA::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

Example output

Legend

  • Free space Light gray without border - a space in Vulkan device memory block unused by any allocation.
  • Buffer 1 Buffer with usage containing INDIRECT_BUFFER, VERTEX_BUFFER, or INDEX_BUFFER.
  • Buffer 2 Buffer with usage containing STORAGE_BUFFER or STORAGE_TEXEL_BUFFER.
  • Buffer 3 Buffer with usage containing UNIFORM_BUFFER or UNIFORM_TEXEL_BUFFER.
  • Buffer 4 Other buffer.
  • Image 1 Image with OPTIMAL tiling and usage containing DEPTH_STENCIL_ATTACHMENT or 1D/2D/3D texture with usage containing D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL.
  • Image 2 Image with OPTIMAL tiling and usage containing INPUT_ATTACHMENT, TRANSIENT_ATTACHMENT or COLOR_ATTACHMENT, or 1D/2D/3D texture with usage containing D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET or D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS.
  • Image 3 Image with OPTIMAL tiling and usage containing SAMPLED or 1D/2D/3D texture with usage not containing D3D12_RESOURCE_FLAG_DENY_SHARED_RESOURCE.
  • Image 4 Other image with OPTIMAL tiling or 1D/2D/3D texture.
  • Image Linear Image with LINEAR tiling.
  • Image Unknown Image with tiling unknown to the allocator.
  • Unknown Allocation of unknown type.
  • Details Black bar - one or more allocations of any kind too small to be visualized as filled rectangles.