vulkan_metal.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. #ifndef VULKAN_METAL_H_
  2. #define VULKAN_METAL_H_ 1
  3. /*
  4. ** Copyright 2015-2023 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. #define VK_EXT_metal_surface 1
  16. #ifdef __OBJC__
  17. @class CAMetalLayer;
  18. #else
  19. typedef void CAMetalLayer;
  20. #endif
  21. #define VK_EXT_METAL_SURFACE_SPEC_VERSION 1
  22. #define VK_EXT_METAL_SURFACE_EXTENSION_NAME "VK_EXT_metal_surface"
  23. typedef VkFlags VkMetalSurfaceCreateFlagsEXT;
  24. typedef struct VkMetalSurfaceCreateInfoEXT {
  25. VkStructureType sType;
  26. const void* pNext;
  27. VkMetalSurfaceCreateFlagsEXT flags;
  28. const CAMetalLayer* pLayer;
  29. } VkMetalSurfaceCreateInfoEXT;
  30. typedef VkResult (VKAPI_PTR *PFN_vkCreateMetalSurfaceEXT)(VkInstance instance, const VkMetalSurfaceCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator, VkSurfaceKHR* pSurface);
  31. #ifndef VK_NO_PROTOTYPES
  32. VKAPI_ATTR VkResult VKAPI_CALL vkCreateMetalSurfaceEXT(
  33. VkInstance instance,
  34. const VkMetalSurfaceCreateInfoEXT* pCreateInfo,
  35. const VkAllocationCallbacks* pAllocator,
  36. VkSurfaceKHR* pSurface);
  37. #endif
  38. #define VK_EXT_metal_objects 1
  39. #ifdef __OBJC__
  40. @protocol MTLDevice;
  41. typedef id<MTLDevice> MTLDevice_id;
  42. #else
  43. typedef void* MTLDevice_id;
  44. #endif
  45. #ifdef __OBJC__
  46. @protocol MTLCommandQueue;
  47. typedef id<MTLCommandQueue> MTLCommandQueue_id;
  48. #else
  49. typedef void* MTLCommandQueue_id;
  50. #endif
  51. #ifdef __OBJC__
  52. @protocol MTLBuffer;
  53. typedef id<MTLBuffer> MTLBuffer_id;
  54. #else
  55. typedef void* MTLBuffer_id;
  56. #endif
  57. #ifdef __OBJC__
  58. @protocol MTLTexture;
  59. typedef id<MTLTexture> MTLTexture_id;
  60. #else
  61. typedef void* MTLTexture_id;
  62. #endif
  63. typedef struct __IOSurface* IOSurfaceRef;
  64. #ifdef __OBJC__
  65. @protocol MTLSharedEvent;
  66. typedef id<MTLSharedEvent> MTLSharedEvent_id;
  67. #else
  68. typedef void* MTLSharedEvent_id;
  69. #endif
  70. #define VK_EXT_METAL_OBJECTS_SPEC_VERSION 1
  71. #define VK_EXT_METAL_OBJECTS_EXTENSION_NAME "VK_EXT_metal_objects"
  72. typedef enum VkExportMetalObjectTypeFlagBitsEXT {
  73. VK_EXPORT_METAL_OBJECT_TYPE_METAL_DEVICE_BIT_EXT = 0x00000001,
  74. VK_EXPORT_METAL_OBJECT_TYPE_METAL_COMMAND_QUEUE_BIT_EXT = 0x00000002,
  75. VK_EXPORT_METAL_OBJECT_TYPE_METAL_BUFFER_BIT_EXT = 0x00000004,
  76. VK_EXPORT_METAL_OBJECT_TYPE_METAL_TEXTURE_BIT_EXT = 0x00000008,
  77. VK_EXPORT_METAL_OBJECT_TYPE_METAL_IOSURFACE_BIT_EXT = 0x00000010,
  78. VK_EXPORT_METAL_OBJECT_TYPE_METAL_SHARED_EVENT_BIT_EXT = 0x00000020,
  79. VK_EXPORT_METAL_OBJECT_TYPE_FLAG_BITS_MAX_ENUM_EXT = 0x7FFFFFFF
  80. } VkExportMetalObjectTypeFlagBitsEXT;
  81. typedef VkFlags VkExportMetalObjectTypeFlagsEXT;
  82. typedef struct VkExportMetalObjectCreateInfoEXT {
  83. VkStructureType sType;
  84. const void* pNext;
  85. VkExportMetalObjectTypeFlagBitsEXT exportObjectType;
  86. } VkExportMetalObjectCreateInfoEXT;
  87. typedef struct VkExportMetalObjectsInfoEXT {
  88. VkStructureType sType;
  89. const void* pNext;
  90. } VkExportMetalObjectsInfoEXT;
  91. typedef struct VkExportMetalDeviceInfoEXT {
  92. VkStructureType sType;
  93. const void* pNext;
  94. MTLDevice_id mtlDevice;
  95. } VkExportMetalDeviceInfoEXT;
  96. typedef struct VkExportMetalCommandQueueInfoEXT {
  97. VkStructureType sType;
  98. const void* pNext;
  99. VkQueue queue;
  100. MTLCommandQueue_id mtlCommandQueue;
  101. } VkExportMetalCommandQueueInfoEXT;
  102. typedef struct VkExportMetalBufferInfoEXT {
  103. VkStructureType sType;
  104. const void* pNext;
  105. VkDeviceMemory memory;
  106. MTLBuffer_id mtlBuffer;
  107. } VkExportMetalBufferInfoEXT;
  108. typedef struct VkImportMetalBufferInfoEXT {
  109. VkStructureType sType;
  110. const void* pNext;
  111. MTLBuffer_id mtlBuffer;
  112. } VkImportMetalBufferInfoEXT;
  113. typedef struct VkExportMetalTextureInfoEXT {
  114. VkStructureType sType;
  115. const void* pNext;
  116. VkImage image;
  117. VkImageView imageView;
  118. VkBufferView bufferView;
  119. VkImageAspectFlagBits plane;
  120. MTLTexture_id mtlTexture;
  121. } VkExportMetalTextureInfoEXT;
  122. typedef struct VkImportMetalTextureInfoEXT {
  123. VkStructureType sType;
  124. const void* pNext;
  125. VkImageAspectFlagBits plane;
  126. MTLTexture_id mtlTexture;
  127. } VkImportMetalTextureInfoEXT;
  128. typedef struct VkExportMetalIOSurfaceInfoEXT {
  129. VkStructureType sType;
  130. const void* pNext;
  131. VkImage image;
  132. IOSurfaceRef ioSurface;
  133. } VkExportMetalIOSurfaceInfoEXT;
  134. typedef struct VkImportMetalIOSurfaceInfoEXT {
  135. VkStructureType sType;
  136. const void* pNext;
  137. IOSurfaceRef ioSurface;
  138. } VkImportMetalIOSurfaceInfoEXT;
  139. typedef struct VkExportMetalSharedEventInfoEXT {
  140. VkStructureType sType;
  141. const void* pNext;
  142. VkSemaphore semaphore;
  143. VkEvent event;
  144. MTLSharedEvent_id mtlSharedEvent;
  145. } VkExportMetalSharedEventInfoEXT;
  146. typedef struct VkImportMetalSharedEventInfoEXT {
  147. VkStructureType sType;
  148. const void* pNext;
  149. MTLSharedEvent_id mtlSharedEvent;
  150. } VkImportMetalSharedEventInfoEXT;
  151. typedef void (VKAPI_PTR *PFN_vkExportMetalObjectsEXT)(VkDevice device, VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
  152. #ifndef VK_NO_PROTOTYPES
  153. VKAPI_ATTR void VKAPI_CALL vkExportMetalObjectsEXT(
  154. VkDevice device,
  155. VkExportMetalObjectsInfoEXT* pMetalObjectsInfo);
  156. #endif
  157. #ifdef __cplusplus
  158. }
  159. #endif
  160. #endif