Class VmaDefragmentationMove

java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<VmaDefragmentationMove>
org.lwjgl.util.vma.VmaDefragmentationMove
All Implemented Interfaces:
AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

public class VmaDefragmentationMove extends org.lwjgl.system.Struct<VmaDefragmentationMove> implements org.lwjgl.system.NativeResource
Single move of an allocation to be done for defragmentation.

Layout


 struct VmaDefragmentationMove {
     VmaDefragmentationMoveOperation operation();
     VmaAllocation srcAllocation();
     VmaAllocation dstTmpAllocation();
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • OPERATION

      public static final int OPERATION
      The struct member offsets.
    • SRCALLOCATION

      public static final int SRCALLOCATION
      The struct member offsets.
    • DSTTMPALLOCATION

      public static final int DSTTMPALLOCATION
      The struct member offsets.
  • Constructor Details

    • VmaDefragmentationMove

      public VmaDefragmentationMove(ByteBuffer container)
      Creates a VmaDefragmentationMove instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

      The created instance holds a strong reference to the container object.

  • Method Details

    • sizeof

      public int sizeof()
      Specified by:
      sizeof in class org.lwjgl.system.Struct<VmaDefragmentationMove>
    • operation

      public int operation()
      operation to be performed on the allocation by EndDefragmentationPass.

      Default value is DEFRAGMENTATION_MOVE_OPERATION_COPY. You can modify it.

    • srcAllocation

      public long srcAllocation()
      allocation that should be moved
    • dstTmpAllocation

      public long dstTmpAllocation()
      temporary allocation pointing to destination memory that will replace srcAllocation.

      Warning: Do not store this allocation in your data structures! It exists only temporarily, for the duration of the defragmentation pass, to be used for binding new buffer/image to the destination memory using e.g. BindBufferMemory. EndDefragmentationPass will destroy it and make srcAllocation point to this memory.

    • operation

      public VmaDefragmentationMove operation(int value)
      Sets the specified value to the operation() field.
    • srcAllocation

      public VmaDefragmentationMove srcAllocation(long value)
      Sets the specified value to the srcAllocation() field.
    • dstTmpAllocation

      public VmaDefragmentationMove dstTmpAllocation(long value)
      Sets the specified value to the dstTmpAllocation() field.
    • set

      public VmaDefragmentationMove set(int operation, long srcAllocation, long dstTmpAllocation)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

      public static VmaDefragmentationMove malloc()
      Returns a new VmaDefragmentationMove instance allocated with memAlloc. The instance must be explicitly freed.
    • calloc

      public static VmaDefragmentationMove calloc()
      Returns a new VmaDefragmentationMove instance allocated with memCalloc. The instance must be explicitly freed.
    • create

      public static VmaDefragmentationMove create()
      Returns a new VmaDefragmentationMove instance allocated with BufferUtils.
    • create

      public static VmaDefragmentationMove create(long address)
      Returns a new VmaDefragmentationMove instance for the specified memory address.
    • createSafe

      public static @Nullable VmaDefragmentationMove createSafe(long address)
      Like create, but returns null if address is NULL.
    • malloc

      public static VmaDefragmentationMove.Buffer malloc(int capacity)
      Returns a new VmaDefragmentationMove.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • calloc

      public static VmaDefragmentationMove.Buffer calloc(int capacity)
      Returns a new VmaDefragmentationMove.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VmaDefragmentationMove.Buffer create(int capacity)
      Returns a new VmaDefragmentationMove.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

      public static VmaDefragmentationMove.Buffer create(long address, int capacity)
      Create a VmaDefragmentationMove.Buffer instance at the specified memory.
      Parameters:
      address - the memory address
      capacity - the buffer capacity
    • createSafe

      public static @Nullable VmaDefragmentationMove.Buffer createSafe(long address, int capacity)
      Like create, but returns null if address is NULL.
    • malloc

      public static VmaDefragmentationMove malloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VmaDefragmentationMove instance allocated on the specified MemoryStack.
      Parameters:
      stack - the stack from which to allocate
    • calloc

      public static VmaDefragmentationMove calloc(org.lwjgl.system.MemoryStack stack)
      Returns a new VmaDefragmentationMove instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static VmaDefragmentationMove.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VmaDefragmentationMove.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

      public static VmaDefragmentationMove.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
      Returns a new VmaDefragmentationMove.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • noperation

      public static int noperation(long struct)
      Unsafe version of operation().
    • nsrcAllocation

      public static long nsrcAllocation(long struct)
      Unsafe version of srcAllocation().
    • ndstTmpAllocation

      public static long ndstTmpAllocation(long struct)
      Unsafe version of dstTmpAllocation().
    • noperation

      public static void noperation(long struct, int value)
      Unsafe version of operation.
    • nsrcAllocation

      public static void nsrcAllocation(long struct, long value)
      Unsafe version of srcAllocation.
    • ndstTmpAllocation

      public static void ndstTmpAllocation(long struct, long value)
      Unsafe version of dstTmpAllocation.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate