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