Class VmaDefragmentationInfo2
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.vma.VmaDefragmentationInfo2
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VmaDefragmentationInfo2 extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Parameters for defragmentation.To be used with function
DefragmentationBegin
.Member documentation
flags
– reserved for future use. Should be 0.allocationCount
– number of allocations inpAllocations
arraypAllocations
– 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. It is safe to pass allocations that are in the lost state - they are ignored. All allocations not present in this array are considered non-moveable during this defragmentation.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
– number of pools inpPools
arraypPools
– 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 newVkDeviceMemory
and offset usingGetAllocationInfo
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
– Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on CPU side, likememcpy()
,memmove()
.VK_WHOLE_SIZE
means no limit.maxCpuAllocationsToMove
– Maximum number of allocations that can be moved to a different place using transfers on CPU side, likememcpy()
,memmove()
.UINT32_MAX
means no limit.maxGpuBytesToMove
– Maximum total numbers of bytes that can be copied while moving allocations to different places using transfers on GPU side, posted tocommandBuffer
.VK_WHOLE_SIZE
means no limit.maxGpuAllocationsToMove
– Maximum number of allocations that can be moved to a different place using transfers on GPU side, posted tocommandBuffer
.UINT32_MAX
means no limit.commandBuffer
– Optional. Command buffer where GPU copy commands will be posted.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.
Layout
struct VmaDefragmentationInfo2 { VmaDefragmentationFlags flags; uint32_t allocationCount; VmaAllocation * pAllocations; VkBool32 * pAllocationsChanged; uint32_t poolCount; VmaPool * pPools; VkDeviceSize maxCpuBytesToMove; uint32_t maxCpuAllocationsToMove; VkDeviceSize maxGpuBytesToMove; uint32_t maxGpuAllocationsToMove; VkCommandBuffer commandBuffer; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VmaDefragmentationInfo2.Buffer
An array ofVmaDefragmentationInfo2
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
ALLOCATIONCOUNT
COMMANDBUFFER
FLAGS
MAXCPUALLOCATIONSTOMOVE
MAXCPUBYTESTOMOVE
MAXGPUALLOCATIONSTOMOVE
MAXGPUBYTESTOMOVE
PALLOCATIONS
PALLOCATIONSCHANGED
POOLCOUNT
PPOOLSThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VmaDefragmentationInfo2(java.nio.ByteBuffer container)
Creates aVmaDefragmentationInfo2
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
allocationCount()
Returns the value of theallocationCount
field.VmaDefragmentationInfo2
allocationCount(int value)
Sets the specified value to theallocationCount
field.static VmaDefragmentationInfo2
calloc()
Returns a newVmaDefragmentationInfo2
instance allocated withmemCalloc
.static VmaDefragmentationInfo2.Buffer
calloc(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated withmemCalloc
.static VmaDefragmentationInfo2
callocStack()
Returns a newVmaDefragmentationInfo2
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaDefragmentationInfo2.Buffer
callocStack(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaDefragmentationInfo2.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaDefragmentationInfo2
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaDefragmentationInfo2
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.long
commandBuffer()
Returns the value of thecommandBuffer
field.VmaDefragmentationInfo2
commandBuffer(org.lwjgl.vulkan.VkCommandBuffer value)
Sets the specified value to thecommandBuffer
field.static VmaDefragmentationInfo2
create()
Returns a newVmaDefragmentationInfo2
instance allocated withBufferUtils
.static VmaDefragmentationInfo2.Buffer
create(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated withBufferUtils
.static VmaDefragmentationInfo2
create(long address)
Returns a newVmaDefragmentationInfo2
instance for the specified memory address.static VmaDefragmentationInfo2.Buffer
create(long address, int capacity)
Create aVmaDefragmentationInfo2.Buffer
instance at the specified memory.static VmaDefragmentationInfo2
createSafe(long address)
static VmaDefragmentationInfo2.Buffer
createSafe(long address, int capacity)
int
flags()
Returns the value of theflags
field.VmaDefragmentationInfo2
flags(int value)
Sets the specified value to theflags
field.static VmaDefragmentationInfo2
malloc()
Returns a newVmaDefragmentationInfo2
instance allocated withmemAlloc
.static VmaDefragmentationInfo2.Buffer
malloc(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated withmemAlloc
.static VmaDefragmentationInfo2
mallocStack()
Returns a newVmaDefragmentationInfo2
instance allocated on the thread-localMemoryStack
.static VmaDefragmentationInfo2.Buffer
mallocStack(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated on the thread-localMemoryStack
.static VmaDefragmentationInfo2.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated on the specifiedMemoryStack
.static VmaDefragmentationInfo2
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaDefragmentationInfo2
instance allocated on the specifiedMemoryStack
.int
maxCpuAllocationsToMove()
Returns the value of themaxCpuAllocationsToMove
field.VmaDefragmentationInfo2
maxCpuAllocationsToMove(int value)
Sets the specified value to themaxCpuAllocationsToMove
field.long
maxCpuBytesToMove()
Returns the value of themaxCpuBytesToMove
field.VmaDefragmentationInfo2
maxCpuBytesToMove(long value)
Sets the specified value to themaxCpuBytesToMove
field.int
maxGpuAllocationsToMove()
Returns the value of themaxGpuAllocationsToMove
field.VmaDefragmentationInfo2
maxGpuAllocationsToMove(int value)
Sets the specified value to themaxGpuAllocationsToMove
field.long
maxGpuBytesToMove()
Returns the value of themaxGpuBytesToMove
field.VmaDefragmentationInfo2
maxGpuBytesToMove(long value)
Sets the specified value to themaxGpuBytesToMove
field.static int
nallocationCount(long struct)
Unsafe version ofallocationCount()
.static void
nallocationCount(long struct, int value)
Sets the specified value to theallocationCount
field of the specifiedstruct
.static long
ncommandBuffer(long struct)
Unsafe version ofcommandBuffer()
.static void
ncommandBuffer(long struct, org.lwjgl.vulkan.VkCommandBuffer value)
Unsafe version ofcommandBuffer
.static int
nflags(long struct)
Unsafe version offlags()
.static void
nflags(long struct, int value)
Unsafe version offlags
.static int
nmaxCpuAllocationsToMove(long struct)
Unsafe version ofmaxCpuAllocationsToMove()
.static void
nmaxCpuAllocationsToMove(long struct, int value)
Unsafe version ofmaxCpuAllocationsToMove
.static long
nmaxCpuBytesToMove(long struct)
Unsafe version ofmaxCpuBytesToMove()
.static void
nmaxCpuBytesToMove(long struct, long value)
Unsafe version ofmaxCpuBytesToMove
.static int
nmaxGpuAllocationsToMove(long struct)
Unsafe version ofmaxGpuAllocationsToMove()
.static void
nmaxGpuAllocationsToMove(long struct, int value)
Unsafe version ofmaxGpuAllocationsToMove
.static long
nmaxGpuBytesToMove(long struct)
Unsafe version ofmaxGpuBytesToMove()
.static void
nmaxGpuBytesToMove(long struct, long value)
Unsafe version ofmaxGpuBytesToMove
.static org.lwjgl.PointerBuffer
npAllocations(long struct)
Unsafe version ofpAllocations
.static void
npAllocations(long struct, org.lwjgl.PointerBuffer value)
Unsafe version ofpAllocations
.static java.nio.IntBuffer
npAllocationsChanged(long struct)
Unsafe version ofpAllocationsChanged
.static void
npAllocationsChanged(long struct, java.nio.IntBuffer value)
Unsafe version ofpAllocationsChanged
.static int
npoolCount(long struct)
Unsafe version ofpoolCount()
.static void
npoolCount(long struct, int value)
Sets the specified value to thepoolCount
field of the specifiedstruct
.static org.lwjgl.PointerBuffer
npPools(long struct)
Unsafe version ofpPools
.static void
npPools(long struct, org.lwjgl.PointerBuffer value)
Unsafe version ofpPools
.org.lwjgl.PointerBuffer
pAllocations()
Returns aPointerBuffer
view of the data pointed to by thepAllocations
field.VmaDefragmentationInfo2
pAllocations(org.lwjgl.PointerBuffer value)
Sets the address of the specifiedPointerBuffer
to thepAllocations
field.java.nio.IntBuffer
pAllocationsChanged()
Returns aIntBuffer
view of the data pointed to by thepAllocationsChanged
field.VmaDefragmentationInfo2
pAllocationsChanged(java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepAllocationsChanged
field.int
poolCount()
Returns the value of thepoolCount
field.VmaDefragmentationInfo2
poolCount(int value)
Sets the specified value to thepoolCount
field.org.lwjgl.PointerBuffer
pPools()
Returns aPointerBuffer
view of the data pointed to by thepPools
field.VmaDefragmentationInfo2
pPools(org.lwjgl.PointerBuffer value)
Sets the address of the specifiedPointerBuffer
to thepPools
field.VmaDefragmentationInfo2
set(int flags, int allocationCount, org.lwjgl.PointerBuffer pAllocations, java.nio.IntBuffer pAllocationsChanged, int poolCount, org.lwjgl.PointerBuffer pPools, long maxCpuBytesToMove, int maxCpuAllocationsToMove, long maxGpuBytesToMove, int maxGpuAllocationsToMove, org.lwjgl.vulkan.VkCommandBuffer commandBuffer)
Initializes this struct with the specified values.VmaDefragmentationInfo2
set(VmaDefragmentationInfo2 src)
Copies the specified struct data to this struct.int
sizeof()
static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.
-
-
-
Constructor Detail
-
VmaDefragmentationInfo2
public VmaDefragmentationInfo2(java.nio.ByteBuffer container)
Creates aVmaDefragmentationInfo2
instance at the current position of the specifiedByteBuffer
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 classorg.lwjgl.system.Struct
-
flags
public int flags()
Returns the value of theflags
field.
-
allocationCount
public int allocationCount()
Returns the value of theallocationCount
field.
-
pAllocations
public org.lwjgl.PointerBuffer pAllocations()
Returns aPointerBuffer
view of the data pointed to by thepAllocations
field.
-
pAllocationsChanged
@Nullable public java.nio.IntBuffer pAllocationsChanged()
Returns aIntBuffer
view of the data pointed to by thepAllocationsChanged
field.
-
poolCount
public int poolCount()
Returns the value of thepoolCount
field.
-
pPools
@Nullable public org.lwjgl.PointerBuffer pPools()
Returns aPointerBuffer
view of the data pointed to by thepPools
field.
-
maxCpuBytesToMove
public long maxCpuBytesToMove()
Returns the value of themaxCpuBytesToMove
field.
-
maxCpuAllocationsToMove
public int maxCpuAllocationsToMove()
Returns the value of themaxCpuAllocationsToMove
field.
-
maxGpuBytesToMove
public long maxGpuBytesToMove()
Returns the value of themaxGpuBytesToMove
field.
-
maxGpuAllocationsToMove
public int maxGpuAllocationsToMove()
Returns the value of themaxGpuAllocationsToMove
field.
-
commandBuffer
@Nullable public long commandBuffer()
Returns the value of thecommandBuffer
field.
-
flags
public VmaDefragmentationInfo2 flags(int value)
Sets the specified value to theflags
field.
-
allocationCount
public VmaDefragmentationInfo2 allocationCount(int value)
Sets the specified value to theallocationCount
field.
-
pAllocations
public VmaDefragmentationInfo2 pAllocations(org.lwjgl.PointerBuffer value)
Sets the address of the specifiedPointerBuffer
to thepAllocations
field.
-
pAllocationsChanged
public VmaDefragmentationInfo2 pAllocationsChanged(@Nullable java.nio.IntBuffer value)
Sets the address of the specifiedIntBuffer
to thepAllocationsChanged
field.
-
poolCount
public VmaDefragmentationInfo2 poolCount(int value)
Sets the specified value to thepoolCount
field.
-
pPools
public VmaDefragmentationInfo2 pPools(@Nullable org.lwjgl.PointerBuffer value)
Sets the address of the specifiedPointerBuffer
to thepPools
field.
-
maxCpuBytesToMove
public VmaDefragmentationInfo2 maxCpuBytesToMove(long value)
Sets the specified value to themaxCpuBytesToMove
field.
-
maxCpuAllocationsToMove
public VmaDefragmentationInfo2 maxCpuAllocationsToMove(int value)
Sets the specified value to themaxCpuAllocationsToMove
field.
-
maxGpuBytesToMove
public VmaDefragmentationInfo2 maxGpuBytesToMove(long value)
Sets the specified value to themaxGpuBytesToMove
field.
-
maxGpuAllocationsToMove
public VmaDefragmentationInfo2 maxGpuAllocationsToMove(int value)
Sets the specified value to themaxGpuAllocationsToMove
field.
-
commandBuffer
public VmaDefragmentationInfo2 commandBuffer(@Nullable org.lwjgl.vulkan.VkCommandBuffer value)
Sets the specified value to thecommandBuffer
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.
-
set
public VmaDefragmentationInfo2 set(VmaDefragmentationInfo2 src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VmaDefragmentationInfo2 malloc()
Returns a newVmaDefragmentationInfo2
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VmaDefragmentationInfo2 calloc()
Returns a newVmaDefragmentationInfo2
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VmaDefragmentationInfo2 create()
Returns a newVmaDefragmentationInfo2
instance allocated withBufferUtils
.
-
create
public static VmaDefragmentationInfo2 create(long address)
Returns a newVmaDefragmentationInfo2
instance for the specified memory address.
-
createSafe
@Nullable public static VmaDefragmentationInfo2 createSafe(long address)
-
malloc
public static VmaDefragmentationInfo2.Buffer malloc(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VmaDefragmentationInfo2.Buffer calloc(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaDefragmentationInfo2.Buffer create(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaDefragmentationInfo2.Buffer create(long address, int capacity)
Create aVmaDefragmentationInfo2.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VmaDefragmentationInfo2.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VmaDefragmentationInfo2 mallocStack()
Returns a newVmaDefragmentationInfo2
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VmaDefragmentationInfo2 callocStack()
Returns a newVmaDefragmentationInfo2
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VmaDefragmentationInfo2 mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaDefragmentationInfo2
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VmaDefragmentationInfo2 callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaDefragmentationInfo2
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VmaDefragmentationInfo2.Buffer mallocStack(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VmaDefragmentationInfo2.Buffer callocStack(int capacity)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VmaDefragmentationInfo2.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VmaDefragmentationInfo2.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaDefragmentationInfo2.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
nflags
public static int nflags(long struct)
Unsafe version offlags()
.
-
nallocationCount
public static int nallocationCount(long struct)
Unsafe version ofallocationCount()
.
-
npAllocations
public static org.lwjgl.PointerBuffer npAllocations(long struct)
Unsafe version ofpAllocations
.
-
npAllocationsChanged
@Nullable public static java.nio.IntBuffer npAllocationsChanged(long struct)
Unsafe version ofpAllocationsChanged
.
-
npoolCount
public static int npoolCount(long struct)
Unsafe version ofpoolCount()
.
-
npPools
@Nullable public static org.lwjgl.PointerBuffer npPools(long struct)
Unsafe version ofpPools
.
-
nmaxCpuBytesToMove
public static long nmaxCpuBytesToMove(long struct)
Unsafe version ofmaxCpuBytesToMove()
.
-
nmaxCpuAllocationsToMove
public static int nmaxCpuAllocationsToMove(long struct)
Unsafe version ofmaxCpuAllocationsToMove()
.
-
nmaxGpuBytesToMove
public static long nmaxGpuBytesToMove(long struct)
Unsafe version ofmaxGpuBytesToMove()
.
-
nmaxGpuAllocationsToMove
public static int nmaxGpuAllocationsToMove(long struct)
Unsafe version ofmaxGpuAllocationsToMove()
.
-
ncommandBuffer
public static long ncommandBuffer(long struct)
Unsafe version ofcommandBuffer()
.
-
nflags
public static void nflags(long struct, int value)
Unsafe version offlags
.
-
nallocationCount
public static void nallocationCount(long struct, int value)
Sets the specified value to theallocationCount
field of the specifiedstruct
.
-
npAllocations
public static void npAllocations(long struct, org.lwjgl.PointerBuffer value)
Unsafe version ofpAllocations
.
-
npAllocationsChanged
public static void npAllocationsChanged(long struct, @Nullable java.nio.IntBuffer value)
Unsafe version ofpAllocationsChanged
.
-
npoolCount
public static void npoolCount(long struct, int value)
Sets the specified value to thepoolCount
field of the specifiedstruct
.
-
npPools
public static void npPools(long struct, @Nullable org.lwjgl.PointerBuffer value)
Unsafe version ofpPools
.
-
nmaxCpuBytesToMove
public static void nmaxCpuBytesToMove(long struct, long value)
Unsafe version ofmaxCpuBytesToMove
.
-
nmaxCpuAllocationsToMove
public static void nmaxCpuAllocationsToMove(long struct, int value)
Unsafe version ofmaxCpuAllocationsToMove
.
-
nmaxGpuBytesToMove
public static void nmaxGpuBytesToMove(long struct, long value)
Unsafe version ofmaxGpuBytesToMove
.
-
nmaxGpuAllocationsToMove
public static void nmaxGpuAllocationsToMove(long struct, int value)
Unsafe version ofmaxGpuAllocationsToMove
.
-
ncommandBuffer
public static void ncommandBuffer(long struct, @Nullable org.lwjgl.vulkan.VkCommandBuffer value)
Unsafe version ofcommandBuffer
.
-
validate
public static void validate(long struct)
Validates pointer members that should not beNULL
.- Parameters:
struct
- the struct to validate
-
validate
public static void validate(long array, int count)
Callsvalidate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-