| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Graphics.Vulkan.Extensions.VK_KHR_external_fence_fd
- pattern VK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR :: VkStructureType
- pattern VK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR :: VkStructureType
- pattern VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION :: Integral a => a
- pattern VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME :: (Eq a, IsString a) => a
- vkGetFenceFdKHR :: ("device" ::: VkDevice) -> ("pGetFdInfo" ::: Ptr VkFenceGetFdInfoKHR) -> ("pFd" ::: Ptr CInt) -> IO VkResult
- vkImportFenceFdKHR :: ("device" ::: VkDevice) -> ("pImportFenceFdInfo" ::: Ptr VkImportFenceFdInfoKHR) -> IO VkResult
- data VkImportFenceFdInfoKHR = VkImportFenceFdInfoKHR {}
- data VkFenceGetFdInfoKHR = VkFenceGetFdInfoKHR {}
Documentation
pattern VK_KHR_EXTERNAL_FENCE_FD_SPEC_VERSION :: Integral a => a Source #
pattern VK_KHR_EXTERNAL_FENCE_FD_EXTENSION_NAME :: (Eq a, IsString a) => a Source #
vkGetFenceFdKHR :: ("device" ::: VkDevice) -> ("pGetFdInfo" ::: Ptr VkFenceGetFdInfoKHR) -> ("pFd" ::: Ptr CInt) -> IO VkResult Source #
vkGetFenceFdKHR - Get a POSIX file descriptor handle for a fence
Parameters
deviceis the logical device that created the fence being exported.
pGetFdInfois a pointer to an instance of theVkFenceGetFdInfoKHRstructure containing parameters of the export operation.pFdwill return the file descriptor representing the fence payload.
Description
Each call to vkGetFenceFdKHR 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 fence payload.
If pGetFdInfo::handleType is
VK_EXTERNAL_FENCE_HANDLE_TYPE_SYNC_FD_BIT and the fence is signaled at
the time vkGetFenceFdKHR is called, pFd may return the value -1
instead of a valid file descriptor.
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 fence may have side effects depending on the transference of the specified handle type, as described in Importing Fence State.
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
pGetFdInfomust be a valid pointer to a validVkFenceGetFdInfoKHRstructurepFdmust be a valid pointer to aintvalue
Return Codes
- Success
- -
VK_SUCCESS
- Failure
- -
VK_ERROR_TOO_MANY_OBJECTSVK_ERROR_OUT_OF_HOST_MEMORY
See Also
vkImportFenceFdKHR :: ("device" ::: VkDevice) -> ("pImportFenceFdInfo" ::: Ptr VkImportFenceFdInfoKHR) -> IO VkResult Source #
vkImportFenceFdKHR - Import a fence from a POSIX file descriptor
Parameters
deviceis the logical device that created the fence.
pImportFenceFdInfopoints to aVkImportFenceFdInfoKHRstructure specifying the fence and import parameters.
Description
Importing a fence 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 fence 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
fencemust not be associated with any queue command that has not yet completed execution on that queue
Valid Usage (Implicit)
devicemust be a validVkDevicehandle
pImportFenceFdInfomust be a valid pointer to a validVkImportFenceFdInfoKHRstructure
Return Codes
- Success
- -
VK_SUCCESS
- Failure
- -
VK_ERROR_OUT_OF_HOST_MEMORYVK_ERROR_INVALID_EXTERNAL_HANDLE
See Also
data VkImportFenceFdInfoKHR Source #
VkImportFenceFdInfoKHR - (None)
Description
The handle types supported by handleType are:
+-----------------------+-----------------------+-----------------------+ | Handle Type | Transference | Permanence Supported | +=======================+=======================+=======================+ | @VK_EXTERNAL_FENCE_HA | Reference | Temporary,Permanent | | NDLE_TYPE_OPAQUE_FD_B | | | | IT@ | | | +-----------------------+-----------------------+-----------------------+ | @VK_EXTERNAL_FENCE_HA | Copy | Temporary | | NDLE_TYPE_SYNC_FD_BIT | | | | @ | | | +-----------------------+-----------------------+-----------------------+ Handle Types Supported by VkImportFenceFdInfoKHR
Valid Usage
handleTypemust be a value included in the Handle Types Supported by VkImportFenceFdInfoKHR table.
fdmust obey any requirements listed forhandleTypein external fence handle types compatibility.
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 doesn’t 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)
sTypemust beVK_STRUCTURE_TYPE_IMPORT_FENCE_FD_INFO_KHR
pNextmust beNULLfencemust be a validVkFencehandleflagsmust be a valid combination ofVkFenceImportFlagBitsvalueshandleTypemust be a validVkExternalFenceHandleTypeFlagBitsvalue
Host Synchronization
- Host access to
fencemust be externally synchronized
See Also
VkExternalFenceHandleTypeFlagBits,
VkFence,
VkFenceImportFlags,
VkStructureType, vkImportFenceFdKHR
Constructors
| VkImportFenceFdInfoKHR | |
Fields
| |
data VkFenceGetFdInfoKHR Source #
VkFenceGetFdInfoKHR - Structure describing a POSIX FD fence export operation
Description
The properties of the file descriptor returned depend on the value of
handleType. See
VkExternalFenceHandleTypeFlagBits
for a description of the properties of the defined external fence handle
types.
Valid Usage
handleTypemust have been included inVkExportFenceCreateInfo::handleTypeswhenfence’s current payload was created.
- If
handleTyperefers to a handle type with copy payload transference semantics,fencemust be signaled, or have an associated fence signal operation pending execution. fencemust not currently have its payload replaced by an imported payload as described below in Importing Fence Payloads unless that imported payload’s handle type was included inVkExternalFenceProperties::exportFromImportedHandleTypesforhandleType.handleTypemust be defined as a POSIX file descriptor handle.
Valid Usage (Implicit)
sTypemust beVK_STRUCTURE_TYPE_FENCE_GET_FD_INFO_KHR
pNextmust beNULLfencemust be a validVkFencehandlehandleTypemust be a validVkExternalFenceHandleTypeFlagBitsvalue
See Also
VkExternalFenceHandleTypeFlagBits,
VkFence,
VkStructureType, vkGetFenceFdKHR
Constructors
| VkFenceGetFdInfoKHR | |
Fields
| |