/ appendices / VK_EXT_external_memory_host.txt
VK_EXT_external_memory_host.txt
  1  include::meta/VK_EXT_external_memory_host.txt[]
  2  
  3  *Last Modified Date*::
  4      2017-11-10
  5  *IP Status*::
  6      No known IP claims.
  7  *Contributors*::
  8    - Jaakko Konttinen, AMD
  9    - David Mao, AMD
 10    - Daniel Rakos, AMD
 11    - Tobias Hector, Imagination Technologies
 12    - Jason Ekstrand, Intel
 13    - James Jones, NVIDIA
 14  
 15  This extension enables an application to import host allocations and host
 16  mapped foreign device memory to Vulkan memory objects.
 17  
 18  === New Object Types
 19  
 20  None.
 21  
 22  === New Enum Constants
 23  
 24    * Extending elink:VkStructureType:
 25    ** ename:VK_STRUCTURE_TYPE_IMPORT_MEMORY_HOST_POINTER_INFO_EXT
 26    ** ename:VK_STRUCTURE_TYPE_MEMORY_HOST_POINTER_PROPERTIES_EXT
 27    ** ename:VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTERNAL_MEMORY_HOST_PROPERTIES_EXT
 28  
 29    * Extending elink:VkExternalMemoryHandleTypeFlagBitsKHR:
 30    ** ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT
 31    ** ename:VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_MAPPED_FOREIGN_MEMORY_BIT_EXT
 32  
 33  === New Enums
 34  
 35  None.
 36  
 37  === New Structs
 38  
 39    * slink:VkImportMemoryHostPointerInfoEXT
 40    * slink:VkMemoryHostPointerPropertiesEXT
 41    * slink:VkPhysicalDeviceExternalMemoryHostPropertiesEXT
 42  
 43  === New Functions
 44  
 45    * flink:vkGetMemoryHostPointerPropertiesEXT
 46  
 47  === Issues
 48  
 49  1) What memory type has to be used to import host pointers?
 50  
 51  RESOLVED: Depends on the implementation.
 52  Applications have to use the new flink:vkGetMemoryHostPointerPropertiesEXT
 53  command to query the supported memory types for a particular host pointer.
 54  The reported memory types may include memory types that come from a memory
 55  heap that is otherwise not usable for regular memory object allocation and
 56  thus such a heap's size may be zero.
 57  
 58  2) Can the application still access the contents of the host allocation
 59  after importing?
 60  
 61  RESOLVED: Yes.
 62  However, usual synchronization requirements apply.
 63  
 64  3) Can the application free the host allocation?
 65  
 66  RESOLVED: No, it violates valid usage conditions.
 67  Using the memory object imported from a host allocation that's already freed
 68  thus results in undefined: behavior.
 69  
 70  4) Is flink:vkMapMemory expected to return the same host address which was
 71  specified when importing it to the memory object?
 72  
 73  RESOLVED: No.
 74  Implementations are allowed to return the same address but it's not
 75  required.
 76  Some implementations might return a different virtual mapping of the
 77  allocation, although the same physical pages will be used.
 78  
 79  5) Is there any limitation on the alignment of the host pointer and/or size?
 80  
 81  RESOLVED: Yes.
 82  Both the address and the size have to be an integer multiple of
 83  pname:minImportedHostPointerAlignment.
 84  In addition, some platforms and foreign devices may have additional
 85  restrictions.
 86  
 87  6) Can the same host allocation be imported multiple times into a given
 88  physical device?
 89  
 90  RESOLVED: No, at least not guaranteed by this extension.
 91  Some platforms do not allow locking the same physical pages for device
 92  access multiple times, so attempting to do it may result in undefined:
 93  behavior.
 94  
 95  7) Does this extension support exporting the new handle type?
 96  
 97  RESOLVED: No.
 98  
 99  8) Should we include the possibility to import host mapped foreign device
100  memory using this API?
101  
102  RESOLVED: Yes, through a separate handle type.
103  Implementations are still allowed to support only one of the handle types
104  introduced by this extension by not returning import support for a
105  particular handle type as returned in slink:VkExternalMemoryPropertiesKHR.
106  
107  === Version History
108  
109   * Revision 1, 2017-11-10 (Daniel Rakos)
110     - Internal revisions