Class VmaDetailedStatistics

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VmaDetailedStatistics>
org.lwjgl.util.vma.VmaDetailedStatistics
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VmaDetailedStatistics extends org.lwjgl.system.Struct<VmaDetailedStatistics> implements org.lwjgl.system.NativeResource
More detailed statistics than VmaStatistics.

These are slower to calculate. Use for debugging purposes.

Previous version of the statistics API provided averages, but they have been removed because they can be easily calculated as:


 VkDeviceSize allocationSizeAvg = detailedStats.statistics.allocationBytes / detailedStats.statistics.allocationCount;
 VkDeviceSize unusedBytes = detailedStats.statistics.blockBytes - detailedStats.statistics.allocationBytes;
 VkDeviceSize unusedRangeSizeAvg = unusedBytes / detailedStats.unusedRangeCount;

Layout


 struct VmaDetailedStatistics {
     VmaStatistics statistics();
     uint32_t unusedRangeCount();
     VkDeviceSize allocationSizeMin();
     VkDeviceSize allocationSizeMax();
     VkDeviceSize unusedRangeSizeMin();
     VkDeviceSize unusedRangeSizeMax();
 }
See Also:
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • STATISTICS

      public static final int STATISTICS
      The struct member offsets.
    • UNUSEDRANGECOUNT

      public static final int UNUSEDRANGECOUNT
      The struct member offsets.
    • ALLOCATIONSIZEMIN

      public static final int ALLOCATIONSIZEMIN
      The struct member offsets.
    • ALLOCATIONSIZEMAX

      public static final int ALLOCATIONSIZEMAX
      The struct member offsets.
    • UNUSEDRANGESIZEMIN

      public static final int UNUSEDRANGESIZEMIN
      The struct member offsets.
    • UNUSEDRANGESIZEMAX

      public static final int UNUSEDRANGESIZEMAX
      The struct member offsets.
  • Constructor Details

    • VmaDetailedStatistics

      public VmaDetailedStatistics(ByteBuffer container)
      Creates a VmaDetailedStatistics instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<VmaDetailedStatistics>
    • statistics

      public VmaStatistics statistics()
      basic statistics
    • unusedRangeCount

      public int unusedRangeCount()
      number of free ranges of memory between allocations
    • allocationSizeMin

      public long allocationSizeMin()
      smallest allocation size. VK_WHOLE_SIZE if there are 0 allocations.
    • allocationSizeMax

      public long allocationSizeMax()
      largest allocation size. 0 if there are 0 allocations.
    • unusedRangeSizeMin

      public long unusedRangeSizeMin()
      smallest empty range size. VK_WHOLE_SIZE if there are 0 empty ranges.
    • unusedRangeSizeMax

      public long unusedRangeSizeMax()
      largest empty range size. 0 if there are 0 empty ranges.
    • malloc

      public static VmaDetailedStatistics malloc()
      Returns a new VmaDetailedStatistics instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static VmaDetailedStatistics calloc()
      Returns a new VmaDetailedStatistics instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static VmaDetailedStatistics create()
      Returns a new VmaDetailedStatistics instance allocated with BufferUtils.
    • create

      public static VmaDetailedStatistics create(long address)
      Returns a new VmaDetailedStatistics instance for the specified memory address.
    • createSafe

      public static @Nullable VmaDetailedStatistics createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static VmaDetailedStatistics.Buffer malloc(int capacity)
      Returns a new VmaDetailedStatistics.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VmaDetailedStatistics.Buffer calloc(int capacity)
      Returns a new VmaDetailedStatistics.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VmaDetailedStatistics.Buffer create(int capacity)
      Returns a new VmaDetailedStatistics.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VmaDetailedStatistics.Buffer create(long address, int capacity)
      Create a VmaDetailedStatistics.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable VmaDetailedStatistics.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static VmaDetailedStatistics malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VmaDetailedStatistics instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static VmaDetailedStatistics calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VmaDetailedStatistics instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static VmaDetailedStatistics.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VmaDetailedStatistics.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static VmaDetailedStatistics.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VmaDetailedStatistics.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • nstatistics

      public static VmaStatistics nstatistics(long struct)
      Unsafe version of statistics().
    • nunusedRangeCount

      public static int nunusedRangeCount(long struct)
      Unsafe version of unusedRangeCount().
    • nallocationSizeMin

      public static long nallocationSizeMin(long struct)
      Unsafe version of allocationSizeMin().
    • nallocationSizeMax

      public static long nallocationSizeMax(long struct)
      Unsafe version of allocationSizeMax().
    • nunusedRangeSizeMin

      public static long nunusedRangeSizeMin(long struct)
      Unsafe version of unusedRangeSizeMin().
    • nunusedRangeSizeMax

      public static long nunusedRangeSizeMax(long struct)
      Unsafe version of unusedRangeSizeMax().