VkImportSemaphoreFdInfoKHR
The VkImportSemaphoreFdInfoKHR
structure is defined as:
typedef struct VkImportSemaphoreFdInfoKHR {
VkStructureType sType;
const void* pNext;
VkSemaphore semaphore;
VkSemaphoreImportFlags flags;
VkExternalSemaphoreHandleTypeFlagBits handleType;
int fd;
} VkImportSemaphoreFdInfoKHR;
sType
is a VkStructureType value identifying this structure.pNext
isNULL
or a pointer to a structure extending this structure.semaphore
is the semaphore into which the payload will be imported.flags
is a bitmask of VkSemaphoreImportFlagBits specifying additional parameters for the semaphore payload import operation.handleType
is a VkExternalSemaphoreHandleTypeFlagBits value specifying the type offd
.fd
is the external handle to import.
The handle types supported by handleType
are:
Handle Type | Transference | Permanence Supported |
---|---|---|
Reference | Temporary,Permanent | |
Copy | Temporary |
Valid Usage
VUID-VkImportSemaphoreFdInfoKHR-handleType-01143
handleType
must be a value included in the
Handle Types Supported by
VkImportSemaphoreFdInfoKHR
table
VUID-VkImportSemaphoreFdInfoKHR-fd-01544
fd
must obey any requirements listed for handleType
in
external semaphore
handle types compatibility
VUID-VkImportSemaphoreFdInfoKHR-handleType-03263
If handleType
is
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT
, the
VkSemaphoreCreateInfo::flags
field must match that of the
semaphore from which fd
was exported
VUID-VkImportSemaphoreFdInfoKHR-handleType-07307
If handleType
refers to a handle type with copy payload
transference semantics, flags
must contain
VK_SEMAPHORE_IMPORT_TEMPORARY_BIT
VUID-VkImportSemaphoreFdInfoKHR-handleType-03264
If handleType
is
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT
, the
VkSemaphoreTypeCreateInfo::semaphoreType
field must match
that of the semaphore from which fd
was exported
VUID-VkImportSemaphoreFdInfoKHR-flags-03323
If flags
contains VK_SEMAPHORE_IMPORT_TEMPORARY_BIT
, the
VkSemaphoreTypeCreateInfo::semaphoreType
field of the
semaphore from which fd
was exported must not be
VK_SEMAPHORE_TYPE_TIMELINE
If handleType
is VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT
,
the special value -1
for fd
is treated like a valid sync file
descriptor referring to an object that has already signaled.
The import operation will succeed and the VkSemaphore
will have a
temporarily imported payload as if a valid file descriptor had been
provided.
This special behavior for importing an invalid sync file descriptor allows
easier interoperability with other system APIs which use the convention that
an invalid sync file descriptor represents work that has already completed
and does not need to be waited for.
It is consistent with the option for implementations to return a -1
file
descriptor when exporting a
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT
from a VkSemaphore
which is signaled.
Valid Usage (Implicit)
VUID-VkImportSemaphoreFdInfoKHR-sType-sType
sType
must be VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR
VUID-VkImportSemaphoreFdInfoKHR-pNext-pNext
pNext
must be NULL
VUID-VkImportSemaphoreFdInfoKHR-semaphore-parameter
semaphore
must be a valid VkSemaphore handle
VUID-VkImportSemaphoreFdInfoKHR-flags-parameter
flags
must be a valid combination of VkSemaphoreImportFlagBits values
VUID-VkImportSemaphoreFdInfoKHR-handleType-parameter
handleType
must be a valid VkExternalSemaphoreHandleTypeFlagBits value
Host Synchronization
- Host access to
semaphore
must be externally synchronized ::