## C Specification

The VkImportFenceFdInfoKHR structure is defined as:

// Provided by VK_KHR_external_fence_fd
typedef struct VkImportFenceFdInfoKHR {
VkStructureType                      sType;
const void*                          pNext;
VkFence                              fence;
VkFenceImportFlags                   flags;
VkExternalFenceHandleTypeFlagBits    handleType;
int                                  fd;
} VkImportFenceFdInfoKHR;

## Members

• sType is the type of this structure.

• pNext is NULL or a pointer to a structure extending this structure.

• fence is the fence into which the payload will be imported.

• flags is a bitmask of VkFenceImportFlagBits specifying additional parameters for the fence payload import operation.

• handleType is a VkExternalFenceHandleTypeFlagBits value specifying the type of fd.

• fd is the external handle to import.

## Description

The handle types supported by handleType are:

Table 1. Handle Types Supported by VkImportFenceFdInfoKHR
Handle Type Transference Permanence Supported

VK_EXTERNAL_FENCE_HANDLE_TYPE_OPAQUE_FD_BIT

Reference

Temporary,Permanent

VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT

Copy

Temporary

Valid Usage

If handleType is VK_EXTERNAL_FENCE_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 VkFence will have a temporarily imported payload as if a valid file descriptor had been provided.

 Note 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_FENCE_HANDLE_TYPE_SYNC_FD_BIT from a VkFence which is signaled.
Valid Usage (Implicit)
• VUID-VkImportFenceFdInfoKHR-sType-sType
sType must be VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR

• VUID-VkImportFenceFdInfoKHR-pNext-pNext
pNext must be NULL

• VUID-VkImportFenceFdInfoKHR-fence-parameter
fence must be a valid VkFence handle

• VUID-VkImportFenceFdInfoKHR-flags-parameter
flags must be a valid combination of VkFenceImportFlagBits values

• VUID-VkImportFenceFdInfoKHR-handleType-parameter
handleType must be a valid VkExternalFenceHandleTypeFlagBits value

Host Synchronization
• Host access to fence must be externally synchronized