Record Class VmaDefragmentationPassMoveInfo
- All Implemented Interfaces:
IPointer
,IVmaDefragmentationPassMoveInfo
Parameters for incremental defragmentation steps.
To be used with function vmaBeginDefragmentationPass().
Structure
typedef struct VmaDefragmentationPassMoveInfo {
uint32_t moveCount
;
VmaDefragmentationMove
* pMoves
; // optional
} VmaDefragmentationPassMoveInfo;
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
moveCount()
Number of elements in the `pMoves` array.pMoves(club.doki7.vma.datatype.IVmaDefragmentationMove)
Array of moves to be performed by the user in the current defragmentation pass.Pointer to an array of
moveCount
elements, owned by VMA, created in vmaBeginDefragmentationPass(), destroyed in vmaEndDefragmentationPass().For each element, you should:
- Create a new buffer/image in the place pointed by VmaDefragmentationMove::dstMemory + VmaDefragmentationMove::dstOffset.
- Copy data from the VmaDefragmentationMove::srcAllocation e.g. using
vkCmdCopyBuffer
,vkCmdCopyImage
. - Make sure these commands finished executing on the GPU.
- Destroy the old buffer/image.
Only then you can finish defragmentation pass by calling vmaEndDefragmentationPass(). After this call, the allocation will point to the new place in memory.
Alternatively, if you cannot move specific allocation, you can set VmaDefragmentationMove::operation to
VMA_DEFRAGMENTATION_MOVE_OPERATION_IGNORE
.Alternatively, if you decide you want to completely remove the allocation:
- Destroy its buffer/image.
- Set VmaDefragmentationMove::operation to
VMA_DEFRAGMENTATION_MOVE_OPERATION_DESTROY
.
Then, after vmaEndDefragmentationPass() the allocation will be freed.
-
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.OfInt
static final AddressLayout
static final long
static final long
static final MemoryLayout.PathElement
static final MemoryLayout.PathElement
static final long
static final long
-
Constructor Summary
ConstructorsConstructorDescriptionVmaDefragmentationPassMoveInfo
(@NotNull MemorySegment segment) Creates an instance of aVmaDefragmentationPassMoveInfo
record class. -
Method Summary
Modifier and TypeMethodDescriptionclone
(Arena arena, VmaDefragmentationPassMoveInfo src) final boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.int
moveCount
(int value) @Nullable VmaDefragmentationMove
pMoves()
pMoves
(int assumedCount) pMoves
(@Nullable IVmaDefragmentationMove value) void
pMovesRaw
(MemorySegment value) @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$moveCount
-
PATH$pMoves
-
LAYOUT$moveCount
-
LAYOUT$pMoves
-
SIZE$moveCount
public static final long SIZE$moveCount -
SIZE$pMoves
public static final long SIZE$pMoves -
OFFSET$moveCount
public static final long OFFSET$moveCount -
OFFSET$pMoves
public static final long OFFSET$pMoves
-
-
Constructor Details
-
VmaDefragmentationPassMoveInfo
Creates an instance of aVmaDefragmentationPassMoveInfo
record class.- Parameters:
segment
- the value for thesegment
record component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
moveCount
-
moveCount
-
pMoves
-
pMoves
-
pMoves
-
pMovesRaw
-
pMovesRaw
-
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.
-