Package org.lwjgl.vulkan
Class VkAllocationCallbacks
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkAllocationCallbacks
-
- All Implemented Interfaces:
- java.lang.AutoCloseable, NativeResource, Pointer
public class VkAllocationCallbacks extends Struct
Khronos Reference Page
Vulkan SpecificationContains pointers to callback functions that are used to create, reallocate and free host memory allocations on behalf of a Vulkan implementation.
Valid Usage
pfnAllocation
must be a pointer to a valid user-defined PFN_vkAllocationFunctionpfnReallocation
must be a pointer to a valid user-defined PFN_vkReallocationFunctionpfnFree
must be a pointer to a valid user-defined PFN_vkFreeFunction- If either of
pfnInternalAllocation
orpfnInternalFree
is notNULL
, both must be valid callbacks
Member documentation
pUserData
– a value to be interpreted by the implementation of the callbacks. When any of the callbacks inVkAllocationCallbacks
are called, the Vulkan implementation will pass this value as the first parameter to the callback. This value can vary each time an allocator is passed into a command, even when the same object takes an allocator in multiple commands.pfnAllocation
– a pointer to an application-defined memory allocation function of typePFN_vkAllocationFunction
pfnReallocation
– a pointer to an application-defined memory reallocation function of typePFN_vkReallocationFunction
pfnFree
– a pointer to an application-defined memory free function of typePFN_vkFreeFunction
pfnInternalAllocation
– a pointer to an application-defined function that is called by the implementation when the implementation makes internal allocations, and it is of typePFN_vkInternalAllocationNotification
pfnInternalFree
– a pointer to an application-defined function that is called by the implementation when the implementation frees internal allocations, and it is of typePFN_vkInternalFreeNotification
Layout
struct VkAllocationCallbacks { void * pUserData; PFN_vkAllocationFunction pfnAllocation; PFN_vkReallocationFunction pfnReallocation; PFN_vkFreeFunction pfnFree; PFN_vkInternalAllocationNotification pfnInternalAllocation; PFN_vkInternalFreeNotification pfnInternalFree; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
VkAllocationCallbacks.Buffer
An array ofVkAllocationCallbacks
structs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static int
SIZEOF
The struct size in bytes.-
Fields inherited from interface org.lwjgl.system.Pointer
POINTER_SHIFT, POINTER_SIZE
-
-
Constructor Summary
Constructors Constructor and Description VkAllocationCallbacks(java.nio.ByteBuffer container)
Creates aVkAllocationCallbacks
instance at the current position of the specifiedByteBuffer
container.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static VkAllocationCallbacks
calloc()
Returns a newVkAllocationCallbacks
instance allocated withmemCalloc
.static VkAllocationCallbacks.Buffer
calloc(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated withmemCalloc
.static VkAllocationCallbacks
callocStack()
Returns a newVkAllocationCallbacks
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkAllocationCallbacks.Buffer
callocStack(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.static VkAllocationCallbacks.Buffer
callocStack(int capacity, MemoryStack stack)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkAllocationCallbacks
callocStack(MemoryStack stack)
Returns a newVkAllocationCallbacks
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkAllocationCallbacks
create()
Returns a newVkAllocationCallbacks
instance allocated withBufferUtils
.static VkAllocationCallbacks.Buffer
create(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated withBufferUtils
.static VkAllocationCallbacks
create(long address)
Returns a newVkAllocationCallbacks
instance for the specified memory address ornull
if the address isNULL
.static VkAllocationCallbacks.Buffer
create(long address, int capacity)
Create aVkAllocationCallbacks.Buffer
instance at the specified memory.static VkAllocationCallbacks
malloc()
Returns a newVkAllocationCallbacks
instance allocated withmemAlloc
.static VkAllocationCallbacks.Buffer
malloc(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated withmemAlloc
.static VkAllocationCallbacks
mallocStack()
Returns a newVkAllocationCallbacks
instance allocated on the thread-localMemoryStack
.static VkAllocationCallbacks.Buffer
mallocStack(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the thread-localMemoryStack
.static VkAllocationCallbacks.Buffer
mallocStack(int capacity, MemoryStack stack)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the specifiedMemoryStack
.static VkAllocationCallbacks
mallocStack(MemoryStack stack)
Returns a newVkAllocationCallbacks
instance allocated on the specifiedMemoryStack
.VkAllocationCallbacks
nset(long struct)
Unsafe version ofset
.VkAllocationFunction
pfnAllocation()
Returns theVkAllocationFunction
instance at thepfnAllocation
field.VkAllocationCallbacks
pfnAllocation(VkAllocationFunctionI value)
Sets the address of the specifiedVkAllocationFunctionI
to thepfnAllocation
field.VkFreeFunction
pfnFree()
Returns theVkFreeFunction
instance at thepfnFree
field.VkAllocationCallbacks
pfnFree(VkFreeFunctionI value)
Sets the address of the specifiedVkFreeFunctionI
to thepfnFree
field.VkInternalAllocationNotification
pfnInternalAllocation()
Returns theVkInternalAllocationNotification
instance at thepfnInternalAllocation
field.VkAllocationCallbacks
pfnInternalAllocation(VkInternalAllocationNotificationI value)
Sets the address of the specifiedVkInternalAllocationNotificationI
to thepfnInternalAllocation
field.VkInternalFreeNotification
pfnInternalFree()
Returns theVkInternalFreeNotification
instance at thepfnInternalFree
field.VkAllocationCallbacks
pfnInternalFree(VkInternalFreeNotificationI value)
Sets the address of the specifiedVkInternalFreeNotificationI
to thepfnInternalFree
field.VkReallocationFunction
pfnReallocation()
Returns theVkReallocationFunction
instance at thepfnReallocation
field.VkAllocationCallbacks
pfnReallocation(VkReallocationFunctionI value)
Sets the address of the specifiedVkReallocationFunctionI
to thepfnReallocation
field.long
pUserData()
Returns the value of thepUserData
field.VkAllocationCallbacks
pUserData(long value)
Sets the specified value to thepUserData
field.VkAllocationCallbacks
set(long pUserData, VkAllocationFunctionI pfnAllocation, VkReallocationFunctionI pfnReallocation, VkFreeFunctionI pfnFree, VkInternalAllocationNotificationI pfnInternalAllocation, VkInternalFreeNotificationI pfnInternalFree)
Initializes this struct with the specified values.VkAllocationCallbacks
set(VkAllocationCallbacks src)
Copies the specified struct data to this struct.int
sizeof()
Returns thesizeof(struct)
.static void
validate(long struct)
Validates pointer members that should not beNULL
.static void
validate(long array, int count)
CallsVkAllocationCallbacks.validate(long)
for each struct contained in the specified struct array.-
Methods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toString
-
Methods inherited from interface org.lwjgl.system.NativeResource
close
-
-
-
-
Constructor Detail
-
VkAllocationCallbacks
public VkAllocationCallbacks(java.nio.ByteBuffer container)
Creates aVkAllocationCallbacks
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()
Description copied from class:Struct
Returns thesizeof(struct)
.
-
pUserData
public long pUserData()
Returns the value of thepUserData
field.
-
pfnAllocation
public VkAllocationFunction pfnAllocation()
Returns theVkAllocationFunction
instance at thepfnAllocation
field.
-
pfnReallocation
public VkReallocationFunction pfnReallocation()
Returns theVkReallocationFunction
instance at thepfnReallocation
field.
-
pfnFree
public VkFreeFunction pfnFree()
Returns theVkFreeFunction
instance at thepfnFree
field.
-
pfnInternalAllocation
public VkInternalAllocationNotification pfnInternalAllocation()
Returns theVkInternalAllocationNotification
instance at thepfnInternalAllocation
field.
-
pfnInternalFree
public VkInternalFreeNotification pfnInternalFree()
Returns theVkInternalFreeNotification
instance at thepfnInternalFree
field.
-
pUserData
public VkAllocationCallbacks pUserData(long value)
Sets the specified value to thepUserData
field.
-
pfnAllocation
public VkAllocationCallbacks pfnAllocation(VkAllocationFunctionI value)
Sets the address of the specifiedVkAllocationFunctionI
to thepfnAllocation
field.
-
pfnReallocation
public VkAllocationCallbacks pfnReallocation(VkReallocationFunctionI value)
Sets the address of the specifiedVkReallocationFunctionI
to thepfnReallocation
field.
-
pfnFree
public VkAllocationCallbacks pfnFree(VkFreeFunctionI value)
Sets the address of the specifiedVkFreeFunctionI
to thepfnFree
field.
-
pfnInternalAllocation
public VkAllocationCallbacks pfnInternalAllocation(VkInternalAllocationNotificationI value)
Sets the address of the specifiedVkInternalAllocationNotificationI
to thepfnInternalAllocation
field.
-
pfnInternalFree
public VkAllocationCallbacks pfnInternalFree(VkInternalFreeNotificationI value)
Sets the address of the specifiedVkInternalFreeNotificationI
to thepfnInternalFree
field.
-
set
public VkAllocationCallbacks set(long pUserData, VkAllocationFunctionI pfnAllocation, VkReallocationFunctionI pfnReallocation, VkFreeFunctionI pfnFree, VkInternalAllocationNotificationI pfnInternalAllocation, VkInternalFreeNotificationI pfnInternalFree)
Initializes this struct with the specified values.
-
nset
public VkAllocationCallbacks nset(long struct)
Unsafe version ofset
.
-
set
public VkAllocationCallbacks set(VkAllocationCallbacks src)
Copies the specified struct data to this struct.- Parameters:
src
- the source struct- Returns:
- this struct
-
malloc
public static VkAllocationCallbacks malloc()
Returns a newVkAllocationCallbacks
instance allocated withmemAlloc
. The instance must be explicitly freed.
-
calloc
public static VkAllocationCallbacks calloc()
Returns a newVkAllocationCallbacks
instance allocated withmemCalloc
. The instance must be explicitly freed.
-
create
public static VkAllocationCallbacks create()
Returns a newVkAllocationCallbacks
instance allocated withBufferUtils
.
-
create
public static VkAllocationCallbacks create(long address)
Returns a newVkAllocationCallbacks
instance for the specified memory address ornull
if the address isNULL
.
-
malloc
public static VkAllocationCallbacks.Buffer malloc(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated withmemAlloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
calloc
public static VkAllocationCallbacks.Buffer calloc(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated withmemCalloc
. The instance must be explicitly freed.- Parameters:
capacity
- the buffer capacity
-
create
public static VkAllocationCallbacks.Buffer create(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated withBufferUtils
.- Parameters:
capacity
- the buffer capacity
-
create
public static VkAllocationCallbacks.Buffer create(long address, int capacity)
Create aVkAllocationCallbacks.Buffer
instance at the specified memory.- Parameters:
address
- the memory addresscapacity
- the buffer capacity
-
mallocStack
public static VkAllocationCallbacks mallocStack()
Returns a newVkAllocationCallbacks
instance allocated on the thread-localMemoryStack
.
-
callocStack
public static VkAllocationCallbacks callocStack()
Returns a newVkAllocationCallbacks
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.
-
mallocStack
public static VkAllocationCallbacks mallocStack(MemoryStack stack)
Returns a newVkAllocationCallbacks
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkAllocationCallbacks callocStack(MemoryStack stack)
Returns a newVkAllocationCallbacks
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocate
-
mallocStack
public static VkAllocationCallbacks.Buffer mallocStack(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the thread-localMemoryStack
.- Parameters:
capacity
- the buffer capacity
-
callocStack
public static VkAllocationCallbacks.Buffer callocStack(int capacity)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the thread-localMemoryStack
and initializes all its bits to zero.- Parameters:
capacity
- the buffer capacity
-
mallocStack
public static VkAllocationCallbacks.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
callocStack
public static VkAllocationCallbacks.Buffer callocStack(int capacity, MemoryStack stack)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.- Parameters:
stack
- the stack from which to allocatecapacity
- the buffer capacity
-
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)
CallsVkAllocationCallbacks.validate(long)
for each struct contained in the specified struct array.- Parameters:
array
- the struct array to validatecount
- the number of structs inarray
-
-