Record Class VmaBudget
- All Implemented Interfaces:
IPointer
,IVmaBudget
Statistics of current memory usage and available budget for a specific memory heap.
These are fast to calculate. See function vmaGetHeapBudgets().
Structure
typedef struct VmaBudget {
VmaStatistics
statistics
;
VkDeviceSize usage
;
VkDeviceSize budget
;
} VmaBudget;
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
statistics()
Statistics fetched from the library.usage()
Estimated current memory usage of the program, in bytes.Fetched from system using VK_EXT_memory_budget extension if enabled.
It might be different than
statistics.blockBytes
(usually higher) due to additional implicit objects also occupying the memory, like swapchain, pipelines, descriptor heaps, command buffers, orVkDeviceMemory
blocks allocated outside of this library, if any.budget()
Estimated amount of memory available to the program, in bytes.Fetched from system using VK_EXT_memory_budget extension if enabled.
It might be different (most probably smaller) than
VkMemoryHeap::size[heapIndex]
due to factors external to the program, decided by the operating system. Differencebudget - usage
is the amount of additional memory that can probably be allocated without problems. Exceeding the budget may result in various problems.
-
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 StructLayout
static final ValueLayout.OfLong
static final long
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionVmaBudget
(@NotNull MemorySegment segment) Creates an instance of aVmaBudget
record class. -
Method Summary
Modifier and TypeMethodDescriptionstatic VmaBudget
static VmaBudget.Ptr
long
budget()
budget
(long value) static VmaBudget
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.@NotNull VmaStatistics
statistics
(@NotNull VmaStatistics value) statistics
(Consumer<@NotNull VmaStatistics> consumer) final String
toString()
Returns a string representation of this record class.long
usage()
usage
(long value)
-
Field Details
-
LAYOUT
-
BYTES
public static final long BYTES -
PATH$statistics
-
PATH$usage
-
PATH$budget
-
LAYOUT$statistics
-
LAYOUT$usage
-
LAYOUT$budget
-
SIZE$statistics
public static final long SIZE$statistics -
SIZE$usage
public static final long SIZE$usage -
SIZE$budget
public static final long SIZE$budget -
OFFSET$statistics
public static final long OFFSET$statistics -
OFFSET$usage
public static final long OFFSET$usage -
OFFSET$budget
public static final long OFFSET$budget
-
-
Constructor Details
-
VmaBudget
Creates an instance of aVmaBudget
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
statistics
-
statistics
-
statistics
-
usage
-
usage
-
budget
-
budget
-
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.
-