vulkan-2.0.0.1: Bindings to the Vulkan graphics API.

Safe HaskellNone
LanguageHaskell2010

Graphics.Vulkan.Extensions.VK_KHR_external_memory_win32

Synopsis

Documentation

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

vkGetMemoryWin32HandleKHR - Get a Windows HANDLE for a memory object

Parameters

  • device is the logical device that created the device memory being exported.
  • pGetWin32HandleInfo is a pointer to an instance of the VkMemoryGetWin32HandleInfoKHR structure containing parameters of the export operation.
  • pHandle will return the Windows handle representing the underlying resources of the device memory object.

Description

For handle types defined as NT handles, the handles returned by vkGetMemoryWin32HandleKHR 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.

Valid Usage (Implicit)

  • device must be a valid VkDevice handle
  • pGetWin32HandleInfo must be a valid pointer to a valid VkMemoryGetWin32HandleInfoKHR 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, VkMemoryGetWin32HandleInfoKHR

vkGetMemoryWin32HandlePropertiesKHR :: ("device" ::: VkDevice) -> ("handleType" ::: VkExternalMemoryHandleTypeFlagBits) -> ("handle" ::: HANDLE) -> ("pMemoryWin32HandleProperties" ::: Ptr VkMemoryWin32HandlePropertiesKHR) -> IO VkResult Source #

vkGetMemoryWin32HandlePropertiesKHR - Get Properties of External Memory Win32 Handles

Parameters

  • device is the logical device that will be importing handle.
  • handleType is the type of the handle handle.
  • handle is the handle which will be imported.
  • pMemoryWin32HandleProperties will return properties of handle.

Valid Usage

  • handle must be an external memory handle created outside of the Vulkan API.
  • handleType must not be one of the handle types defined as opaque.

Valid Usage (Implicit)

  • device must be a valid VkDevice handle

Return Codes

[Success] - VK_SUCCESS

[Failure] - VK_ERROR_INVALID_EXTERNAL_HANDLE

See Also

VkDevice, VkExternalMemoryHandleTypeFlagBits, VkMemoryWin32HandlePropertiesKHR

data VkImportMemoryWin32HandleInfoKHR Source #

VkImportMemoryWin32HandleInfoKHR - import Win32 memory created on the same physical device

Description

Importing memory objects 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 underlying memory into multiple instances of Vulkan, into the same instance from which it was exported, and multiple times into a given Vulkan instance. In all cases, each import operation must create a distinct VkDeviceMemory object.

Valid Usage

  • The memory from which handle was exported, or the memory named by name must have been created on the same underlying physical device as device.
  • If handleType is not 0, it must be defined as an NT handle or a global share handle.
  • If handleType is not VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, name must be NULL.
  • If handleType is not 0 and handle is NULL, name must name a valid memory resource 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 memory handle types compatibility.
  • If name is not NULL, it must obey any requirements listed for handleType in external memory handle types compatibility.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR

See Also

VkExternalMemoryHandleTypeFlagBits, VkStructureType

Constructors

VkImportMemoryWin32HandleInfoKHR 

Fields

data VkExportMemoryWin32HandleInfoKHR Source #

VkExportMemoryWin32HandleInfoKHR - Structure specifying additional attributes of Windows handles exported from a memory

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_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT

And

GENERIC_ALL

for handles of the following types:

VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT

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

Valid Usage

  • If VkExportMemoryAllocateInfo::handleTypes does not include VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_TEXTURE_BIT, VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_HEAP_BIT, or VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D12_RESOURCE_BIT, VkExportMemoryWin32HandleInfoKHR must not be in the pNext chain of VkMemoryAllocateInfo.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_EXPORT_MEMORY_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

VkExportMemoryWin32HandleInfoKHR 

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 resource referenced by NT handles exported from the created memory.

data VkMemoryWin32HandlePropertiesKHR Source #

VkMemoryWin32HandlePropertiesKHR - Properties of External Memory Windows Handles

See Also

VkStructureType, vkGetMemoryWin32HandlePropertiesKHR

Constructors

VkMemoryWin32HandlePropertiesKHR 

Fields

  • vkSType :: VkStructureType

    sType is the type of this structure.

  • vkPNext :: Ptr ()

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

  • vkMemoryTypeBits :: Word32

    memoryTypeBits is a bitmask containing one bit set for every memory type which the specified windows handle can be imported as.

data VkMemoryGetWin32HandleInfoKHR Source #

VkMemoryGetWin32HandleInfoKHR - Structure describing a Win32 handle semaphore export operation

Description

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

Valid Usage

  • If handleType is defined as an NT handle, vkGetMemoryWin32HandleKHR must be called no more than once for each valid unique combination of memory and handleType.
  • handleType must be defined as an NT handle or a global share handle.

Valid Usage (Implicit)

  • sType must be VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR

See Also

VkDeviceMemory, VkExternalMemoryHandleTypeFlagBits, VkStructureType, vkGetMemoryWin32HandleKHR

Constructors

VkMemoryGetWin32HandleInfoKHR 

Fields