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.NativeResourceStructure containing callback function pointers for memory allocation.Valid Usage
pfnAllocationmust be a valid pointer to a valid user-definedVkAllocationFunctionpfnReallocationmust be a valid pointer to a valid user-definedVkReallocationFunctionpfnFreemust be a valid pointer to a valid user-definedVkFreeFunction- If either of
pfnInternalAllocationorpfnInternalFreeis notNULL, both must be valid callbacks
See Also
VkAllocationFunction,VkFreeFunction,VkInternalAllocationNotification,VkInternalFreeNotification,VkReallocationFunction,AllocateMemory,CreateAccelerationStructureKHR,CreateAccelerationStructureNV,CreateBuffer,CreateBufferView,CreateCommandPool,CreateComputePipelines,CreateCuFunctionNVX,CreateCuModuleNVX,CreateDebugReportCallbackEXT,CreateDebugUtilsMessengerEXT,CreateDeferredOperationKHR,CreateDescriptorPool,CreateDescriptorSetLayout,CreateDescriptorUpdateTemplate,CreateDescriptorUpdateTemplateKHR,CreateDevice,CreateDisplayModeKHR,CreateDisplayPlaneSurfaceKHR,CreateEvent,CreateFence,CreateFramebuffer,CreateGraphicsPipelines,CreateHeadlessSurfaceEXT,CreateImage,CreateImageView,CreateIndirectCommandsLayoutNV,CreateInstance,CreateMacOSSurfaceMVK,CreateMetalSurfaceEXT,CreatePipelineCache,CreatePipelineLayout,CreatePrivateDataSlot,CreatePrivateDataSlotEXT,CreateQueryPool,CreateRayTracingPipelinesKHR,CreateRayTracingPipelinesNV,CreateRenderPass,CreateRenderPass2,CreateRenderPass2KHR,CreateSampler,CreateSamplerYcbcrConversion,CreateSamplerYcbcrConversionKHR,CreateSemaphore,CreateShaderModule,CreateSharedSwapchainsKHR,CreateSwapchainKHR,CreateValidationCacheEXT,CreateVideoSessionKHR,CreateVideoSessionParametersKHR,CreateWaylandSurfaceKHR,CreateWin32SurfaceKHR,CreateXlibSurfaceKHR,DestroyAccelerationStructureKHR,DestroyAccelerationStructureNV,DestroyBuffer,DestroyBufferView,DestroyCommandPool,DestroyCuFunctionNVX,DestroyCuModuleNVX,DestroyDebugReportCallbackEXT,DestroyDebugUtilsMessengerEXT,DestroyDeferredOperationKHR,DestroyDescriptorPool,DestroyDescriptorSetLayout,DestroyDescriptorUpdateTemplate,DestroyDescriptorUpdateTemplateKHR,DestroyDevice,DestroyEvent,DestroyFence,DestroyFramebuffer,DestroyImage,DestroyImageView,DestroyIndirectCommandsLayoutNV,DestroyInstance,DestroyPipeline,DestroyPipelineCache,DestroyPipelineLayout,DestroyPrivateDataSlot,DestroyPrivateDataSlotEXT,DestroyQueryPool,DestroyRenderPass,DestroySampler,DestroySamplerYcbcrConversion,DestroySamplerYcbcrConversionKHR,DestroySemaphore,DestroyShaderModule,DestroySurfaceKHR,DestroySwapchainKHR,DestroyValidationCacheEXT,DestroyVideoSessionKHR,DestroyVideoSessionParametersKHR,FreeMemory,RegisterDeviceEventEXT,RegisterDisplayEventEXTLayout
struct VkAllocationCallbacks { void *pUserData();PFN_vkAllocationFunctionpfnAllocation();PFN_vkReallocationFunctionpfnReallocation();PFN_vkFreeFunctionpfnFree();PFN_vkInternalAllocationNotificationpfnInternalAllocation();PFN_vkInternalFreeNotificationpfnInternalFree(); }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classVkAllocationCallbacks.BufferAn array ofVkAllocationCallbacksstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intPFNALLOCATION
PFNFREE
PFNINTERNALALLOCATION
PFNINTERNALFREE
PFNREALLOCATION
PUSERDATAThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor 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 Deprecated Methods Modifier and Type Method Description static 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 VkAllocationCallbackscallocStack()Deprecated.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 VkAllocationCallbacksmallocStack()Deprecated.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.static VkInternalAllocationNotificationnpfnInternalAllocation(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.VkAllocationFunctionpfnAllocation()aVkAllocationFunctionpointer to an application-defined memory allocation function.VkAllocationCallbackspfnAllocation(VkAllocationFunctionI value)Sets the specified value to thepfnAllocation()field.VkFreeFunctionpfnFree()aVkFreeFunctionpointer to an application-defined memory free function.VkAllocationCallbackspfnFree(VkFreeFunctionI value)Sets the specified value to thepfnFree()field.VkInternalAllocationNotificationpfnInternalAllocation()aVkInternalAllocationNotificationpointer to an application-defined function that is called by the implementation when the implementation makes internal allocations.VkAllocationCallbackspfnInternalAllocation(VkInternalAllocationNotificationI value)Sets the specified value to thepfnInternalAllocation()field.VkInternalFreeNotificationpfnInternalFree()aVkInternalFreeNotificationpointer to an application-defined function that is called by the implementation when the implementation frees internal allocations.VkAllocationCallbackspfnInternalFree(VkInternalFreeNotificationI value)Sets the specified value to thepfnInternalFree()field.VkReallocationFunctionpfnReallocation()aVkReallocationFunctionpointer to an application-defined memory reallocation function.VkAllocationCallbackspfnReallocation(VkReallocationFunctionI value)Sets the specified value to thepfnReallocation()field.longpUserData()a value to be interpreted by the implementation of the callbacks.VkAllocationCallbackspUserData(long value)Sets the specified value to thepUserData()field.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()
-
-
-
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()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
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
@Nullable public VkAllocationFunction pfnAllocation()
aVkAllocationFunctionpointer to an application-defined memory allocation function.
-
pfnReallocation
@Nullable public VkReallocationFunction pfnReallocation()
aVkReallocationFunctionpointer to an application-defined memory reallocation function.
-
pfnFree
@Nullable public VkFreeFunction pfnFree()
aVkFreeFunctionpointer to an application-defined memory free function.
-
pfnInternalAllocation
@Nullable public VkInternalAllocationNotification pfnInternalAllocation()
aVkInternalAllocationNotificationpointer to an application-defined function that is called by the implementation when the implementation makes internal allocations.
-
pfnInternalFree
@Nullable public VkInternalFreeNotification pfnInternalFree()
aVkInternalFreeNotificationpointer to an application-defined function that is called by the implementation when the implementation frees internal allocations.
-
pUserData
public VkAllocationCallbacks pUserData(long value)
Sets the specified value to thepUserData()field.
-
pfnAllocation
public VkAllocationCallbacks pfnAllocation(@Nullable VkAllocationFunctionI value)
Sets the specified value to thepfnAllocation()field.
-
pfnReallocation
public VkAllocationCallbacks pfnReallocation(@Nullable VkReallocationFunctionI value)
Sets the specified value to thepfnReallocation()field.
-
pfnFree
public VkAllocationCallbacks pfnFree(@Nullable 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 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.
-
createSafe
@Nullable public static VkAllocationCallbacks createSafe(long address)
-
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
-
createSafe
@Nullable public static VkAllocationCallbacks.Buffer createSafe(long address, int capacity)
-
mallocStack
@Deprecated public static VkAllocationCallbacks mallocStack()
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkAllocationCallbacks callocStack()
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VkAllocationCallbacks mallocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(MemoryStack)instead.
-
callocStack
@Deprecated public static VkAllocationCallbacks callocStack(org.lwjgl.system.MemoryStack stack)
Deprecated.Deprecated for removal in 3.4.0. Usecalloc(MemoryStack)instead.
-
mallocStack
@Deprecated public static VkAllocationCallbacks.Buffer mallocStack(int capacity)
Deprecated.Deprecated for removal in 3.4.0. Usemalloc(int, MemoryStack)instead.
-
callocStack
@Deprecated public static VkAllocationCallbacks.Buffer callocStack(int capacity)
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
public static VkAllocationCallbacks malloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static VkAllocationCallbacks calloc(org.lwjgl.system.MemoryStack stack)
Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static VkAllocationCallbacks.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static VkAllocationCallbacks.Buffer calloc(int capacity, org.lwjgl.system.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
-
npUserData
public static long npUserData(long struct)
Unsafe version ofpUserData().
-
npfnAllocation
@Nullable public static VkAllocationFunction npfnAllocation(long struct)
Unsafe version ofpfnAllocation().
-
npfnReallocation
@Nullable public static VkReallocationFunction npfnReallocation(long struct)
Unsafe version ofpfnReallocation().
-
npfnFree
@Nullable 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, @Nullable VkAllocationFunctionI value)Unsafe version ofpfnAllocation.
-
npfnReallocation
public static void npfnReallocation(long struct, @Nullable VkReallocationFunctionI value)Unsafe version ofpfnReallocation.
-
npfnFree
public static void npfnFree(long struct, @Nullable 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.
-
-