Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRExternalFenceFd

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

An application using external memory may wish to synchronize access to that memory using fences. This extension enables an application to export fence payload to and import fence payload from POSIX file descriptors.
VK_KHR_external_fence_fd
Name String
VK_KHR_external_fence_fd
Extension Type
Device extension
Registered Extension Number
116
Revision
1
Extension and Version Dependencies
VK_KHR_external_fence or Version 1.1
Contact
Other Extension Metadata
Last Modified Date
2017-05-08
IP Status
No known IP claims.
Contributors

Field Summary

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

The extension specification version.

public static final int
public static final int

Constructor Summary

AccessConstructor and Description
protected

Method Summary

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

Unsafe version of: GetFenceFdKHR

public static int
nvkImportFenceFdKHR(VkDevice device, long pImportFenceFdInfo)

Unsafe version of: ImportFenceFdKHR

public static int
vkGetFenceFdKHR(VkDevice
the logical device that created the fence being exported.
device
,
VkFenceGetFdInfoKHR
a pointer to a VkFenceGetFdInfoKHR structure containing parameters of the export operation.
pGetFdInfo
,
IntBuffer
will return the file descriptor representing the fence payload.
pFd
)

Get a POSIX file descriptor handle for a fence.

public static int
vkGetFenceFdKHR(VkDevice device, VkFenceGetFdInfoKHR pGetFdInfo, int[] pFd)

Array version of: GetFenceFdKHR

public static int
vkImportFenceFdKHR(VkDevice
the logical device that created the fence.
device
,
VkImportFenceFdInfoKHR
a pointer to a VkImportFenceFdInfoKHR structure specifying the fence and import parameters.
pImportFenceFdInfo
)

Import a fence from a POSIX file descriptor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAMEback to summary
public static final String VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME

The extension name.

VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSIONback to summary
public static final int VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION

The extension specification version.

VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR

Extends VkStructureType.

Enum values:

Constructor Detail

KHRExternalFenceFdback to summary
protected KHRExternalFenceFd()

Method Detail

nvkGetFenceFdKHRback to summary
public static int nvkGetFenceFdKHR(VkDevice device, long pGetFdInfo, long pFd)

Unsafe version of: GetFenceFdKHR

nvkImportFenceFdKHRback to summary
public static int nvkImportFenceFdKHR(VkDevice device, long pImportFenceFdInfo)

Unsafe version of: ImportFenceFdKHR

vkGetFenceFdKHRback to summary
public static int vkGetFenceFdKHR(VkDevice device, VkFenceGetFdInfoKHR pGetFdInfo, IntBuffer pFd)

Get a POSIX file descriptor handle for a fence.

C Specification

To export a POSIX file descriptor representing the payload of a fence, call:


VkResult vkGetFenceFdKHR(
    VkDevice                                    device,
    const VkFenceGetFdInfoKHR*                  pGetFdInfo,
    int*                                        pFd);
Description

Each call to vkGetFenceFdKHR 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 when it is no longer needed.

Note

Ownership can be released in many ways. For example, the application can call close() on the file descriptor, or transfer ownership back to Vulkan by using the file descriptor to import a fence payload.

If pGetFdInfo→handleType is EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT and the fence is signaled at the time vkGetFenceFdKHR is called, pFd may return the value -1 instead of a valid file descriptor.

Where supported by the operating system, the implementation must set the file descriptor to be closed automatically when an execve system call is made.

Exporting a file descriptor from a fence may have side effects depending on the transference of the specified handle type, as described in Importing Fence State.

Valid Usage (Implicit)
  • device must be a valid VkDevice handle
  • pGetFdInfo must be a valid pointer to a valid VkFenceGetFdInfoKHR 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

VkFenceGetFdInfoKHR

Parameters
device:VkDevice

the logical device that created the fence being exported.

pGetFdInfo:VkFenceGetFdInfoKHR

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

pFd:IntBuffer

will return the file descriptor representing the fence payload.

Annotations
@NativeType:VkResult
vkGetFenceFdKHRback to summary
public static int vkGetFenceFdKHR(VkDevice device, VkFenceGetFdInfoKHR pGetFdInfo, int[] pFd)

Array version of: GetFenceFdKHR

Annotations
@NativeType:VkResult
vkImportFenceFdKHRback to summary
public static int vkImportFenceFdKHR(VkDevice device, VkImportFenceFdInfoKHR pImportFenceFdInfo)

Import a fence from a POSIX file descriptor.

C Specification

To import a fence payload from a POSIX file descriptor, call:


VkResult vkImportFenceFdKHR(
    VkDevice                                    device,
    const VkImportFenceFdInfoKHR*               pImportFenceFdInfo);
Description

Importing a fence payload from a file descriptor transfers ownership of the file descriptor from the application to the Vulkan implementation. The application must not perform any operations on the file descriptor after a successful import.

Applications can import the same fence payload into multiple instances of Vulkan, into the same instance from which it was exported, and multiple times into a given Vulkan instance.

Valid Usage
  • fence must not be associated with any queue command that has not yet completed execution on that queue
Valid Usage (Implicit)
  • device must be a valid VkDevice handle
  • pImportFenceFdInfo must be a valid pointer to a valid VkImportFenceFdInfoKHR structure
Return Codes
On success, this command returns
On failure, this command returns
See Also

VkImportFenceFdInfoKHR

Parameters
device:VkDevice

the logical device that created the fence.

pImportFenceFdInfo:VkImportFenceFdInfoKHR

a pointer to a VkImportFenceFdInfoKHR structure specifying the fence and import parameters.

Annotations
@NativeType:VkResult