Class VkAllocationCallbacks
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
Valid Usage
pfnAllocationmust be a valid pointer to a valid application-definedVkAllocationFunctionpfnReallocationmust be a valid pointer to a valid application-definedVkReallocationFunctionpfnFreemust be a valid pointer to a valid application-definedVkFreeFunction- If either of
pfnInternalAllocationorpfnInternalFreeis notNULL, both must be valid callbacks
See Also
VkAllocationFunction, VkFreeFunction, VkInternalAllocationNotification, VkInternalFreeNotification, VkReallocationFunction, AllocateMemory, CreateAccelerationStructureKHR, CreateAccelerationStructureNV, CreateAndroidSurfaceKHR, CreateBuffer, CreateBufferView, CreateCommandPool, CreateComputePipelines, CreateCuFunctionNVX, CreateCuModuleNVX, CreateCudaFunctionNV, CreateCudaModuleNV, CreateDebugReportCallbackEXT, CreateDebugUtilsMessengerEXT, CreateDeferredOperationKHR, CreateDescriptorPool, CreateDescriptorSetLayout, CreateDescriptorUpdateTemplate, CreateDescriptorUpdateTemplateKHR, CreateDevice, CreateDirectFBSurfaceEXT, CreateDisplayModeKHR, CreateDisplayPlaneSurfaceKHR, CreateEvent, CreateExecutionGraphPipelinesAMDX, CreateFence, CreateFramebuffer, CreateGraphicsPipelines, CreateHeadlessSurfaceEXT, CreateImage, CreateImageView, CreateIndirectCommandsLayoutNV, CreateInstance, CreateMacOSSurfaceMVK, CreateMetalSurfaceEXT, CreateMicromapEXT, CreateOpticalFlowSessionNV, CreatePipelineCache, CreatePipelineLayout, CreatePrivateDataSlot, CreatePrivateDataSlotEXT, CreateQueryPool, CreateRayTracingPipelinesKHR, CreateRayTracingPipelinesNV, CreateRenderPass, CreateRenderPass2, CreateRenderPass2KHR, CreateSampler, CreateSamplerYcbcrConversion, CreateSamplerYcbcrConversionKHR, CreateSemaphore, CreateShaderModule, CreateShadersEXT, CreateSharedSwapchainsKHR, CreateSwapchainKHR, CreateValidationCacheEXT, CreateVideoSessionKHR, CreateVideoSessionParametersKHR, CreateWaylandSurfaceKHR, CreateWin32SurfaceKHR, CreateXcbSurfaceKHR, CreateXlibSurfaceKHR, DestroyAccelerationStructureKHR, DestroyAccelerationStructureNV, DestroyBuffer, DestroyBufferView, DestroyCommandPool, DestroyCuFunctionNVX, DestroyCuModuleNVX, DestroyCudaFunctionNV, DestroyCudaModuleNV, DestroyDebugReportCallbackEXT, DestroyDebugUtilsMessengerEXT, DestroyDeferredOperationKHR, DestroyDescriptorPool, DestroyDescriptorSetLayout, DestroyDescriptorUpdateTemplate, DestroyDescriptorUpdateTemplateKHR, DestroyDevice, DestroyEvent, DestroyFence, DestroyFramebuffer, DestroyImage, DestroyImageView, DestroyIndirectCommandsLayoutNV, DestroyInstance, DestroyMicromapEXT, DestroyOpticalFlowSessionNV, DestroyPipeline, DestroyPipelineCache, DestroyPipelineLayout, DestroyPrivateDataSlot, DestroyPrivateDataSlotEXT, DestroyQueryPool, DestroyRenderPass, DestroySampler, DestroySamplerYcbcrConversion, DestroySamplerYcbcrConversionKHR, DestroySemaphore, DestroyShaderEXT, DestroyShaderModule, DestroySurfaceKHR, DestroySwapchainKHR, DestroyValidationCacheEXT, DestroyVideoSessionKHR, DestroyVideoSessionParametersKHR, FreeMemory, RegisterDeviceEventEXT, RegisterDisplayEventEXT
Layout
struct VkAllocationCallbacks {
void * pUserData();
PFN_vkAllocationFunction pfnAllocation();
PFN_vkReallocationFunction pfnReallocation();
PFN_vkFreeFunction pfnFree();
PFN_vkInternalAllocationNotification pfnInternalAllocation();
PFN_vkInternalFreeNotification pfnInternalFree();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct size in bytes.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionVkAllocationCallbacks(ByteBuffer container) Creates aVkAllocationCallbacksinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic VkAllocationCallbackscalloc()Returns a newVkAllocationCallbacksinstance allocated withmemCalloc.static VkAllocationCallbacks.Buffercalloc(int capacity) Returns a newVkAllocationCallbacks.Bufferinstance allocated withmemCalloc.static VkAllocationCallbacks.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAllocationCallbackscalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAllocationCallbacksDeprecated.static VkAllocationCallbacks.BuffercallocStack(int capacity) Deprecated.static VkAllocationCallbacks.BuffercallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkAllocationCallbackscallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.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.static VkAllocationCallbacks.Buffercreate(long address, int capacity) Create aVkAllocationCallbacks.Bufferinstance at the specified memory.static VkAllocationCallbackscreateSafe(long address) static VkAllocationCallbacks.BuffercreateSafe(long address, int capacity) static VkAllocationCallbacksmalloc()Returns a newVkAllocationCallbacksinstance allocated withmemAlloc.static VkAllocationCallbacks.Buffermalloc(int capacity) Returns a newVkAllocationCallbacks.Bufferinstance allocated withmemAlloc.static VkAllocationCallbacks.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStack.static VkAllocationCallbacksmalloc(org.lwjgl.system.MemoryStack stack) Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStack.static VkAllocationCallbacksDeprecated.static VkAllocationCallbacks.BuffermallocStack(int capacity) Deprecated.static VkAllocationCallbacks.BuffermallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.static VkAllocationCallbacksmallocStack(org.lwjgl.system.MemoryStack stack) Deprecated.static VkAllocationFunctionnpfnAllocation(long struct) Unsafe version ofpfnAllocation().static voidnpfnAllocation(long struct, VkAllocationFunctionI value) Unsafe version ofpfnAllocation.static VkFreeFunctionnpfnFree(long struct) Unsafe version ofpfnFree().static voidnpfnFree(long struct, VkFreeFunctionI value) Unsafe version ofpfnFree.npfnInternalAllocation(long struct) Unsafe version ofpfnInternalAllocation().static voidnpfnInternalAllocation(long struct, VkInternalAllocationNotificationI value) Unsafe version ofpfnInternalAllocation.static VkInternalFreeNotificationnpfnInternalFree(long struct) Unsafe version ofpfnInternalFree().static voidnpfnInternalFree(long struct, VkInternalFreeNotificationI value) Unsafe version ofpfnInternalFree.static VkReallocationFunctionnpfnReallocation(long struct) Unsafe version ofpfnReallocation().static voidnpfnReallocation(long struct, VkReallocationFunctionI value) Unsafe version ofpfnReallocation.static longnpUserData(long struct) Unsafe version ofpUserData().static voidnpUserData(long struct, long value) Unsafe version ofpUserData.aVkAllocationFunctionpointer to an application-defined memory allocation function.Sets the specified value to thepfnAllocation()field.pfnFree()aVkFreeFunctionpointer to an application-defined memory free function.pfnFree(VkFreeFunctionI value) Sets the specified value to thepfnFree()field.aVkInternalAllocationNotificationpointer to an application-defined function that is called by the implementation when the implementation makes internal allocations.Sets the specified value to thepfnInternalAllocation()field.aVkInternalFreeNotificationpointer to an application-defined function that is called by the implementation when the implementation frees internal allocations.Sets the specified value to thepfnInternalFree()field.aVkReallocationFunctionpointer to an application-defined memory reallocation function.Sets the specified value to thepfnReallocation()field.longa value to be interpreted by the implementation of the callbacks.pUserData(long value) Sets the specified value to thepUserData()field.set(long pUserData, VkAllocationFunctionI pfnAllocation, VkReallocationFunctionI pfnReallocation, VkFreeFunctionI pfnFree, VkInternalAllocationNotificationI pfnInternalAllocation, VkInternalFreeNotificationI pfnInternalFree) Initializes this struct with the specified values.set(VkAllocationCallbacks src) Copies the specified struct data to this struct.intsizeof()Methods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
PUSERDATA
public static final int PUSERDATAThe struct member offsets. -
PFNALLOCATION
public static final int PFNALLOCATIONThe struct member offsets. -
PFNREALLOCATION
public static final int PFNREALLOCATIONThe struct member offsets. -
PFNFREE
public static final int PFNFREEThe struct member offsets. -
PFNINTERNALALLOCATION
public static final int PFNINTERNALALLOCATIONThe struct member offsets. -
PFNINTERNALFREE
public static final int PFNINTERNALFREEThe struct member offsets.
-
-
Constructor Details
-
VkAllocationCallbacks
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 Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<VkAllocationCallbacks>
-
pUserData
public long 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
aVkAllocationFunctionpointer to an application-defined memory allocation function. -
pfnReallocation
aVkReallocationFunctionpointer to an application-defined memory reallocation function. -
pfnFree
aVkFreeFunctionpointer to an application-defined memory free function. -
pfnInternalAllocation
aVkInternalAllocationNotificationpointer to an application-defined function that is called by the implementation when the implementation makes internal allocations. -
pfnInternalFree
aVkInternalFreeNotificationpointer to an application-defined function that is called by the implementation when the implementation frees internal allocations. -
pUserData
Sets the specified value to thepUserData()field. -
pfnAllocation
Sets the specified value to thepfnAllocation()field. -
pfnReallocation
Sets the specified value to thepfnReallocation()field. -
pfnFree
Sets the specified value to thepfnFree()field. -
pfnInternalAllocation
public VkAllocationCallbacks pfnInternalAllocation(@Nullable VkInternalAllocationNotificationI value) Sets the specified value to thepfnInternalAllocation()field. -
pfnInternalFree
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
Copies the specified struct data to this struct.- Parameters:
src- the source struct- Returns:
- this struct
-
malloc
Returns a newVkAllocationCallbacksinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newVkAllocationCallbacksinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newVkAllocationCallbacksinstance allocated withBufferUtils. -
create
Returns a newVkAllocationCallbacksinstance for the specified memory address. -
createSafe
-
malloc
Returns a newVkAllocationCallbacks.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newVkAllocationCallbacks.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newVkAllocationCallbacks.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aVkAllocationCallbacks.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead. -
mallocStack
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
mallocStack
@Deprecated public static VkAllocationCallbacks.Buffer mallocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead. -
callocStack
@Deprecated public static VkAllocationCallbacks.Buffer callocStack(int capacity, org.lwjgl.system.MemoryStack stack) Deprecated.Deprecated for removal in 3.4.0. Usecalloc(int, MemoryStack)instead. -
malloc
Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
npUserData
public static long npUserData(long struct) Unsafe version ofpUserData(). -
npfnAllocation
Unsafe version ofpfnAllocation(). -
npfnReallocation
Unsafe version ofpfnReallocation(). -
npfnFree
Unsafe version ofpfnFree(). -
npfnInternalAllocation
Unsafe version ofpfnInternalAllocation(). -
npfnInternalFree
Unsafe version ofpfnInternalFree(). -
npUserData
public static void npUserData(long struct, long value) Unsafe version ofpUserData. -
npfnAllocation
Unsafe version ofpfnAllocation. -
npfnReallocation
Unsafe version ofpfnReallocation. -
npfnFree
Unsafe version ofpfnFree. -
npfnInternalAllocation
public static void npfnInternalAllocation(long struct, @Nullable VkInternalAllocationNotificationI value) Unsafe version ofpfnInternalAllocation. -
npfnInternalFree
Unsafe version ofpfnInternalFree.
-