Class VmaDefragmentationInfo2

    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • FLAGS, ALLOCATIONCOUNT, PALLOCATIONS, PALLOCATIONSCHANGED, POOLCOUNT, PPOOLS, MAXCPUBYTESTOMOVE, MAXCPUALLOCATIONSTOMOVE, MAXGPUBYTESTOMOVE, MAXGPUALLOCATIONSTOMOVE, COMMANDBUFFER

        The struct member offsets.
    • Constructor Detail

      • VmaDefragmentationInfo2

        public VmaDefragmentationInfo2​(java.nio.ByteBuffer container)
        Creates a VmaDefragmentationInfo2 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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • flags

        public int flags()
        reserved for future use. Should be 0.
      • allocationCount

        public int allocationCount()
        number of allocations in pAllocations array
      • pAllocations

        public org.lwjgl.PointerBuffer pAllocations()
        pointer to array of allocations that can be defragmented.

        The array should have allocationCount elements. The array should not contain nulls. Elements in the array should be unique - same allocation cannot occur twice. All allocations not present in this array are considered non-moveable during this defragmentation.

      • pAllocationsChanged

        @Nullable
        public java.nio.IntBuffer pAllocationsChanged()
        Optional, output. Pointer to array that will be filled with information whether the allocation at certain index has been changed during defragmentation.

        The array should have allocationCount elements. You can pass null if you are not interested in this information.

      • poolCount

        public int poolCount()
        number of pools in pPools array
      • pPools

        @Nullable
        public org.lwjgl.PointerBuffer pPools()
        Either null or pointer to array of pools to be defragmented.

        All the allocations in the specified pools can be moved during defragmentation and there is no way to check if they were really moved as in pAllocationsChanged, so you must query all the allocations in all these pools for new VkDeviceMemory and offset using GetAllocationInfo if you might need to recreate buffers and images bound to them.

        The array should have poolCount elements. The array should not contain nulls. Elements in the array should be unique - same pool cannot occur twice.

        Using this array is equivalent to specifying all allocations from the pools in pAllocations. It might be more efficient.

      • maxCpuBytesToMove

        public long maxCpuBytesToMove()
        maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, like memcpy(), memmove().

        VK_WHOLE_SIZE means no limit.

      • maxCpuAllocationsToMove

        public int maxCpuAllocationsToMove()
        maximum number of allocations that can be moved to a different place using transfers on CPU side, like memcpy(), memmove().

        UINT32_MAX means no limit.

      • maxGpuBytesToMove

        public long maxGpuBytesToMove()
        maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on GPU side, posted to commandBuffer.

        VK_WHOLE_SIZE means no limit.

      • maxGpuAllocationsToMove

        public int maxGpuAllocationsToMove()
        maximum number of allocations that can be moved to a different place using transfers on GPU side, posted to commandBuffer.

        UINT32_MAX means no limit.

      • commandBuffer

        @Nullable
        public long commandBuffer()
        command buffer where GPU copy commands will be posted. Optional.

        If not null, it must be a valid command buffer handle that supports Transfer queue type. It must be in the recording state and outside of a render pass instance. You need to submit it and make sure it finished execution before calling DefragmentationEnd.

        Passing null means that only CPU defragmentation will be performed.

      • pPools

        public VmaDefragmentationInfo2 pPools​(@Nullable
                                              org.lwjgl.PointerBuffer value)
        Sets the address of the specified PointerBuffer to the pPools() field.
      • set

        public VmaDefragmentationInfo2 set​(int flags,
                                           int allocationCount,
                                           org.lwjgl.PointerBuffer pAllocations,
                                           @Nullable
                                           java.nio.IntBuffer pAllocationsChanged,
                                           int poolCount,
                                           @Nullable
                                           org.lwjgl.PointerBuffer pPools,
                                           long maxCpuBytesToMove,
                                           int maxCpuAllocationsToMove,
                                           long maxGpuBytesToMove,
                                           int maxGpuAllocationsToMove,
                                           @Nullable
                                           org.lwjgl.vulkan.VkCommandBuffer commandBuffer)
        Initializes this struct with the specified values.
      • malloc

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

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

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

        public static VmaDefragmentationInfo2 create​(long address)
        Returns a new VmaDefragmentationInfo2 instance for the specified memory address.
      • malloc

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

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

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

        public static int nflags​(long struct)
        Unsafe version of flags().
      • nallocationCount

        public static int nallocationCount​(long struct)
        Unsafe version of allocationCount().
      • npAllocations

        public static org.lwjgl.PointerBuffer npAllocations​(long struct)
        Unsafe version of pAllocations.
      • npAllocationsChanged

        @Nullable
        public static java.nio.IntBuffer npAllocationsChanged​(long struct)
        Unsafe version of pAllocationsChanged.
      • npoolCount

        public static int npoolCount​(long struct)
        Unsafe version of poolCount().
      • npPools

        @Nullable
        public static org.lwjgl.PointerBuffer npPools​(long struct)
        Unsafe version of pPools.
      • nmaxCpuBytesToMove

        public static long nmaxCpuBytesToMove​(long struct)
        Unsafe version of maxCpuBytesToMove().
      • nmaxCpuAllocationsToMove

        public static int nmaxCpuAllocationsToMove​(long struct)
        Unsafe version of maxCpuAllocationsToMove().
      • nmaxGpuBytesToMove

        public static long nmaxGpuBytesToMove​(long struct)
        Unsafe version of maxGpuBytesToMove().
      • nmaxGpuAllocationsToMove

        public static int nmaxGpuAllocationsToMove​(long struct)
        Unsafe version of maxGpuAllocationsToMove().
      • ncommandBuffer

        public static long ncommandBuffer​(long struct)
        Unsafe version of commandBuffer().
      • nflags

        public static void nflags​(long struct,
                                  int value)
        Unsafe version of flags.
      • nallocationCount

        public static void nallocationCount​(long struct,
                                            int value)
        Sets the specified value to the allocationCount field of the specified struct.
      • npAllocations

        public static void npAllocations​(long struct,
                                         org.lwjgl.PointerBuffer value)
        Unsafe version of pAllocations.
      • npAllocationsChanged

        public static void npAllocationsChanged​(long struct,
                                                @Nullable
                                                java.nio.IntBuffer value)
        Unsafe version of pAllocationsChanged.
      • npoolCount

        public static void npoolCount​(long struct,
                                      int value)
        Sets the specified value to the poolCount field of the specified struct.
      • npPools

        public static void npPools​(long struct,
                                   @Nullable
                                   org.lwjgl.PointerBuffer value)
        Unsafe version of pPools.
      • nmaxCpuBytesToMove

        public static void nmaxCpuBytesToMove​(long struct,
                                              long value)
        Unsafe version of maxCpuBytesToMove.
      • nmaxCpuAllocationsToMove

        public static void nmaxCpuAllocationsToMove​(long struct,
                                                    int value)
        Unsafe version of maxCpuAllocationsToMove.
      • nmaxGpuBytesToMove

        public static void nmaxGpuBytesToMove​(long struct,
                                              long value)
        Unsafe version of maxGpuBytesToMove.
      • nmaxGpuAllocationsToMove

        public static void nmaxGpuAllocationsToMove​(long struct,
                                                    int value)
        Unsafe version of maxGpuAllocationsToMove.
      • ncommandBuffer

        public static void ncommandBuffer​(long struct,
                                          @Nullable
                                          org.lwjgl.vulkan.VkCommandBuffer value)
        Unsafe version of commandBuffer.
      • validate

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