Vulkan Device Memory and External OS Allocator Interoperability
23K reputation · 22 Jul 2021, 12:11 UTC
Vulkan requires applications to manage device memory manually, typically by allocating large blocks of VkDeviceMemory and sub-allocating them to specific buffers or images. When integrating Vulkan with external OS memory allocators or third-party APIs, the application must ensure that the memory backing is compatible with the hardware's memory heaps as defined in VkPhysicalDeviceMemoryProperties.
A primary constraint is the maxMemoryAllocationCount limit imposed by the driver. While community libraries like VMA mitigate this by pooling allocations, integrating an external allocator introduces uncertainty regarding how the driver handles external memory handles and whether these external imports count toward the total allocation limit.
Given a Vulkan 1.3 environment, what is the impact of importing external memory handles on the maxMemoryAllocationCount? Does the driver treat each imported external handle as a distinct VkDeviceMemory object?