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
pfnAllocationmust be a pointer to a valid user-defined PFN_vkAllocationFunctionpfnReallocationmust be a pointer to a valid user-defined PFN_vkReallocationFunctionpfnFreemust be a pointer to a valid user-defined PFN_vkFreeFunction- If either of
pfnInternalAllocationorpfnInternalFreeis 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 inVkAllocationCallbacksare 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_vkAllocationFunctionpfnReallocation– a pointer to an application-defined memory reallocation function of typePFN_vkReallocationFunctionpfnFree– a pointer to an application-defined memory free function of typePFN_vkFreeFunctionpfnInternalAllocation– a pointer to an application-defined function that is called by the implementation when the implementation makes internal allocations, and it is of typePFN_vkInternalAllocationNotificationpfnInternalFree– 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 classVkAllocationCallbacks.BufferAn array ofVkAllocationCallbacksstructs.-
Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer
Pointer.Default
-
-
Field Summary
Fields Modifier and Type Field and Description static intSIZEOFThe 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 aVkAllocationCallbacksinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method and Description static VkAllocationCallbackscalloc()Returns a newVkAllocationCallbacksinstance allocated withmemCalloc.static VkAllocationCallbacks.Buffercalloc(int capacity)Returns a newVkAllocationCallbacks.Bufferinstance allocated withmemCalloc.static VkAllocationCallbackscallocStack()Returns a newVkAllocationCallbacksinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkAllocationCallbacks.BuffercallocStack(int capacity)Returns a newVkAllocationCallbacks.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.static VkAllocationCallbacks.BuffercallocStack(int capacity, MemoryStack stack)Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAllocationCallbackscallocStack(MemoryStack stack)Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAllocationCallbackscreate()Returns a newVkAllocationCallbacksinstance allocated withBufferUtils.static VkAllocationCallbacks.Buffercreate(int capacity)Returns a newVkAllocationCallbacks.Bufferinstance allocated withBufferUtils.static VkAllocationCallbackscreate(long address)Returns a newVkAllocationCallbacksinstance for the specified memory address ornullif the address isNULL.static VkAllocationCallbacks.Buffercreate(long address, int capacity)Create aVkAllocationCallbacks.Bufferinstance at the specified memory.static VkAllocationCallbacksmalloc()Returns a newVkAllocationCallbacksinstance allocated withmemAlloc.static VkAllocationCallbacks.Buffermalloc(int capacity)Returns a newVkAllocationCallbacks.Bufferinstance allocated withmemAlloc.static VkAllocationCallbacksmallocStack()Returns a newVkAllocationCallbacksinstance allocated on the thread-localMemoryStack.static VkAllocationCallbacks.BuffermallocStack(int capacity)Returns a newVkAllocationCallbacks.Bufferinstance allocated on the thread-localMemoryStack.static VkAllocationCallbacks.BuffermallocStack(int capacity, MemoryStack stack)Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStack.static VkAllocationCallbacksmallocStack(MemoryStack stack)Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStack.VkAllocationCallbacksnset(long struct)Unsafe version ofset.VkAllocationFunctionpfnAllocation()Returns theVkAllocationFunctioninstance at thepfnAllocationfield.VkAllocationCallbackspfnAllocation(VkAllocationFunctionI value)Sets the address of the specifiedVkAllocationFunctionIto thepfnAllocationfield.VkFreeFunctionpfnFree()Returns theVkFreeFunctioninstance at thepfnFreefield.VkAllocationCallbackspfnFree(VkFreeFunctionI value)Sets the address of the specifiedVkFreeFunctionIto thepfnFreefield.VkInternalAllocationNotificationpfnInternalAllocation()Returns theVkInternalAllocationNotificationinstance at thepfnInternalAllocationfield.VkAllocationCallbackspfnInternalAllocation(VkInternalAllocationNotificationI value)Sets the address of the specifiedVkInternalAllocationNotificationIto thepfnInternalAllocationfield.VkInternalFreeNotificationpfnInternalFree()Returns theVkInternalFreeNotificationinstance at thepfnInternalFreefield.VkAllocationCallbackspfnInternalFree(VkInternalFreeNotificationI value)Sets the address of the specifiedVkInternalFreeNotificationIto thepfnInternalFreefield.VkReallocationFunctionpfnReallocation()Returns theVkReallocationFunctioninstance at thepfnReallocationfield.VkAllocationCallbackspfnReallocation(VkReallocationFunctionI value)Sets the address of the specifiedVkReallocationFunctionIto thepfnReallocationfield.longpUserData()Returns the value of thepUserDatafield.VkAllocationCallbackspUserData(long value)Sets the specified value to thepUserDatafield.VkAllocationCallbacksset(long pUserData, VkAllocationFunctionI pfnAllocation, VkReallocationFunctionI pfnReallocation, VkFreeFunctionI pfnFree, VkInternalAllocationNotificationI pfnInternalAllocation, VkInternalFreeNotificationI pfnInternalFree)Initializes this struct with the specified values.VkAllocationCallbacksset(VkAllocationCallbacks src)Copies the specified struct data to this struct.intsizeof()Returns thesizeof(struct).static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(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 aVkAllocationCallbacksinstance at the current position of the specifiedByteBuffercontainer. 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:StructReturns thesizeof(struct).
-
pUserData
public long pUserData()
Returns the value of thepUserDatafield.
-
pfnAllocation
public VkAllocationFunction pfnAllocation()
Returns theVkAllocationFunctioninstance at thepfnAllocationfield.
-
pfnReallocation
public VkReallocationFunction pfnReallocation()
Returns theVkReallocationFunctioninstance at thepfnReallocationfield.
-
pfnFree
public VkFreeFunction pfnFree()
Returns theVkFreeFunctioninstance at thepfnFreefield.
-
pfnInternalAllocation
public VkInternalAllocationNotification pfnInternalAllocation()
Returns theVkInternalAllocationNotificationinstance at thepfnInternalAllocationfield.
-
pfnInternalFree
public VkInternalFreeNotification pfnInternalFree()
Returns theVkInternalFreeNotificationinstance at thepfnInternalFreefield.
-
pUserData
public VkAllocationCallbacks pUserData(long value)
Sets the specified value to thepUserDatafield.
-
pfnAllocation
public VkAllocationCallbacks pfnAllocation(VkAllocationFunctionI value)
Sets the address of the specifiedVkAllocationFunctionIto thepfnAllocationfield.
-
pfnReallocation
public VkAllocationCallbacks pfnReallocation(VkReallocationFunctionI value)
Sets the address of the specifiedVkReallocationFunctionIto thepfnReallocationfield.
-
pfnFree
public VkAllocationCallbacks pfnFree(VkFreeFunctionI value)
Sets the address of the specifiedVkFreeFunctionIto thepfnFreefield.
-
pfnInternalAllocation
public VkAllocationCallbacks pfnInternalAllocation(VkInternalAllocationNotificationI value)
Sets the address of the specifiedVkInternalAllocationNotificationIto thepfnInternalAllocationfield.
-
pfnInternalFree
public VkAllocationCallbacks pfnInternalFree(VkInternalFreeNotificationI value)
Sets the address of the specifiedVkInternalFreeNotificationIto thepfnInternalFreefield.
-
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 newVkAllocationCallbacksinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static VkAllocationCallbacks calloc()
Returns a newVkAllocationCallbacksinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static VkAllocationCallbacks create()
Returns a newVkAllocationCallbacksinstance allocated withBufferUtils.
-
create
public static VkAllocationCallbacks create(long address)
Returns a newVkAllocationCallbacksinstance for the specified memory address ornullif the address isNULL.
-
malloc
public static VkAllocationCallbacks.Buffer malloc(int capacity)
Returns a newVkAllocationCallbacks.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static VkAllocationCallbacks.Buffer calloc(int capacity)
Returns a newVkAllocationCallbacks.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static VkAllocationCallbacks.Buffer create(int capacity)
Returns a newVkAllocationCallbacks.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static VkAllocationCallbacks.Buffer create(long address, int capacity)
Create aVkAllocationCallbacks.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
mallocStack
public static VkAllocationCallbacks mallocStack()
Returns a newVkAllocationCallbacksinstance allocated on the thread-localMemoryStack.
-
callocStack
public static VkAllocationCallbacks callocStack()
Returns a newVkAllocationCallbacksinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.
-
mallocStack
public static VkAllocationCallbacks mallocStack(MemoryStack stack)
Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkAllocationCallbacks callocStack(MemoryStack stack)
Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStackand 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.Bufferinstance allocated on the thread-localMemoryStack.- Parameters:
capacity- the buffer capacity
-
callocStack
public static VkAllocationCallbacks.Buffer callocStack(int capacity)
Returns a newVkAllocationCallbacks.Bufferinstance allocated on the thread-localMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacity
-
mallocStack
public static VkAllocationCallbacks.Buffer mallocStack(int capacity, MemoryStack stack)
Returns a newVkAllocationCallbacks.Bufferinstance 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.Bufferinstance allocated on the specifiedMemoryStackand 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
-
-