vulkan-2.0.0.1: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Extensions.VK_KHR_external_semaphore_win32

Synopsis

Documentation

vkGetSemaphoreWin32HandleKHR :: ("device" ::: VkDevice) -> ("pGetWin32HandleInfo" ::: Ptr VkSemaphoreGetWin32HandleInfoKHR) -> ("pHandle" ::: Ptr HANDLE) -> IO VkResult Source #

vkGetSemaphoreWin32HandleKHR - Get a Windows HANDLE for a semaphore

Parameters

  • device is the logical device that created the semaphore being exported.
  • pGetWin32HandleInfo is a pointer to an instance of the VkSemaphoreGetWin32HandleInfoKHR structure containing parameters of the export operation.
  • pHandle will return the Windows handle representing the semaphore state.

Description

For handle types defined as NT handles, the handles returned by vkGetSemaphoreWin32HandleKHR are owned by the application. To avoid leaking resources, the application must release ownership of them using the CloseHandle system call when they are no longer needed.

Exporting a Windows handle from a semaphore may have side effects depending on the transference of the specified handle type, as described in Importing Semaphore Payloads.

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • pGetWin32HandleInfo must be a valid pointer to a valid VkSemaphoreGetWin32HandleInfoKHR structure
  • pHandle must be a valid pointer to a HANDLE value

Return Codes

[Success] - VK_SUCCESS

[Failure] - VK_ERROR_TOO_MANY_OBJECTS

  • VK_ERROR_OUT_OF_HOST_MEMORY

See Also

VkDevice, VkSemaphoreGetWin32HandleInfoKHR

vkImportSemaphoreWin32HandleKHR :: ("device" ::: VkDevice) -> ("pImportSemaphoreWin32HandleInfo" ::: Ptr VkImportSemaphoreWin32HandleInfoKHR) -> IO VkResult Source #

vkImportSemaphoreWin32HandleKHR - Import a semaphore from a Windows HANDLE

Parameters

  • device is the logical device that created the semaphore.

Description

Importing a semaphore payload from Windows handles does not transfer ownership of the handle to the Vulkan implementation. For handle types defined as NT handles, the application must release ownership using the CloseHandle system call when the handle is no longer needed.

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.

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • pImportSemaphoreWin32HandleInfo must be a valid pointer to a valid VkImportSemaphoreWin32HandleInfoKHR structure

Return Codes

[Success] - VK_SUCCESS

[Failure] - VK_ERROR_OUT_OF_HOST_MEMORY

  • VK_ERROR_INVALID_EXTERNAL_HANDLE

See Also

VkDevice, VkImportSemaphoreWin32HandleInfoKHR

data VkImportSemaphoreWin32HandleInfoKHR Source #

VkImportSemaphoreWin32HandleInfoKHR - Structure specifying Windows handle to import to a semaphore

Description

The handle types supported by handleType are:

Handle Type Transference Permanence Supported
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT Reference Temporary,Permanent
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT Reference Temporary,Permanent
VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT Reference Temporary,Permanent

Handle Types Supported by VkImportSemaphoreWin32HandleInfoKHR

Valid Usage

  • If handleType is not VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, name must be NULL.
  • If handleType is not 0 and handle is NULL, name must name a valid synchronization primitive of the type specified by handleType.
  • If handleType is not 0 and name is NULL, handle must be a valid handle of the type specified by handleType.
  • If handle is not NULL, name must be NULL.
  • If handle is not NULL, it must obey any requirements listed for handleType in external semaphore handle types compatibility.
  • If name is not NULL, it must obey any requirements listed for handleType in external semaphore handle types compatibility.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_IMPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR

Host Synchronization

  • Host access to semaphore must be externally synchronized

See Also

VkExternalSemaphoreHandleTypeFlagBits, VkSemaphore, VkSemaphoreImportFlags, VkStructureType, vkImportSemaphoreWin32HandleKHR

Constructors

VkImportSemaphoreWin32HandleInfoKHR 

Fields

data VkExportSemaphoreWin32HandleInfoKHR Source #

VkExportSemaphoreWin32HandleInfoKHR - Structure specifying additional attributes of Windows handles exported from a semaphore

Description

