vulkan_metal.h 5.7 KB

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