Class KHRExternalMemoryFd
- java.lang.Object
-
- org.lwjgl.vulkan.KHRExternalMemoryFd
-
public class KHRExternalMemoryFd extends java.lang.Object
An 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.String
VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME
The extension name.static int
VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION
The extension specification version.static int
VK_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 int
nvkGetMemoryFdKHR(VkDevice device, long pGetFdInfo, long pFd)
Unsafe version of:GetMemoryFdKHR
static int
nvkGetMemoryFdPropertiesKHR(VkDevice device, int handleType, int fd, long pMemoryFdProperties)
Unsafe version of:GetMemoryFdPropertiesKHR
static int
vkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, int[] pFd)
Array version of:GetMemoryFdKHR
static int
vkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, java.nio.IntBuffer pFd)
Get a POSIX file descriptor for a memory object.static int
vkGetMemoryFdPropertiesKHR(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
vkGetMemoryFdKHR
must 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 theclose
system 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 anexecve
system call is made.Valid Usage (Implicit)
device
must be a validVkDevice
handlepGetFdInfo
must be a valid pointer to a validVkMemoryGetFdInfoKHR
structurepFd
must be a valid pointer to anint
value
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 theVkMemoryGetFdInfoKHR
structure 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
fd
must be an external memory handle created outside of the Vulkan API.handleType
must not beEXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR
.
Valid Usage (Implicit)
device
must be a validVkDevice
handlehandleType
must be a validVkExternalMemoryHandleTypeFlagBits
valuepMemoryFdProperties
must be a valid pointer to aVkMemoryFdPropertiesKHR
structure
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 aVkMemoryFdPropertiesKHR
structure in which the properties of the handlefd
are returned.
-
vkGetMemoryFdKHR
public static int vkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, int[] pFd)
Array version of:GetMemoryFdKHR
-
-