Record Class VmaStatistics
- All Implemented Interfaces:
IPointer,IVmaStatistics
Calculated statistics of memory usage e.g. in a specific memory type, heap, custom pool, or total.
These are fast to calculate. See functions: vmaGetHeapBudgets(), vmaGetPoolStatistics().
Structure
typedef struct VmaStatistics {
uint32_t blockCount;
uint32_t allocationCount;
VkDeviceSize blockBytes;
VkDeviceSize allocationBytes;
} VmaStatistics;
Contracts
The property segment() should always be not-null
(segment != NULL && !segment.equals(MemorySegment.NULL)), and properly aligned to
LAYOUT.byteAlignment() bytes. To represent null pointer, you may use a Java
null instead. See the documentation of IPointer.segment() for more details.
The constructor of this class is marked as UnsafeConstructor, because it does not
perform any runtime check. The constructor can be useful for automatic code generators.
Member documentation
blockCount()Number of `VkDeviceMemory` objects - Vulkan memory blocks allocated.allocationCount()Number ofVmaAllocationobjects allocated.Dedicated allocations have their own blocks, so each one adds 1 to
allocationCountas well asblockCount.blockBytes()Number of bytes allocated in `VkDeviceMemory` blocks.ote To avoid confusion, please be aware that what Vulkan calls an "allocation" - a whole
VkDeviceMemoryobject (e.g. as inVkPhysicalDeviceLimits::maxMemoryAllocationCount) is called a "block" in VMA, while VMA calls "allocation" aVmaAllocationobject that represents a memory region sub-allocated from such block, usually for a single buffer or image.allocationBytes()Total number of bytes occupied by allVmaAllocationobjects.Always less or equal than
blockBytes. Difference(blockBytes - allocationBytes)is the amount of memory allocated from Vulkan but unused by anyVmaAllocation.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfLongstatic final ValueLayout.OfIntstatic final ValueLayout.OfLongstatic final ValueLayout.OfIntstatic final longstatic final longstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final longstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionVmaStatistics(@NotNull MemorySegment segment) Creates an instance of aVmaStatisticsrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaStatisticsstatic VmaStatistics.PtrlongallocationBytes(long value) intallocationCount(int value) longblockBytes(long value) intblockCount(int value) static VmaStatisticsclone(Arena arena, VmaStatistics src) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.@NotNull MemorySegmentsegment()Returns the value of thesegmentrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$blockCount
-
PATH$allocationCount
-
PATH$blockBytes
-
PATH$allocationBytes
-
LAYOUT$blockCount
-
LAYOUT$allocationCount
-
LAYOUT$blockBytes
-
LAYOUT$allocationBytes
-
SIZE$blockCount
public static final long SIZE$blockCount -
SIZE$allocationCount
public static final long SIZE$allocationCount -
SIZE$blockBytes
public static final long SIZE$blockBytes -
SIZE$allocationBytes
public static final long SIZE$allocationBytes -
OFFSET$blockCount
public static final long OFFSET$blockCount -
OFFSET$allocationCount
public static final long OFFSET$allocationCount -
OFFSET$blockBytes
public static final long OFFSET$blockBytes -
OFFSET$allocationBytes
public static final long OFFSET$allocationBytes
-
-
Constructor Details
-
VmaStatistics
Creates an instance of aVmaStatisticsrecord class.- Parameters:
segment- the value for thesegmentrecord component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
blockCount
-
blockCount
-
allocationCount
-
allocationCount
-
blockBytes
-
blockBytes
-
allocationBytes
-
allocationBytes
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
segment
Returns the value of thesegmentrecord component.
-