Safe Haskell | None |
---|---|
Language | Haskell2010 |
Name
VK_KHR_external_semaphore_fd - device extension
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
- Requires Vulkan 1.0
- Requires
VK_KHR_external_semaphore
- 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
Description
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.
New Commands
New Structures
New Enum Constants
Issues
1) Does the application need to close the file descriptor returned by
getSemaphoreFdKHR
?
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.
Version History
Revision 1, 2016-10-21 (Jesse Hall)
- Initial revision
See Also
ImportSemaphoreFdInfoKHR
, SemaphoreGetFdInfoKHR
,
getSemaphoreFdKHR
, importSemaphoreFdKHR
Document Notes
For more information, see the Vulkan Specification
This page is a generated document. Fixes and changes should be made to the generator scripts, not directly.
Synopsis
- getSemaphoreFdKHR :: forall io. MonadIO io => Device -> SemaphoreGetFdInfoKHR -> io ("fd" ::: Int32)
- importSemaphoreFdKHR :: forall io. MonadIO io => Device -> ImportSemaphoreFdInfoKHR -> io ()
- data ImportSemaphoreFdInfoKHR = ImportSemaphoreFdInfoKHR {}
- data SemaphoreGetFdInfoKHR = SemaphoreGetFdInfoKHR {}
- type KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION = 1
- pattern KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION :: forall a. Integral a => a
- type KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME = "VK_KHR_external_semaphore_fd"
- pattern KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a
Documentation
:: forall io. MonadIO io | |
=> Device |
|
-> SemaphoreGetFdInfoKHR |
|
-> io ("fd" ::: Int32) |
vkGetSemaphoreFdKHR - Get a POSIX file descriptor handle for a semaphore
Description
Each call to getSemaphoreFdKHR
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.
Return Codes
See Also
:: forall io. MonadIO io | |
=> Device |
|
-> ImportSemaphoreFdInfoKHR |
|
-> io () |
vkImportSemaphoreFdKHR - Import a semaphore from a POSIX file descriptor
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.
Return Codes
See Also
VK_KHR_external_semaphore_fd,
Device
, ImportSemaphoreFdInfoKHR
data ImportSemaphoreFdInfoKHR Source #
VkImportSemaphoreFdInfoKHR - Structure specifying POSIX file descriptor to import to a semaphore
Description
The handle types supported by handleType
are:
Handle Type | Transference | Permanence Supported |
---|---|---|
EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT | Reference | Temporary,Permanent |
EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT | Copy | Temporary |
Handle Types Supported by ImportSemaphoreFdInfoKHR
Valid Usage
-
handleType
must be a value included in the Handle Types Supported by table
-
fd
must obey any requirements listed forhandleType
in external semaphore handle types compatibility - If
handleType
isEXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT
, theSemaphoreCreateInfo
::flags
field must match that of the semaphore from whichfd
was exported - If
handleType
isEXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT
, theSemaphoreTypeCreateInfo
::semaphoreType
field must match that of the semaphore from whichfd
was exported - If
flags
containsSEMAPHORE_IMPORT_TEMPORARY_BIT
, theSemaphoreTypeCreateInfo
::semaphoreType
field of the semaphore from whichfd
was exported must not beSEMAPHORE_TYPE_TIMELINE
If handleType
is
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 Semaphore
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
EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT
from a Semaphore
which is signaled.
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_IMPORT_SEMAPHORE_FD_INFO_KHR
-
pNext
must beNULL
-
semaphore
must be a validSemaphore
handle -
flags
must be a valid combination ofSemaphoreImportFlagBits
values -
handleType
must be a validExternalSemaphoreHandleTypeFlagBits
value
Host Synchronization
- Host access to
semaphore
must be externally synchronized
See Also
VK_KHR_external_semaphore_fd,
ExternalSemaphoreHandleTypeFlagBits
,
Semaphore
,
SemaphoreImportFlags
,
StructureType
,
importSemaphoreFdKHR
ImportSemaphoreFdInfoKHR | |
|
Instances
data SemaphoreGetFdInfoKHR Source #
VkSemaphoreGetFdInfoKHR - Structure describing a POSIX FD semaphore export operation
Description
The properties of the file descriptor returned depend on the value of
handleType
. See
ExternalSemaphoreHandleTypeFlagBits
for a description of the properties of the defined external semaphore
handle types.
Valid Usage
-
handleType
must have been included inExportSemaphoreCreateInfo
::handleTypes
whensemaphore
’s current payload was created
-
semaphore
must not currently have its payload replaced by an imported payload as described below in Importing Semaphore Payloads unless that imported payload’s handle type was included inExternalSemaphoreProperties
::exportFromImportedHandleTypes
forhandleType
- If
handleType
refers to a handle type with copy payload transference semantics, as defined below in Importing Semaphore Payloads, there must be no queue waiting onsemaphore
- If
handleType
refers to a handle type with copy payload transference semantics,semaphore
must be signaled, or have an associated semaphore signal operation pending execution -
handleType
must be defined as a POSIX file descriptor handle - If
handleType
refers to a handle type with copy payload transference semantics,semaphore
must have been created with aSemaphoreType
ofSEMAPHORE_TYPE_BINARY
- If
handleType
refers to a handle type with copy payload transference semantics,semaphore
must have an associated semaphore signal operation that has been submitted for execution and any semaphore signal operations on which it depends (if any) must have also been submitted for execution
Valid Usage (Implicit)
-
sType
must beSTRUCTURE_TYPE_SEMAPHORE_GET_FD_INFO_KHR
-
pNext
must beNULL
-
semaphore
must be a validSemaphore
handle -
handleType
must be a validExternalSemaphoreHandleTypeFlagBits
value
See Also
VK_KHR_external_semaphore_fd,
ExternalSemaphoreHandleTypeFlagBits
,
Semaphore
,
StructureType
, getSemaphoreFdKHR
SemaphoreGetFdInfoKHR | |
|
Instances
pattern KHR_EXTERNAL_SEMAPHORE_FD_SPEC_VERSION :: forall a. Integral a => a Source #
type KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME = "VK_KHR_external_semaphore_fd" Source #
pattern KHR_EXTERNAL_SEMAPHORE_FD_EXTENSION_NAME :: forall a. (Eq a, IsString a) => a Source #