/ appendices / VK_KHR_external_memory_win32.txt
VK_KHR_external_memory_win32.txt
 1  // Copyright (c) 2016-2019 Khronos Group. This work is licensed under a
 2  // Creative Commons Attribution 4.0 International License; see
 3  // http://creativecommons.org/licenses/by/4.0/
 4  
 5  include::meta/VK_KHR_external_memory_win32.txt[]
 6  
 7  *Last Modified Date*::
 8      2016-10-21
 9  *IP Status*::
10      No known IP claims.
11  *Contributors*::
12    - James Jones, NVIDIA
13    - Jeff Juliano, NVIDIA
14    - Carsten Rohde, NVIDIA
15  
16  An application may wish to reference device memory in multiple Vulkan
17  logical devices or instances, in multiple processes, and/or in multiple
18  APIs.
19  This extension enables an application to export Windows handles from Vulkan
20  memory objects and to import Vulkan memory objects from Windows handles
21  exported from other Vulkan memory objects or from similar resources in other
22  APIs.
23  
24  === New Object Types
25  
26  None.
27  
28  === New Enum Constants
29  
30    * ename:VK_STRUCTURE_TYPE_IMPORT_MEMORY_WIN32_HANDLE_INFO_KHR
31    * ename:VK_STRUCTURE_TYPE_EXPORT_MEMORY_WIN32_HANDLE_INFO_KHR
32    * ename:VK_STRUCTURE_TYPE_MEMORY_WIN32_HANDLE_PROPERTIES_KHR
33    * ename:VK_STRUCTURE_TYPE_MEMORY_GET_WIN32_HANDLE_INFO_KHR
34  
35  === New Enums
36  
37  None.
38  
39  === New Structs
40  
41    * slink:VkImportMemoryWin32HandleInfoKHR
42    * slink:VkExportMemoryWin32HandleInfoKHR
43    * slink:VkMemoryWin32HandlePropertiesKHR
44    * slink:VkMemoryGetWin32HandleInfoKHR
45  
46  === New Functions
47  
48    * flink:vkGetMemoryWin32HandleKHR
49    * flink:vkGetMemoryWin32HandlePropertiesKHR
50  
51  === Issues
52  
53  1) Do applications need to call code:CloseHandle() on the values returned
54  from flink:vkGetMemoryWin32HandleKHR when pname:handleType is
55  ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_WIN32_BIT_KHR?
56  
57  ifdef::editing-notes[]
58  [NOTE]
59  .editing-note
60  ====
61  (Jon) This issue refers to a token from
62  `<<VK_KHR_external_semaphore_win32>>`, but there's no dependency or
63  interaction with that extension defined above.
64  ====
65  endif::editing-notes[]
66  
67  *RESOLVED*: Yes, unless it is passed back in to another driver instance to
68  import the object.
69  A successful get call transfers ownership of the handle to the application.
70  Destroying the memory object will not destroy the handle or the handle's
71  reference to the underlying memory resource.
72  
73  2) Should the language regarding KMT/Windows 7 handles be moved to a
74  separate extension so that it can be deprecated over time?
75  
76  *RESOLVED*: No.
77  Support for them can be deprecated by drivers if they choose, by no longer
78  returning them in the supported handle types of the instance level queries.
79  
80  3) How should the valid size and memory type for windows memory handles
81  created outside of Vulkan be specified?
82  
83  *RESOLVED*: The valid memory types are queried directly from the external
84  handle.
85  The size is determined by the associated image or buffer memory requirements
86  for external handle types that require dedicated allocations, and by the
87  size specified when creating the object from which the handle was exported
88  for other external handle types.