Class VkAllocationCallbacks
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.vulkan.VkAllocationCallbacks
-
- All Implemented Interfaces:
java.lang.AutoCloseable
,org.lwjgl.system.NativeResource
,org.lwjgl.system.Pointer
public class VkAllocationCallbacks extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResource
Structure containing callback function pointers for memory allocation.Valid Usage
pfnAllocation
must be a valid pointer to a valid user-definedVkAllocationFunction
pfnReallocation
must be a valid pointer to a valid user-definedVkReallocationFunction
pfnFree
must be a valid pointer to a valid user-definedVkFreeFunction
- If either of
pfnInternalAllocation
orpfnInternalFree
is notNULL
, both must be valid callbacks
See Also
VkAllocationFunction
,VkFreeFunction
,VkInternalAllocationNotification
,VkInternalFreeNotification
,VkReallocationFunction
,AllocateMemory
,CreateAccelerationStructureNV
,CreateBuffer
,CreateBufferView
,CreateCommandPool
,CreateComputePipelines
,CreateDebugReportCallbackEXT
,CreateDebugUtilsMessengerEXT
,CreateDescriptorPool
,CreateDescriptorSetLayout
,CreateDescriptorUpdateTemplate
,CreateDescriptorUpdateTemplateKHR
,CreateDevice
,CreateDisplayModeKHR
,CreateDisplayPlaneSurfaceKHR
,CreateEvent
,CreateFence
,CreateFramebuffer
,CreateGraphicsPipelines
,CreateHeadlessSurfaceEXT
,CreateImage
,CreateImageView
,CreateIndirectCommandsLayoutNVX
,CreateInstance
,CreateMacOSSurfaceMVK
,CreateMetalSurfaceEXT
,CreateObjectTableNVX
,CreatePipelineCache
,CreatePipelineLayout
,CreateQueryPool
,CreateRayTracingPipelinesNV
,CreateRenderPass
,CreateRenderPass2KHR
,CreateSampler
,CreateSamplerYcbcrConversion
,CreateSamplerYcbcrConversionKHR
,CreateSemaphore
,CreateShaderModule
,CreateSharedSwapchainsKHR
,CreateSwapchainKHR
,CreateValidationCacheEXT
,CreateWaylandSurfaceKHR
,CreateWin32SurfaceKHR
,CreateXlibSurfaceKHR
,DestroyAccelerationStructureNV
,DestroyBuffer
,DestroyBufferView
,DestroyCommandPool
,DestroyDebugReportCallbackEXT
,DestroyDebugUtilsMessengerEXT
,DestroyDescriptorPool
,DestroyDescriptorSetLayout
,DestroyDescriptorUpdateTemplate
,DestroyDescriptorUpdateTemplateKHR
,DestroyDevice
,DestroyEvent
,DestroyFence
,DestroyFramebuffer
,DestroyImage
,DestroyImageView
,DestroyIndirectCommandsLayoutNVX
,DestroyInstance
,DestroyObjectTableNVX
,DestroyPipeline
,DestroyPipelineCache
,DestroyPipelineLayout
,DestroyQueryPool
,DestroyRenderPass
,DestroySampler
,DestroySamplerYcbcrConversion
,DestroySamplerYcbcrConversionKHR
,DestroySemaphore
,DestroyShaderModule
,DestroySurfaceKHR
,DestroySwapchainKHR
,DestroyValidationCacheEXT
,FreeMemory
,RegisterDeviceEventEXT
,RegisterDisplayEventEXT
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 typeVkAllocationFunction
.pfnReallocation
– a pointer to an application-defined memory reallocation function of typeVkReallocationFunction
.pfnFree
– a pointer to an application-defined memory free function of typeVkFreeFunction
.pfnInternalAllocation
– a pointer to an application-defined function that is called by the implementation when the implementation makes internal allocations, and it is of typeVkInternalAllocationNotification
.pfnInternalFree
– a pointer to an application-defined function that is called by the implementation when the implementation frees internal allocations, and it is of typeVkInternalFreeNotification
.
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 Description static class
VkAllocationCallbacks.Buffer
An array ofVkAllocationCallbacks
structs.
-
Field Summary
Fields Modifier and Type Field Description static int
ALIGNOF
The struct alignment in bytes.static int
PFNALLOCATION
PFNFREE
PFNINTERNALALLOCATION
PFNINTERNALFREE
PFNREALLOCATION
PUSERDATAThe struct member offsets.static int
SIZEOF
The struct size in bytes.
-
Constructor Summary
Constructors Constructor 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 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, org.lwjgl.system.MemoryStack stack)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the specifiedMemoryStack
and initializes all its bits to zero.static VkAllocationCallbacks
callocStack(org.lwjgl.system.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.static VkAllocationCallbacks.Buffer
create(long address, int capacity)
Create aVkAllocationCallbacks.Buffer
instance at the specified memory.static VkAllocationCallbacks
createSafe(long address)
static VkAllocationCallbacks.Buffer
createSafe(long address, int capacity)
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, org.lwjgl.system.MemoryStack stack)
Returns a newVkAllocationCallbacks.Buffer
instance allocated on the specifiedMemoryStack
.static VkAllocationCallbacks
mallocStack(org.lwjgl.system.MemoryStack stack)
Returns a newVkAllocationCallbacks
instance allocated on the specifiedMemoryStack
.static VkAllocationFunction
npfnAllocation(long struct)
Unsafe version ofpfnAllocation()
.static void
npfnAllocation(long struct, VkAllocationFunctionI value)
Unsafe version ofpfnAllocation
.static VkFreeFunction
npfnFree(long struct)
Unsafe version ofpfnFree()
.static void
npfnFree(long struct, VkFreeFunctionI value)
Unsafe version ofpfnFree
.static VkInternalAllocationNotification
npfnInternalAllocation(long struct)
Unsafe version ofpfnInternalAllocation()
.static void
npfnInternalAllocation(long struct, VkInternalAllocationNotificationI value)
Unsafe version ofpfnInternalAllocation
.static VkInternalFreeNotification
npfnInternalFree(long struct)
Unsafe version ofpfnInternalFree()
.static void
npfnInternalFree(long struct, VkInternalFreeNotificationI value)
Unsafe version ofpfnInternalFree
.static VkReallocationFunction
npfnReallocation(long struct)
Unsafe version ofpfnReallocation()
.static void
npfnReallocation(long struct, VkReallocationFunctionI value)
Unsafe version ofpfnReallocation
.static long
npUserData(long struct)
Unsafe version ofpUserData()
.static void
npUserData(long struct, long value)
Unsafe version ofpUserData
.VkAllocationFunction
pfnAllocation()
Returns the value of thepfnAllocation
field.VkAllocationCallbacks
pfnAllocation(VkAllocationFunctionI value)
Sets the specified value to thepfnAllocation
field.VkFreeFunction
pfnFree()
Returns the value of thepfnFree
field.VkAllocationCallbacks
pfnFree(VkFreeFunctionI value)
Sets the specified value to thepfnFree
field.VkInternalAllocationNotification
pfnInternalAllocation()
Returns the value of thepfnInternalAllocation
field.VkAllocationCallbacks
pfnInternalAllocation(VkInternalAllocationNotificationI value)
Sets the specified value to thepfnInternalAllocation
field.VkInternalFreeNotification
pfnInternalFree()
Returns the value of thepfnInternalFree
field.VkAllocationCallbacks
pfnInternalFree(VkInternalFreeNotificationI value)
Sets the specified value to thepfnInternalFree
field.VkReallocationFunction
pfnReallocation()
Returns the value of thepfnReallocation
field.VkAllocationCallbacks
pfnReallocation(VkReallocationFunctionI value)
Sets the specified value 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()
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
-
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()
- Specified by:
sizeof
in classorg.lwjgl.system.Struct
-
pUserData
public long pUserData()
Returns the value of thepUserData
field.
-
pfnAllocation
public VkAllocationFunction pfnAllocation()
Returns the value of thepfnAllocation
field.
-
pfnReallocation
public VkReallocationFunction pfnReallocation()
Returns the value of thepfnReallocation
field.
-
pfnFree
public VkFreeFunction pfnFree()
Returns the value of thepfnFree
field.
-
pfnInternalAllocation
@Nullable public VkInternalAllocationNotification pfnInternalAllocation()
Returns the value of thepfnInternalAllocation
field.
-
pfnInternalFree
@Nullable public VkInternalFreeNotification pfnInternalFree()
Returns the value of thepfnInternalFree
field.
-
pUserData
public VkAllocationCallbacks pUserData(long value)
Sets the specified value to thepUserData
field.
-
pfnAllocation
public VkAllocationCallbacks pfnAllocation(VkAllocationFunctionI value)
Sets the specified value to thepfnAllocation
field.
-
pfnReallocation
public VkAllocationCallbacks pfnReallocation(VkReallocationFunctionI value)
Sets the specified value to thepfnReallocation
field.
-
pfnFree
public VkAllocationCallbacks pfnFree(VkFreeFunctionI value)
Sets the specified value to thepfnFree
field.
-
pfnInternalAllocation
public VkAllocationCallbacks pfnInternalAllocation(@Nullable VkInternalAllocationNotificationI value)
Sets the specified value to thepfnInternalAllocation
field.
-
pfnInternalFree
public VkAllocationCallbacks pfnInternalFree(@Nullable VkInternalFreeNotificationI value)
Sets the specified value 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.
-
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.
-
createSafe
@Nullable public static VkAllocationCallbacks createSafe(long address)
-
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
-
createSafe
@Nullable public static VkAllocationCallbacks.Buffer createSafe(long address, int 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(org.lwjgl.system.MemoryStack stack)
Returns a newVkAllocationCallbacks
instance allocated on the specifiedMemoryStack
.- Parameters:
stack
- the stack from which to allocate
-
callocStack
public static VkAllocationCallbacks callocStack(org.lwjgl.system.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, org.lwjgl.system.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, org.lwjgl.system.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
-
npUserData
public static long npUserData(long struct)
Unsafe version ofpUserData()
.
-
npfnAllocation
public static VkAllocationFunction npfnAllocation(long struct)
Unsafe version ofpfnAllocation()
.
-
npfnReallocation
public static VkReallocationFunction npfnReallocation(long struct)
Unsafe version ofpfnReallocation()
.
-
npfnFree
public static VkFreeFunction npfnFree(long struct)
Unsafe version ofpfnFree()
.
-
npfnInternalAllocation
@Nullable public static VkInternalAllocationNotification npfnInternalAllocation(long struct)
Unsafe version ofpfnInternalAllocation()
.
-
npfnInternalFree
@Nullable public static VkInternalFreeNotification npfnInternalFree(long struct)
Unsafe version ofpfnInternalFree()
.
-
npUserData
public static void npUserData(long struct, long value)
Unsafe version ofpUserData
.
-
npfnAllocation
public static void npfnAllocation(long struct, VkAllocationFunctionI value)
Unsafe version ofpfnAllocation
.
-
npfnReallocation
public static void npfnReallocation(long struct, VkReallocationFunctionI value)
Unsafe version ofpfnReallocation
.
-
npfnFree
public static void npfnFree(long struct, VkFreeFunctionI value)
Unsafe version ofpfnFree
.
-
npfnInternalAllocation
public static void npfnInternalAllocation(long struct, @Nullable VkInternalAllocationNotificationI value)
Unsafe version ofpfnInternalAllocation
.
-
npfnInternalFree
public static void npfnInternalFree(long struct, @Nullable VkInternalFreeNotificationI value)
Unsafe version ofpfnInternalFree
.
-
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
-
-