C Specification
Allocators are provided by the application as a pointer to a
VkAllocationCallbacks structure:
typedef struct VkAllocationCallbacks {
void* pUserData;
PFN_vkAllocationFunction pfnAllocation;
PFN_vkReallocationFunction pfnReallocation;
PFN_vkFreeFunction pfnFree;
PFN_vkInternalAllocationNotification pfnInternalAllocation;
PFN_vkInternalFreeNotification pfnInternalFree;
} VkAllocationCallbacks;
Members
-
pUserDatais 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. -
pfnAllocationis a PFN_vkAllocationFunction pointer to an application-defined memory allocation function. -
pfnReallocationis a PFN_vkReallocationFunction pointer to an application-defined memory reallocation function. -
pfnFreeis a PFN_vkFreeFunction pointer to an application-defined memory free function. -
pfnInternalAllocationis a PFN_vkInternalAllocationNotification pointer to an application-defined function that is called by the implementation when the implementation makes internal allocations. -
pfnInternalFreeis a PFN_vkInternalFreeNotification pointer to an application-defined function that is called by the implementation when the implementation frees internal allocations.
Description
See Also
PFN_vkAllocationFunction, PFN_vkFreeFunction, PFN_vkInternalAllocationNotification, PFN_vkInternalFreeNotification, PFN_vkReallocationFunction, vkAllocateMemory, vkCreateAccelerationStructureNV, vkCreateAndroidSurfaceKHR, vkCreateBuffer, vkCreateBufferView, vkCreateCommandPool, vkCreateComputePipelines, vkCreateDebugReportCallbackEXT, vkCreateDebugUtilsMessengerEXT, vkCreateDescriptorPool, vkCreateDescriptorSetLayout, vkCreateDescriptorUpdateTemplate, vkCreateDescriptorUpdateTemplateKHR, vkCreateDevice, vkCreateDisplayModeKHR, vkCreateDisplayPlaneSurfaceKHR, vkCreateEvent, vkCreateFence, vkCreateFramebuffer, vkCreateGraphicsPipelines, vkCreateHeadlessSurfaceEXT, vkCreateIOSSurfaceMVK, vkCreateImage, vkCreateImagePipeSurfaceFUCHSIA, vkCreateImageView, vkCreateIndirectCommandsLayoutNVX, vkCreateInstance, vkCreateMacOSSurfaceMVK, vkCreateMetalSurfaceEXT, vkCreateObjectTableNVX, vkCreatePipelineCache, vkCreatePipelineLayout, vkCreateQueryPool, vkCreateRayTracingPipelinesNV, vkCreateRenderPass, vkCreateRenderPass2, vkCreateRenderPass2KHR, vkCreateSampler, vkCreateSamplerYcbcrConversion, vkCreateSamplerYcbcrConversionKHR, vkCreateSemaphore, vkCreateShaderModule, vkCreateSharedSwapchainsKHR, vkCreateStreamDescriptorSurfaceGGP, vkCreateSwapchainKHR, vkCreateValidationCacheEXT, vkCreateViSurfaceNN, vkCreateWaylandSurfaceKHR, vkCreateWin32SurfaceKHR, vkCreateXcbSurfaceKHR, vkCreateXlibSurfaceKHR, vkDestroyAccelerationStructureNV, vkDestroyBuffer, vkDestroyBufferView, vkDestroyCommandPool, vkDestroyDebugReportCallbackEXT, vkDestroyDebugUtilsMessengerEXT, vkDestroyDescriptorPool, vkDestroyDescriptorSetLayout, vkDestroyDescriptorUpdateTemplate, vkDestroyDescriptorUpdateTemplateKHR, vkDestroyDevice, vkDestroyEvent, vkDestroyFence, vkDestroyFramebuffer, vkDestroyImage, vkDestroyImageView, vkDestroyIndirectCommandsLayoutNVX, vkDestroyInstance, vkDestroyObjectTableNVX, vkDestroyPipeline, vkDestroyPipelineCache, vkDestroyPipelineLayout, vkDestroyQueryPool, vkDestroyRenderPass, vkDestroySampler, vkDestroySamplerYcbcrConversion, vkDestroySamplerYcbcrConversionKHR, vkDestroySemaphore, vkDestroyShaderModule, vkDestroySurfaceKHR, vkDestroySwapchainKHR, vkDestroyValidationCacheEXT, vkFreeMemory, vkRegisterDeviceEventEXT, vkRegisterDisplayEventEXT
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.
Copyright
Copyright (c) 2014-2020 Khronos Group. This work is licensed under a Creative Commons Attribution 4.0 International License.