Package org.lwjgl.util.vma
Class VmaDeviceMemoryCallbacks
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.vma.VmaDeviceMemoryCallbacks
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VmaDeviceMemoryCallbacks extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Set of callbacks that the library will call forvkAllocateMemory
andvkFreeMemory
.Provided for informative purpose, e.g. to gather statistics about number of allocations or total amount of memory allocated in Vulkan.
Used in
VmaAllocatorCreateInfo
::pDeviceMemoryCallbacks
.Layout
struct VmaDeviceMemoryCallbacks {
PFN_vmaAllocateDeviceMemoryFunction
pfnAllocate;PFN_vmaFreeDeviceMemoryFunction
pfnFree; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
VmaDeviceMemoryCallbacks.Buffer
An array ofVmaDeviceMemoryCallbacks
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
PFNALLOCATE
PFNFREEThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor Description VmaDeviceMemoryCallbacks(java.nio.ByteBuffer container)
Creates aVmaDeviceMemoryCallbacks
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static VmaDeviceMemoryCallbacks
calloc()
Returns a newVmaDeviceMemoryCallbacks
instance allocated withmemCalloc
.static VmaDeviceMemoryCallbacks.Buffer
calloc(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated withmemCalloc
.static VmaDeviceMemoryCallbacks
callocStack()
Returns a newVmaDeviceMemoryCallbacks
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaDeviceMemoryCallbacks.Buffer
callocStack(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VmaDeviceMemoryCallbacks.Buffer
callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaDeviceMemoryCallbacks
callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaDeviceMemoryCallbacks
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VmaDeviceMemoryCallbacks
create()
Returns a newVmaDeviceMemoryCallbacks
instance allocated withBufferUtils
.static VmaDeviceMemoryCallbacks.Buffer
create(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated withBufferUtils
.static VmaDeviceMemoryCallbacks
create(long address)
Returns a newVmaDeviceMemoryCallbacks
instance for the specified memory address.static VmaDeviceMemoryCallbacks.Buffer
create(long address, int capacity)
Create aVmaDeviceMemoryCallbacks.Buffer
instance at the specified memory.static VmaDeviceMemoryCallbacks
createSafe(long address)
static VmaDeviceMemoryCallbacks.Buffer
createSafe(long address, int capacity)
static VmaDeviceMemoryCallbacks
malloc()
Returns a newVmaDeviceMemoryCallbacks
instance allocated withmemAlloc
.static VmaDeviceMemoryCallbacks.Buffer
malloc(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated withmemAlloc
.static VmaDeviceMemoryCallbacks
mallocStack()
Returns a newVmaDeviceMemoryCallbacks
instance allocated on the thread-localMemoryStack
.static VmaDeviceMemoryCallbacks.Buffer
mallocStack(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated on the thread-localMemoryStack
.static VmaDeviceMemoryCallbacks.Buffer
mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated on the specifiedMemoryStack
.static VmaDeviceMemoryCallbacks
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaDeviceMemoryCallbacks
instance allocated on the specifiedMemoryStack
.static VmaAllocateDeviceMemoryFunction
npfnAllocate(long struct)
Unsafe version ofpfnAllocate()
.static void
npfnAllocate(long struct, VmaAllocateDeviceMemoryFunctionI value)
Unsafe version ofpfnAllocate
.static VmaFreeDeviceMemoryFunction
npfnFree(long struct)
Unsafe version ofpfnFree()
.static void
npfnFree(long struct, VmaFreeDeviceMemoryFunctionI value)
Unsafe version ofpfnFree
.VmaAllocateDeviceMemoryFunction
pfnAllocate()
Returns the value of thepfnAllocate
field.VmaDeviceMemoryCallbacks
pfnAllocate(VmaAllocateDeviceMemoryFunctionI value)
Sets the specified value to thepfnAllocate
field.VmaFreeDeviceMemoryFunction
pfnFree()
Returns the value of thepfnFree
field.VmaDeviceMemoryCallbacks
pfnFree(VmaFreeDeviceMemoryFunctionI value)
Sets the specified value to thepfnFree
field.VmaDeviceMemoryCallbacks
set(VmaAllocateDeviceMemoryFunctionI pfnAllocate, VmaFreeDeviceMemoryFunctionI pfnFree)
Initializes this struct with the specified values.VmaDeviceMemoryCallbacks
set(VmaDeviceMemoryCallbacks src)
Copies the specified struct data to this struct.int
sizeof()
-
-
-
Constructor Detail
-
VmaDeviceMemoryCallbacks
public VmaDeviceMemoryCallbacks(java.nio.ByteBuffer container)
Creates aVmaDeviceMemoryCallbacks
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
-
pfnAllocate
@Nullable public VmaAllocateDeviceMemoryFunction pfnAllocate()
Returns the value of thepfnAllocate
field.
-
pfnFree
@Nullable public VmaFreeDeviceMemoryFunction pfnFree()
Returns the value of thepfnFree
field.
-
pfnAllocate
public VmaDeviceMemoryCallbacks pfnAllocate(@Nullable VmaAllocateDeviceMemoryFunctionI value)
Sets the specified value to thepfnAllocate
field.
-
pfnFree
public VmaDeviceMemoryCallbacks pfnFree(@Nullable VmaFreeDeviceMemoryFunctionI value)
Sets the specified value to thepfnFree
field.
-
set
public VmaDeviceMemoryCallbacks set(VmaAllocateDeviceMemoryFunctionI pfnAllocate, VmaFreeDeviceMemoryFunctionI pfnFree)
Initializes this struct with the specified values.
-
set
public VmaDeviceMemoryCallbacks set(VmaDeviceMemoryCallbacks src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VmaDeviceMemoryCallbacks malloc()
Returns a newVmaDeviceMemoryCallbacks
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VmaDeviceMemoryCallbacks calloc()
Returns a newVmaDeviceMemoryCallbacks
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VmaDeviceMemoryCallbacks create()
Returns a newVmaDeviceMemoryCallbacks
instance allocated withBufferUtils
.
-
create
public static VmaDeviceMemoryCallbacks create(long address)
Returns a newVmaDeviceMemoryCallbacks
instance for the specified memory address.
-
createSafe
@Nullable public static VmaDeviceMemoryCallbacks createSafe(long address)
-
malloc
public static VmaDeviceMemoryCallbacks.Buffer malloc(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VmaDeviceMemoryCallbacks.Buffer calloc(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaDeviceMemoryCallbacks.Buffer create(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VmaDeviceMemoryCallbacks.Buffer create(long address, int capacity)
Create aVmaDeviceMemoryCallbacks.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
createSafe
@Nullable public static VmaDeviceMemoryCallbacks.Buffer createSafe(long address, int capacity)
-
mallocStack
public static VmaDeviceMemoryCallbacks mallocStack()
Returns a newVmaDeviceMemoryCallbacks
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VmaDeviceMemoryCallbacks callocStack()
Returns a newVmaDeviceMemoryCallbacks
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VmaDeviceMemoryCallbacks mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaDeviceMemoryCallbacks
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VmaDeviceMemoryCallbacks callocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVmaDeviceMemoryCallbacks
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VmaDeviceMemoryCallbacks.Buffer mallocStack(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VmaDeviceMemoryCallbacks.Buffer callocStack(int capacity)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VmaDeviceMemoryCallbacks.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VmaDeviceMemoryCallbacks.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVmaDeviceMemoryCallbacks.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
npfnAllocate
@Nullable public static VmaAllocateDeviceMemoryFunction npfnAllocate(long struct)
Unsafe version ofpfnAllocate()
.
-
npfnFree
@Nullable public static VmaFreeDeviceMemoryFunction npfnFree(long struct)
Unsafe version ofpfnFree()
.
-
npfnAllocate
public static void npfnAllocate(long struct, @Nullable VmaAllocateDeviceMemoryFunctionI value)
Unsafe version ofpfnAllocate
.
-
npfnFree
public static void npfnFree(long struct, @Nullable VmaFreeDeviceMemoryFunctionI value)
Unsafe version ofpfnFree
.
-
-