If this structure is not present, or if pAttributes is set to NULL, default security descriptor values will be used, and child processes created by the application will not inherit the handle, as described in the MSDN documentation for “Synchronization Object Security and Access Rights”1. Further, if the structure is not present, the access rights will be

DXGI_SHARED_RESOURCE_READ | DXGI_SHARED_RESOURCE_WRITE

for handles of the following types:

VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT

And

GENERIC_ALL

for handles of the following types:

VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT
1
https://msdn.microsoft.com/en-us/library/windows/desktop/ms686670.aspx

Valid Usage

  • If VkExportSemaphoreCreateInfo::handleTypes does not include VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_WIN32_BIT or VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_D3D12_FENCE_BIT, VkExportSemaphoreWin32HandleInfoKHR must not be in the pNext chain of VkSemaphoreCreateInfo.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_EXPORT_SEMAPHORE_WIN32_HANDLE_INFO_KHR
  • If pAttributes is not NULL, pAttributes must be a valid pointer to a valid SECURITY_ATTRIBUTES value

See Also

VkStructureType

Constructors

VkExportSemaphoreWin32HandleInfoKHR 

Fields

  • vkSType :: VkStructureType

    sType is the type of this structure.

  • vkPNext :: Ptr ()

    pNext is NULL or a pointer to an extension-specific structure.

  • vkPAttributes :: Ptr SECURITY_ATTRIBUTES

    pAttributes is a pointer to a Windows SECURITY_ATTRIBUTES structure specifying security attributes of the handle.

  • vkDwAccess :: DWORD

    dwAccess is a DWORD specifying access rights of the handle.

  • vkName :: LPCWSTR

    name is a NULL-terminated UTF-16 string to associate with the underlying synchronization primitive referenced by NT handles exported from the created semaphore.

data VkD3D12FenceSubmitInfoKHR Source #

VkD3D12FenceSubmitInfoKHR - Structure specifying values for Direct3D 12 fence-backed semaphores

Description

If the semaphore in VkSubmitInfo::pWaitSemaphores or VkSubmitInfo::pSignalSemaphores corresponding to an entry in pWaitSemaphoreValues or pSignalSemaphoreValues respectively does not currently have a payload referring to a Direct3D 12 fence, the implementation must ignore the value in the pWaitSemaphoreValues or pSignalSemaphoreValues entry.

Valid Usage

  • waitSemaphoreValuesCount must be the same value as VkSubmitInfo::waitSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.
  • signalSemaphoreValuesCount must be the same value as VkSubmitInfo::signalSemaphoreCount, where VkSubmitInfo is in the pNext chain of this VkD3D12FenceSubmitInfoKHR structure.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_D3D12_FENCE_SUBMIT_INFO_KHR
  • If waitSemaphoreValuesCount is not 0, and pWaitSemaphoreValues is not NULL, pWaitSemaphoreValues must be a valid pointer to an array of waitSemaphoreValuesCount uint64_t values
  • If signalSemaphoreValuesCount is not 0, and pSignalSemaphoreValues is not NULL, pSignalSemaphoreValues must be a valid pointer to an array of signalSemaphoreValuesCount uint64_t values

See Also

VkStructureType

Constructors

VkD3D12FenceSubmitInfoKHR 

Fields

data VkSemaphoreGetWin32HandleInfoKHR Source #

VkSemaphoreGetWin32HandleInfoKHR - Structure describing a Win32 handle semaphore export operation

Description

The properties of the handle returned depend on the value of handleType. See VkExternalSemaphoreHandleTypeFlagBits for a description of the properties of the defined external semaphore handle types.

Valid Usage

  • If handleType is defined as an NT handle, vkGetSemaphoreWin32HandleKHR must be called no more than once for each valid unique combination of semaphore and handleType.
  • 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 in VkExternalSemaphoreProperties::exportFromImportedHandleTypes for handleType.
  • 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 on semaphore.
  • 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 an NT handle or a global share handle.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_SEMAPHORE_GET_WIN32_HANDLE_INFO_KHR

See Also

VkExternalSemaphoreHandleTypeFlagBits, VkSemaphore, VkStructureType, vkGetSemaphoreWin32HandleKHR

Constructors

VkSemaphoreGetWin32HandleInfoKHR 

Fields