Top Description Fields Constructors Methods
org.lwjgl.vulkan

public Class KHRExternalSemaphoreFd

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

An application using external memory may wish to synchronize access to that memory using semaphores. This extension enables an application to export semaphore payload to and import semaphore payload from POSIX file descriptors.
VK_KHR_external_semaphore_fd
Name String
VK_KHR_external_semaphore_fd
Extension Type
Device extension
Registered Extension Number
80
Revision
1
Extension and Version Dependencies
VK_KHR_external_semaphore or Version 1.1
Contact
Other Extension Metadata
Last Modified Date
2016-10-21
IP Status
No known IP claims.
Contributors
  • Jesse Hall, Google
  • James Jones, NVIDIA
  • Jeff Juliano, NVIDIA
  • Carsten Rohde, NVIDIA

Field Summary

Modifier and TypeField and Description
public static final String
public static final int
VK_KHR_EXTERNAL_SEMAPHORE_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
nvkGetSemaphoreFdKHR(VkDevice device, long pGetFdInfo, long pFd)

Unsafe version of: GetSemaphoreFdKHR

public static int
nvkImportSemaphoreFdKHR(VkDevice device, long pImportSemaphoreFdInfo)

Unsafe version of: ImportSemaphoreFdKHR

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

Get a POSIX file descriptor handle for a semaphore.

public static int
vkGetSemaphoreFdKHR(VkDevice device, VkSemaphoreGetFdInfoKHR pGetFdInfo, int[] pFd)

Array version of: GetSemaphoreFdKHR

public static int
vkImportSemaphoreFdKHR(VkDevice
the logical device that created the semaphore.
device
,
VkImportSemaphoreFdInfoKHR
a pointer to a VkImportSemaphoreFdInfoKHR structure specifying the semaphore and import parameters.
pImportSemaphoreFdInfo
)

Import a semaphore from a POSIX file descriptor.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAMEback to summary
public static final String VK_KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME

The extension name.

VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSIONback to summary
public static final int VK_KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION

The extension specification version.

VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR

Extends VkStructureType.

Enum values:
VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHRback to summary
public static final int VK_STRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR

Extends VkStructureType.

Enum values:

Constructor Detail

KHRExternalSemaphoreFdback to summary
protected KHRExternalSemaphoreFd()

Method Detail

nvkGetSemaphoreFdKHRback to summary
public static int nvkGetSemaphoreFdKHR(VkDevice device, long pGetFdInfo, long pFd)

Unsafe version of: GetSemaphoreFdKHR

nvkImportSemaphoreFdKHRback to summary
public static int nvkImportSemaphoreFdKHR(VkDevice device, long pImportSemaphoreFdInfo)

Unsafe version of: ImportSemaphoreFdKHR

vkGetSemaphoreFdKHRback to summary
public static int vkGetSemaphoreFdKHR(VkDevice device, VkSemaphoreGetFdInfoKHR pGetFdInfo, IntBuffer pFd)

Get a POSIX file descriptor handle for a semaphore.

C Specification

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


VkResult vkGetSemaphoreFdKHR(
    VkDevice                                    device,
    const VkSemaphoreGetFdInfoKHR*              pGetFdInfo,
    int*                                        pFd);
Description

Each call to vkGetSemaphoreFdKHR 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 semaphore payload.

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 semaphore may have side effects depending on the transference of the specified handle type, as described in Importing Semaphore State.

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

VkSemaphoreGetFdInfoKHR

Parameters
device:VkDevice

the logical device that created the semaphore being exported.

pGetFdInfo:VkSemaphoreGetFdInfoKHR

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

pFd:IntBuffer

will return the file descriptor representing the semaphore payload.

Annotations
@NativeType:VkResult
vkGetSemaphoreFdKHRback to summary
public static int vkGetSemaphoreFdKHR(VkDevice device, VkSemaphoreGetFdInfoKHR pGetFdInfo, int[] pFd)

Array version of: GetSemaphoreFdKHR

Annotations
@NativeType:VkResult
vkImportSemaphoreFdKHRback to summary
public static int vkImportSemaphoreFdKHR(VkDevice device, VkImportSemaphoreFdInfoKHR pImportSemaphoreFdInfo)

Import a semaphore from a POSIX file descriptor.

C Specification

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


VkResult vkImportSemaphoreFdKHR(
    VkDevice                                    device,
    const VkImportSemaphoreFdInfoKHR*           pImportSemaphoreFdInfo);
Description

Importing a semaphore 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 semaphore 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
  • semaphore 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
  • pImportSemaphoreFdInfo must be a valid pointer to a valid VkImportSemaphoreFdInfoKHR structure
Return Codes
On success, this command returns
On failure, this command returns
See Also

VkImportSemaphoreFdInfoKHR

Parameters
device:VkDevice

the logical device that created the semaphore.

pImportSemaphoreFdInfo:VkImportSemaphoreFdInfoKHR

a pointer to a VkImportSemaphoreFdInfoKHR structure specifying the semaphore and import parameters.

Annotations
@NativeType:VkResult