Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRExternalMemoryFd

extends Object
Class Inheritance
Imports
java.nio.*, org.lwjgl.system.*

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.
VK_KHR_external_memory_fd
Name String
VK_KHR_external_memory_fd
Extension Type
Device extension
Registered Extension Number
75
Revision
1
Extension and Version Dependencies
VK_KHR_external_memory or Version 1.1
Contact
Other Extension Metadata
Last Modified Date
2016-10-21
IP Status
No known IP claims.
Contributors
  • James Jones, NVIDIA
  • Jeff Juliano, NVIDIA

Field Summary

Modifier and TypeField and Description
public static final String
public static final int
VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION

The extension specification version.

public static final int
public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public static int
nvkGetMemoryFdKHR(VkDevice device, long pGetFdInfo, long pFd)

Unsafe version of: GetMemoryFdKHR

public static int
nvkGetMemoryFdPropertiesKHR(VkDevice device, int handleType, int fd, long pMemoryFdProperties)

Unsafe version of: GetMemoryFdPropertiesKHR

public static int
vkGetMemoryFdKHR(VkDevice
the logical device that created the device memory being exported.
device
,
VkMemoryGetFdInfoKHR
a pointer to a VkMemoryGetFdInfoKHR structure containing parameters of the export operation.
pGetFdInfo
,
IntBuffer
will return a file descriptor referencing the payload of the device memory object.
pFd
)

Get a POSIX file descriptor for a memory object.

public static int
vkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, int[] pFd)

Array version of: GetMemoryFdKHR

public static int
vkGetMemoryFdPropertiesKHR(VkDevice
the logical device that will be importing fd.
device
,
int
a VkExternalMemoryHandleTypeFlagBits value specifying the type of the handle fd.
handleType
,
int
the handle which will be imported.
fd
,
VkMemoryFdPropertiesKHR
a pointer to a VkMemoryFdPropertiesKHR structure in which the properties of the handle fd are returned.
pMemoryFdProperties
)

Get Properties of External Memory File Descriptors.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAMEback to summary
public static final String VK_KHR_EXTERNAL_MEMORY_FD_EXTENSION_NAME

The extension name.

VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSIONback to summary
public static final int VK_KHR_EXTERNAL_MEMORY_FD_SPEC_VERSION

The extension specification version.

VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHRback to summary
public static final int VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR

Extends VkStructureType.

Enum values:

Constructor Detail

KHRExternalMemoryFdback to summary
protected KHRExternalMemoryFd()

Method Detail

nvkGetMemoryFdKHRback to summary
public static int nvkGetMemoryFdKHR(VkDevice device, long pGetFdInfo, long pFd)

Unsafe version of: GetMemoryFdKHR

nvkGetMemoryFdPropertiesKHRback to summary
public static int nvkGetMemoryFdPropertiesKHR(VkDevice device, int handleType, int fd, long pMemoryFdProperties)

Unsafe version of: GetMemoryFdPropertiesKHR

vkGetMemoryFdKHRback to summary
public static int vkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, IntBuffer pFd)

Get a POSIX file descriptor for a memory object.

C Specification

To export a POSIX file descriptor referencing the payload 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 holding a reference to the memory object’s payload and transfer ownership of the file descriptor to the application. To avoid leaking resources, the application must release ownership of the file descriptor using the close 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 an execve system call is made.

Valid Usage (Implicit)
  • device must be a valid VkDevice handle
  • pGetFdInfo must be a valid pointer to a valid VkMemoryGetFdInfoKHR structure
  • pFd must be a valid pointer to an int value
Return Codes
On success, this command returns
On failure, this command returns
See Also

VkMemoryGetFdInfoKHR

Parameters
device:VkDevice

the logical device that created the device memory being exported.

pGetFdInfo:VkMemoryGetFdInfoKHR

a pointer to a VkMemoryGetFdInfoKHR structure containing parameters of the export operation.

pFd:IntBuffer

will return a file descriptor referencing the payload of the device memory object.

Annotations
@NativeType:VkResult
vkGetMemoryFdKHRback to summary
public static int vkGetMemoryFdKHR(VkDevice device, VkMemoryGetFdInfoKHR pGetFdInfo, int[] pFd)

Array version of: GetMemoryFdKHR

Annotations
@NativeType:VkResult
vkGetMemoryFdPropertiesKHRback to summary
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
Valid Usage (Implicit)
  • device must be a valid VkDevice handle
  • handleType must be a valid VkExternalMemoryHandleTypeFlagBits value
  • pMemoryFdProperties must be a valid pointer to a VkMemoryFdPropertiesKHR structure
Return Codes
On success, this command returns
On failure, this command returns
See Also

VkMemoryFdPropertiesKHR

Parameters
device:VkDevice

the logical device that will be importing fd.

handleType:int

a VkExternalMemoryHandleTypeFlagBits value specifying the type of the handle fd.

fd:int

the handle which will be imported.

pMemoryFdProperties:VkMemoryFdPropertiesKHR

a pointer to a VkMemoryFdPropertiesKHR structure in which the properties of the handle fd are returned.

Annotations
@NativeType:VkResult