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
moveCountelements, 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 recordRepresents a pointer to / an array of null structure(s) in native memory. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final StructLayoutstatic final ValueLayout.OfIntstatic final AddressLayoutstatic final longstatic final longstatic final MemoryLayout.PathElementstatic final MemoryLayout.PathElementstatic final longstatic final long -
Constructor Summary
ConstructorsConstructorDescriptionVmaDefragmentationPassMoveInfo(@NotNull MemorySegment segment) Creates an instance of aVmaDefragmentationPassMoveInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionclone(Arena arena, VmaDefragmentationPassMoveInfo src) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmoveCount(int value) @Nullable VmaDefragmentationMovepMoves()pMoves(int assumedCount) pMoves(@Nullable IVmaDefragmentationMove value) @NotNull MemorySegmentvoidpMovesRaw(@NotNull MemorySegment value) @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$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 aVmaDefragmentationPassMoveInforecord class.- Parameters:
segment- the value for thesegmentrecord component
-
-
Method Details
-
allocate
-
allocate
-
clone
-
moveCount
-
moveCount
-
pMoves
-
pMoves
-
pMoves
-
pMovesRaw
-
pMovesRaw
public void pMovesRaw(@Pointer(target=VmaDefragmentationMove.class) @NotNull @NotNull MemorySegment value) -
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.
-