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,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,RegisterDisplayEventEXTMember 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 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_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 Modifier and Type Method 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, org.lwjgl.system.MemoryStack stack)Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static VkAllocationCallbackscallocStack(org.lwjgl.system.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.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 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, org.lwjgl.system.MemoryStack stack)Returns a newVkAllocationCallbacks.Bufferinstance allocated on the specifiedMemoryStack.static VkAllocationCallbacksmallocStack(org.lwjgl.system.MemoryStack stack)Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStack.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()Returns the value of thepfnAllocationfield.VkAllocationCallbackspfnAllocation(VkAllocationFunctionI value)Sets the specified value to thepfnAllocationfield.VkFreeFunctionpfnFree()Returns the value of thepfnFreefield.VkAllocationCallbackspfnFree(VkFreeFunctionI value)Sets the specified value to thepfnFreefield.VkInternalAllocationNotificationpfnInternalAllocation()Returns the value of thepfnInternalAllocationfield.VkAllocationCallbackspfnInternalAllocation(VkInternalAllocationNotificationI value)Sets the specified value to thepfnInternalAllocationfield.VkInternalFreeNotificationpfnInternalFree()Returns the value of thepfnInternalFreefield.VkAllocationCallbackspfnInternalFree(VkInternalFreeNotificationI value)Sets the specified value to thepfnInternalFreefield.VkReallocationFunctionpfnReallocation()Returns the value of thepfnReallocationfield.VkAllocationCallbackspfnReallocation(VkReallocationFunctionI value)Sets the specified value to 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()static voidvalidate(long struct)Validates pointer members that should not beNULL.static voidvalidate(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 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()
Returns the value of thepUserDatafield.
-
pfnAllocation
public VkAllocationFunction pfnAllocation()
Returns the value of thepfnAllocationfield.
-
pfnReallocation
public VkReallocationFunction pfnReallocation()
Returns the value of thepfnReallocationfield.
-
pfnFree
public VkFreeFunction pfnFree()
Returns the value of thepfnFreefield.
-
pfnInternalAllocation
@Nullable public VkInternalAllocationNotification pfnInternalAllocation()
Returns the value of thepfnInternalAllocationfield.
-
pfnInternalFree
@Nullable public VkInternalFreeNotification pfnInternalFree()
Returns the value of thepfnInternalFreefield.
-
pUserData
public VkAllocationCallbacks pUserData(long value)
Sets the specified value to thepUserDatafield.
-
pfnAllocation
public VkAllocationCallbacks pfnAllocation(VkAllocationFunctionI value)
Sets the specified value to thepfnAllocationfield.
-
pfnReallocation
public VkAllocationCallbacks pfnReallocation(VkReallocationFunctionI value)
Sets the specified value to thepfnReallocationfield.
-
pfnFree
public VkAllocationCallbacks pfnFree(VkFreeFunctionI value)
Sets the specified value to thepfnFreefield.
-
pfnInternalAllocation
public VkAllocationCallbacks pfnInternalAllocation(@Nullable VkInternalAllocationNotificationI value)
Sets the specified value to thepfnInternalAllocationfield.
-
pfnInternalFree
public VkAllocationCallbacks pfnInternalFree(@Nullable VkInternalFreeNotificationI value)
Sets the specified value to thepfnInternalFreefield.
-
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
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(org.lwjgl.system.MemoryStack stack)
Returns a newVkAllocationCallbacksinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
callocStack
public static VkAllocationCallbacks callocStack(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
-
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, org.lwjgl.system.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, 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
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
-
-