vkGetMemoryFdKHR(3)
C Specification
To export a POSIX file descriptor referencing the payload of a Vulkan devicememory object, call:
// Provided by VK_KHR_external_memory_fdVkResult vkGetMemoryFdKHR( VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd);Parameters
deviceis the logical device that created the device memory beingexported.pGetFdInfois a pointer to aVkMemoryGetFdInfoKHR structurecontaining parameters of the export operation.pFdwill return a file descriptor referencing the payload of thedevice memory object.
Description
Each call tovkGetMemoryFdKHRmust create a new file descriptorholding a reference to the memory object’s payload and transfer ownership ofthe file descriptor to the application.To avoid leaking resources, the applicationmust release ownership of thefile descriptor using theclose system call when it is no longerneeded, or by importing a Vulkan memory object from it.Where supported by the operating system, the implementationmust set thefile descriptor to be closed automatically when anexecve system callis made.
VUID-vkGetMemoryFdKHR-device-parameter
devicemust be a validVkDevice handleVUID-vkGetMemoryFdKHR-pGetFdInfo-parameter
pGetFdInfomust be a valid pointer to a validVkMemoryGetFdInfoKHR structureVUID-vkGetMemoryFdKHR-pFd-parameter
pFdmust be a valid pointer to anintvalue
Document Notes
For more information, see theVulkan Specification.
This page is extracted from the Vulkan Specification.Fixes and changes should be made to the Specification, not directly.