/ appendices / VK_KHR_external_memory_fd.txt
VK_KHR_external_memory_fd.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_fd.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 15 An application may wish to reference device memory in multiple Vulkan 16 logical devices or instances, in multiple processes, and/or in multiple 17 APIs. 18 This extension enables an application to export POSIX file descriptor 19 handles from Vulkan memory objects and to import Vulkan memory objects from 20 POSIX file descriptor handles exported from other Vulkan memory objects or 21 from similar resources in other APIs. 22 23 === New Object Types 24 25 None. 26 27 === New Enum Constants 28 29 * ename:VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR 30 * ename:VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR 31 * ename:VK_STRUCTURE_TYPE_MEMORY_GET_FD_INFO_KHR 32 33 === New Enums 34 35 None. 36 37 === New Structs 38 39 * slink:VkImportMemoryFdInfoKHR 40 * slink:VkMemoryFdPropertiesKHR 41 * slink:VkMemoryGetFdInfoKHR 42 43 === New Functions 44 45 * flink:vkGetMemoryFdKHR 46 * flink:vkGetMemoryFdPropertiesKHR 47 48 === Issues 49 50 1) Does the application need to close the file descriptor returned by 51 flink:vkGetMemoryFdKHR? 52 53 *RESOLVED*: Yes, unless it is passed back in to a driver instance to import 54 the memory. 55 A successful get call transfers ownership of the file descriptor to the 56 application, and a successful import transfers it back to the driver. 57 Destroying the original memory object will not close the file descriptor or 58 remove its reference to the underlying memory resource associated with it. 59 60 2) Do drivers ever need to expose multiple file descriptors per memory 61 object? 62 63 *RESOLVED*: No. 64 This would indicate there are actually multiple memory objects, rather than 65 a single memory object. 66 67 3) How should the valid size and memory type for POSIX file descriptor 68 memory handles created outside of Vulkan be specified? 69 70 *RESOLVED*: The valid memory types are queried directly from the external 71 handle. 72 The size will be specified by future extensions that introduce such external 73 memory handle types.