Class KHRExternalMemoryFd
- java.lang.Object
-
- org.lwjgl.vulkan.KHRExternalMemoryFd
-
public class KHRExternalMemoryFd extends java.lang.ObjectAn application may wish to reference device memory in multiple Vulkan logical devices or instances, in multiple processes, and/or in multiple APIs. This extension enables an application to export POSIX file descriptor handles from Vulkan memory objects and to import Vulkan memory objects from POSIX file descriptor handles exported from other Vulkan memory objects or from similar resources in other APIs.- Name String
VK_KHR_external_memory_fd- Extension Type
- Device extension
- Registered Extension Number
- 75
- Revision
- 1
- Extension and Version Dependencies
- Requires Vulkan 1.0
- Requires
VK_KHR_external_memory
- Contact
- James Jones cubanismo
- Last Modified Date
- 2016-10-21
- IP Status
- No known IP claims.
- Contributors
- James Jones, NVIDIA
- Jeff Juliano, NVIDIA
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringVK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAMEThe extension name.static intVK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSIONThe extension specification version.static intVK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR
VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR
VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHRExtendsVkStructureType.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intnvkGetMemoryFdKHR(VkDevice device, long pGetFdInfo, long pFd)Unsafe version of:GetMemoryFdKHRstatic intnvkGetMemoryFdPropertiesKHR(VkDevice device, int handleType, int fd, long pMemoryFdProperties)Unsafe version of:GetMemoryFdPropertiesKHRstatic intvkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, int[] pFd)Array version of:GetMemoryFdKHRstatic intvkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, java.nio.IntBuffer pFd)Get a POSIX file descriptor for a memory object.static intvkGetMemoryFdPropertiesKHR(VkDevice device, int handleType, int fd, VkMemoryFdPropertiesKHR pMemoryFdProperties)Get Properties of External Memory File Descriptors.
-
-
-
Field Detail
-
VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION
The extension specification version.
-
VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME
The extension name.
-
-
Method Detail
-
nvkGetMemoryFdKHR
public static int nvkGetMemoryFdKHR(VkDevice device, long pGetFdInfo, long pFd)
Unsafe version of:GetMemoryFdKHR
-
vkGetMemoryFdKHR
public static int vkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, java.nio.IntBuffer pFd)
Get a POSIX file descriptor for a memory object.C Specification
To export a POSIX file descriptor representing the underlying resources of a Vulkan device memory object, call:
VkResult vkGetMemoryFdKHR( VkDevice device, const VkMemoryGetFdInfoKHR* pGetFdInfo, int* pFd);Description
Each call to
vkGetMemoryFdKHRmust create a new file descriptor and transfer ownership of it to the application. To avoid leaking resources, the application must release ownership of the file descriptor using theclosesystem call when it is no longer needed, or by importing a Vulkan memory object from it. Where supported by the operating system, the implementation must set the file descriptor to be closed automatically when anexecvesystem call is made.Valid Usage (Implicit)
devicemust be a validVkDevicehandlepGetFdInfomust be a valid pointer to a validVkMemoryGetFdInfoKHRstructurepFdmust be a valid pointer to anintvalue
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the logical device that created the device memory being exported.pGetFdInfo- a pointer to an instance of theVkMemoryGetFdInfoKHRstructure containing parameters of the export operation.pFd- will return a file descriptor representing the underlying resources of the device memory object.
-
nvkGetMemoryFdPropertiesKHR
public static int nvkGetMemoryFdPropertiesKHR(VkDevice device, int handleType, int fd, long pMemoryFdProperties)
Unsafe version of:GetMemoryFdPropertiesKHR
-
vkGetMemoryFdPropertiesKHR
public static int vkGetMemoryFdPropertiesKHR(VkDevice device, int handleType, int fd, VkMemoryFdPropertiesKHR pMemoryFdProperties)
Get Properties of External Memory File Descriptors.C Specification
POSIX file descriptor memory handles compatible with Vulkan may also be created by non-Vulkan APIs using methods beyond the scope of this specification. To determine the correct parameters to use when importing such handles, call:
VkResult vkGetMemoryFdPropertiesKHR( VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, int fd, VkMemoryFdPropertiesKHR* pMemoryFdProperties);Valid Usage
fdmust be an external memory handle created outside of the Vulkan API.handleTypemust not beEXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR.
Valid Usage (Implicit)
devicemust be a validVkDevicehandlehandleTypemust be a validVkExternalMemoryHandleTypeFlagBitsvaluepMemoryFdPropertiesmust be a valid pointer to aVkMemoryFdPropertiesKHRstructure
Return Codes
- On success, this command returns
- On failure, this command returns
See Also
- Parameters:
device- the logical device that will be importingfd.handleType- the type of the handlefd.fd- the handle which will be imported.pMemoryFdProperties- a pointer to aVkMemoryFdPropertiesKHRstructure in which the properties of the handlefdare returned.
-
vkGetMemoryFdKHR
public static int vkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, int[] pFd)
Array version of:GetMemoryFdKHR
-
-