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 ofVmaAllocation
objects allocated.Dedicated allocations have their own blocks, so each one adds 1 to
allocationCount
as 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
VkDeviceMemory
object (e.g. as inVkPhysicalDeviceLimits::maxMemoryAllocationCount
) is called a "block" in VMA, while VMA calls "allocation" aVmaAllocation
object that represents a memory region sub-allocated from such block, usually for a single buffer or image.allocationBytes()
Total number of bytes occupied by allVmaAllocation
objects.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 record
Represents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final long
static final StructLayout
static final ValueLayout.OfLong
static final ValueLayout.OfInt
static final ValueLayout.OfLong
static final ValueLayout.OfInt
static final long
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionVmaStatistics
(@NotNull MemorySegment segment) Creates an instance of aVmaStatistics
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaStatistics
static VmaStatistics.Ptr
long
allocationBytes
(long value) int
allocationCount
(int value) long
blockBytes
(long value) int
blockCount
(int value) static VmaStatistics
clone
(Arena arena, VmaStatistics src) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.@NotNull MemorySegment
segment()
Returns the value of thesegment
record component.final String
toString()
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 aVmaStatistics
record class.- Parameters:
segment
- the value for thesegment
record 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 thesegment
record component.
-