vulkan_metal.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. #ifndef VULKAN_METAL_H_
  2. #define VULKAN_METAL_H_ 1
  3. /*
  4. ** Copyright 2015-2025 The Khronos Group Inc.
  5. **
  6. ** SPDX-License-Identifier: Apache-2.0
  7. */
  8. /*
  9. ** This header is generated from the Khronos Vulkan XML API Registry.
  10. **
  11. */
  12. #ifdef __cplusplus
  13. extern "C" {
  14. #endif
  15. // VK_EXT_metal_surface is a preprocessor guard. Do not pass it to API calls.
  16. #define VK_EXT_metal_surface 1
  17. #ifdef __OBJC__
  18. @class CAMetalLayer;
  19. #else
  20. typedef void CAMetalLayer;
  21. #endif
  22. #define VK_EXT_METAL_SURFACE_SPEC_VERSION 1
  23. #define VK_EXT_METAL_SURFACE_EXTENSION_NAME "VK_EXT_metal_surface"
  24. typedef VkFlags VkMetalSurfaceCreateFlagsEXT;
  25. typedef struct VkMetalSurfaceCreateInfoEXT {
  26. VkStructureType sType;
  27. const void* pNext;
  28. VkMetalSurfaceCreateFlagsEXT flags;
  29. const CAMetalLayer* pLayer;
  30. } VkMetalSurfaceCreateInfoEXT;
  31. typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
  32. #ifndef VK_NO_PROTOTYPES
  33. #ifndef VK_ONLY_EXPORTED_PROTOTYPES
  34. VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
  35. VkInstance instance,
  36. const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
  37. const VkAllocationCallbacks* pAllocator,
  38. VkSurfaceKHR* pSurface);
  39. #endif
  40. #endif
  41. // VK_EXT_metal_objects is a preprocessor guard. Do not pass it to API calls.
  42. #define VK_EXT_metal_objects 1
  43. #ifdef __OBJC__
  44. @protocol MTLDevice;
  45. typedef __unsafe_unretained id<MTLDevice> MTLDevice_id;
  46. #else
  47. typedef void* MTLDevice_id;
  48. #endif
  49. #ifdef __OBJC__
  50. @protocol MTLCommandQueue;
  51. typedef __unsafe_unretained id<MTLCommandQueue> MTLCommandQueue_id;
  52. #else
  53. typedef void* MTLCommandQueue_id;
  54. #endif
  55. #ifdef __OBJC__
  56. @protocol MTLBuffer;
  57. typedef __unsafe_unretained id<MTLBuffer> MTLBuffer_id;
  58. #else
  59. typedef void* MTLBuffer_id;
  60. #endif
  61. #ifdef __OBJC__
  62. @protocol MTLTexture;
  63. typedef __unsafe_unretained id<MTLTexture> MTLTexture_id;
  64. #else
  65. typedef void* MTLTexture_id;
  66. #endif
  67. typedef struct __IOSurface* IOSurfaceRef;
  68. #ifdef __OBJC__
  69. @protocol MTLSharedEvent;
  70. typedef __unsafe_unretained id<MTLSharedEvent> MTLSharedEvent_id;
  71. #else
  72. typedef void* MTLSharedEvent_id;
  73. #endif
  74. #define VK_EXT_METAL_OBJECTS_SPEC_VERSION 2
  75. #define VK_EXT_METAL_OBJECTS_EXTENSION_NAME "VK_EXT_metal_objects"
  76. typedef enum VkExportMetalObjectTypeFlagBitsEXT {
  77. VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT = 0x00000001,
  78. VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT = 0x00000002,
  79. VK_EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT = 0x00000004,
  80. VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT = 0x00000008,
  81. VK_EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT = 0x00000010,
  82. VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT = 0x00000020,
  83. VK_EXPORT_METAL_OBJECT_TYPE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
  84. } VkExportMetalObjectTypeFlagBitsEXT;
  85. typedef VkFlags VkExportMetalObjectTypeFlagsEXT;
  86. typedef struct VkExportMetalObjectCreateInfoEXT {
  87. VkStructureType sType;
  88. const void* pNext;
  89. VkExportMetalObjectTypeFlagBitsEXT exportObjectType;
  90. } VkExportMetalObjectCreateInfoEXT;
  91. typedef struct VkExportMetalObjectsInfoEXT {
  92. VkStructureType sType;
  93. const void* pNext;
  94. } VkExportMetalObjectsInfoEXT;
  95. typedef struct VkExportMetalDeviceInfoEXT {
  96. VkStructureType sType;
  97. const void* pNext;
  98. MTLDevice_id mtlDevice;
  99. } VkExportMetalDeviceInfoEXT;
  100. typedef struct VkExportMetalCommandQueueInfoEXT {
  101. VkStructureType sType;
  102. const void* pNext;
  103. VkQueue queue;
  104. MTLCommandQueue_id mtlCommandQueue;
  105. } VkExportMetalCommandQueueInfoEXT;
  106. typedef struct VkExportMetalBufferInfoEXT {
  107. VkStructureType sType;
  108. const void* pNext;
  109. VkDeviceMemory memory;
  110. MTLBuffer_id mtlBuffer;
  111. } VkExportMetalBufferInfoEXT;
  112. typedef struct VkImportMetalBufferInfoEXT {
  113. VkStructureType sType;
  114. const void* pNext;
  115. MTLBuffer_id mtlBuffer;
  116. } VkImportMetalBufferInfoEXT;
  117. typedef struct VkExportMetalTextureInfoEXT {
  118. VkStructureType sType;
  119. const void* pNext;
  120. VkImage image;
  121. VkImageView imageView;
  122. VkBufferView bufferView;
  123. VkImageAspectFlagBits plane;
  124. MTLTexture_id mtlTexture;
  125. } VkExportMetalTextureInfoEXT;
  126. typedef struct VkImportMetalTextureInfoEXT {
  127. VkStructureType sType;
  128. const void* pNext;
  129. VkImageAspectFlagBits plane;
  130. MTLTexture_id mtlTexture;
  131. } VkImportMetalTextureInfoEXT;
  132. typedef struct VkExportMetalIOSurfaceInfoEXT {
  133. VkStructureType sType;
  134. const void* pNext;
  135. VkImage image;
  136. IOSurfaceRef ioSurface;
  137. } VkExportMetalIOSurfaceInfoEXT;
  138. typedef struct VkImportMetalIOSurfaceInfoEXT {
  139. VkStructureType sType;
  140. const void* pNext;
  141. IOSurfaceRef ioSurface;
  142. } VkImportMetalIOSurfaceInfoEXT;
  143. typedef struct VkExportMetalSharedEventInfoEXT {
  144. VkStructureType sType;
  145. const void* pNext;
  146. VkSemaphore semaphore;
  147. VkEvent event;
  148. MTLSharedEvent_id mtlSharedEvent;
  149. } VkExportMetalSharedEventInfoEXT;
  150. typedef struct VkImportMetalSharedEventInfoEXT {
  151. VkStructureType sType;
  152. const void* pNext;
  153. MTLSharedEvent_id mtlSharedEvent;
  154. } VkImportMetalSharedEventInfoEXT;
  155. typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
  156. #ifndef VK_NO_PROTOTYPES
  157. #ifndef VK_ONLY_EXPORTED_PROTOTYPES
  158. VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT(
  159. VkDevice device,
  160. VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
  161. #endif
  162. #endif
  163. // VK_EXT_external_memory_metal is a preprocessor guard. Do not pass it to API calls.
  164. #define VK_EXT_external_memory_metal 1
  165. #define VK_EXT_EXTERNAL_MEMORY_METAL_SPEC_VERSION 1
  166. #define VK_EXT_EXTERNAL_MEMORY_METAL_EXTENSION_NAME "VK_EXT_external_memory_metal"
  167. typedef struct VkImportMemoryMetalHandleInfoEXT {
  168. VkStructureType sType;
  169. const void* pNext;
  170. VkExternalMemoryHandleTypeFlagBits handleType;
  171. void* handle;
  172. } VkImportMemoryMetalHandleInfoEXT;
  173. typedef struct VkMemoryMetalHandlePropertiesEXT {
  174. VkStructureType sType;
  175. void* pNext;
  176. uint32_t memoryTypeBits;
  177. } VkMemoryMetalHandlePropertiesEXT;
  178. typedef struct VkMemoryGetMetalHandleInfoEXT {
  179. VkStructureType sType;
  180. const void* pNext;
  181. VkDeviceMemory memory;
  182. VkExternalMemoryHandleTypeFlagBits handleType;
  183. } VkMemoryGetMetalHandleInfoEXT;
  184. typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandleEXT)(VkDevice device, const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo, void** pHandle);
  185. typedef VkResult (VKAPI_PTR *PFN_vkGetMemoryMetalHandlePropertiesEXT)(VkDevice device, VkExternalMemoryHandleTypeFlagBits handleType, const void* pHandle, VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
  186. #ifndef VK_NO_PROTOTYPES
  187. #ifndef VK_ONLY_EXPORTED_PROTOTYPES
  188. VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandleEXT(
  189. VkDevice device,
  190. const VkMemoryGetMetalHandleInfoEXT* pGetMetalHandleInfo,
  191. void** pHandle);
  192. #endif
  193. #ifndef VK_ONLY_EXPORTED_PROTOTYPES
  194. VKAPI_ATTR VkResult VKAPI_CALL vkGetMemoryMetalHandlePropertiesEXT(
  195. VkDevice device,
  196. VkExternalMemoryHandleTypeFlagBits handleType,
  197. const void* pHandle,
  198. VkMemoryMetalHandlePropertiesEXT* pMemoryMetalHandleProperties);
  199. #endif
  200. #endif
  201. #ifdef __cplusplus
  202. }
  203. #endif
  204. #endif