1[open,refpage='VkImportMemoryWin32HandleInfoNV',desc='import Win32 memory created on the same physical device',type='structs'] 2-- 3 4To import memory created on the same physical device but outside of the 5current Vulkan instance, add a slink:VkImportMemoryWin32HandleInfoNV 6structure to the pname:pNext chain of the slink:VkMemoryAllocateInfo 7structure, specifying a handle to and the type of the memory. 8 9The sname:VkImportMemoryWin32HandleInfoNV structure is defined as: 10 11include::../../api/structs/VkImportMemoryWin32HandleInfoNV.txt[] 12 13 * pname:sType is the type of this structure. 14 * pname:pNext is `NULL` or a pointer to an extension-specific structure. 15 * pname:handleType is `0` or a elink:VkExternalMemoryHandleTypeFlagBitsNV 16 value specifying the type of memory handle in pname:handle. 17 * pname:handle is a Windows code:HANDLE referring to the memory. 18 19If pname:handleType is `0`, this structure is ignored by consumers of the 20slink:VkMemoryAllocateInfo structure it is chained from. 21 22.Valid Usage 23**** 24 * [[VUID-VkImportMemoryWin32HandleInfoNV-handleType-01327]] 25 pname:handleType must: not have more than one bit set. 26 * [[VUID-VkImportMemoryWin32HandleInfoNV-handle-01328]] 27 pname:handle must: be a valid handle to memory, obtained as specified by 28 pname:handleType. 29**** 30 31include::../../validity/structs/VkImportMemoryWin32HandleInfoNV.txt[] 32-- 33 34Bits which can: be set in pname:handleType are: 35 36[open,refpage='VkExternalMemoryHandleTypeFlagBitsNV',desc='Bitmask specifying external memory handle types',type='enums'] 37-- 38 39Possible values of slink:VkImportMemoryWin32HandleInfoNV::pname:handleType, 40specifying the type of an external memory handle, are: 41 42include::../../api/enums/VkExternalMemoryHandleTypeFlagBitsNV.txt[] 43 44 * ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_KMT_BIT_NV specifies a 45 handle to memory returned by flink:vkGetMemoryWin32HandleNV. 46 * ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_NV specifies a 47 handle to memory returned by flink:vkGetMemoryWin32HandleNV, or one 48 duplicated from such a handle using `DuplicateHandle()`. 49 * ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_BIT_NV specifies a 50 valid NT handle to memory returned by 51 `IDXGIResource1::ftext:CreateSharedHandle()`, or a handle duplicated 52 from such a handle using `DuplicateHandle()`. 53 * ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_D3D11_IMAGE_KMT_BIT_NV specifies a 54 handle to memory returned by `IDXGIResource::GetSharedHandle()`. 55 56ifdef::editing-notes[] 57[NOTE] 58.editing-note 59==== 60(Jon) If additional (non-Win32) bits are added to the possible memory types, 61this type should move to the `<<VK_NV_external_memory_capabilities>>` 62section, and each bit would then be protected by ifdefs for the extension 63it's defined by. 64==== 65endif::editing-notes[] 66 67-- 68 69[open,refpage='VkExternalMemoryHandleTypeFlagsNV',desc='Bitmask of VkExternalMemoryHandleTypeFlagBitsNV',type='enums'] 70-- 71include::../../api/flags/VkExternalMemoryHandleTypeFlagsNV.txt[] 72 73sname:VkExternalMemoryHandleTypeFlagsNV is a bitmask type for setting a mask 74of zero or more slink:VkExternalMemoryHandleTypeFlagBitsNV. 75-- 76 77