// Copyright (c) 2016-2017 The Khronos Group Inc.
// Copyright notice at https://www.khronos.org/registry/speccopyright.html

[[VK_KHX_external_semaphore_fd]]
== VK_KHX_external_semaphore_fd

*Name String*::
    +VK_KHX_external_semaphore_fd+
*Extension Type*::
    Device extension
*Registered Extension Number*::
    80
*Status*::
    Draft
*Last Modified Date*::
    2016-10-21
*Revision*::
    1
*IP Status*::
    No known IP claims.
*Dependencies*::
  - This extension is written against version 1.0 of the Vulkan API.
  - Requires +VK_KHR_external_semaphore_capabilities+.
*Contributors*::
  - Jesse Hall, Google
  - James Jones, NVIDIA
  - Jeff Juliano, NVIDIA
  - Carsten Rohde, NVIDIA
*Contact*::
    James Jones (jajones 'at' nvidia.com)

An application using external memory may wish to synchronize access to that
memory using semaphores.
This extension enables an application to export semaphore state to and
import semaphore state from POSIX file descriptors.

=== New Object Types

None.

=== New Enum Constants

  * ename:VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHX

=== New Enums

None.

=== New Structs

  * slink:VkImportSemaphoreFdInfoKHX

=== New Functions

  * flink:vkImportSemaphoreFdKHX
  * flink:vkGetSemaphoreFdKHX

=== Issues

1) Does the application need to close the file descriptor returned by
flink:vkGetSemaphoreFdKHX?

*RESOLVED*: Yes, unless it is passed back in to a driver instance to import
the semaphore.
A successful get call transfers ownership of the file descriptor to the
application, and a successful import transfers it back to the driver.
Destroying the original semaphore object will not close the file descriptor
or remove its reference to the underlying semaphore resource associated with
it.
