C Specification
To import memory from a Windows handle, add a
VkImportMemoryWin32HandleInfoKHR structure to the pNext
chain of
the VkMemoryAllocateInfo structure.
The VkImportMemoryWin32HandleInfoKHR
structure is defined as:
// Provided by VK_KHR_external_memory_win32
typedef struct VkImportMemoryWin32HandleInfoKHR {
VkStructureType sType;
const void* pNext;
VkExternalMemoryHandleTypeFlagBits handleType;
HANDLE handle;
LPCWSTR name;
} VkImportMemoryWin32HandleInfoKHR;
Members
-
sType
is a VkStructureType value identifying this structure. -
pNext
isNULL
or a pointer to a structure extending this structure. -
handleType
is a VkExternalMemoryHandleTypeFlagBits value specifying the type ofhandle
orname
. -
handle
isNULL
or the external handle to import. -
name
isNULL
or a null-terminated UTF-16 string naming the payload to import.
Description
Importing memory object payloads 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 handle
ownership using the CloseHandle
system call when the handle is no
longer needed.
For handle types defined as NT handles, the imported memory object holds a
reference to its payload.
Note
Non-NT handle import operations do not add a reference to their associated payload. If the original object owning the payload is destroyed, all resources and handles sharing that payload will become invalid. |
Applications can import the same payload 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.
Document Notes
For more information, see the Vulkan Specification
This page is extracted from the Vulkan Specification. Fixes and changes should be made to the Specification, not directly.