Note that this is mostly a follow-up question to this post: Can memory imported to Vulkan from another API be freed by Vulkan? (no need to read it to understand the question, might be interesting nonetheless)
Memory objects can be imported to Vulkan from other APIs using the VK_KHR_external_memory* family of extensions. As explained by @Nicol Bolas in the previous post, all memory objects need to be freed prior to destroying the VkDevice, no matter if they're imported or not. There are two options I can think of what could happen when an imported memory object is freed:
- When
vkFreeMemoryis called, the given region is freed globally (as indicated by the function name) and can be used by any application after the call - The driver knows that the memory object is imported and might be in use by another application, so the memory region isn't marked as available
I think assumption 2 is true, but if it was, the function name vkFreeMemory would be misleading. I couldn't find anything about this in the specification so I figured I'll ask here.