peachsim 0.1.1684 → 0.1.1692

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/cli/commands/coverage-swift.ts +72 -5
  2. package/cli/commands/inspect/actions.ts +1 -0
  3. package/cli/commands/screenshot.ts +12 -0
  4. package/dist-lib/agent-daemon-client.cjs +1 -1
  5. package/dist-lib/agent-events.cjs +1 -1
  6. package/dist-lib/attached-projects.cjs +1 -1
  7. package/dist-lib/auth/shared-session.cjs +1 -1
  8. package/dist-lib/backend-origin.cjs +1 -1
  9. package/dist-lib/beta.cjs +1 -1
  10. package/dist-lib/beta.mjs +1 -1
  11. package/dist-lib/bridge-constants.cjs +1 -1
  12. package/dist-lib/bridge-contract-input.cjs +1 -1
  13. package/dist-lib/bridge-contract-input.mjs +1 -1
  14. package/dist-lib/bridge-contract.cjs +1 -1
  15. package/dist-lib/bridge-contract.mjs +1 -1
  16. package/dist-lib/bundle-channel.cjs +2252 -1462
  17. package/dist-lib/capture-contract.cjs +1 -1
  18. package/dist-lib/capture-contract.mjs +1 -1
  19. package/dist-lib/cloud-contract.cjs +1 -1
  20. package/dist-lib/cloud-contract.mjs +1 -1
  21. package/dist-lib/cloud-test-args.cjs +1 -1
  22. package/dist-lib/cloud-test-args.mjs +1 -1
  23. package/dist-lib/cloud.cjs +1 -1
  24. package/dist-lib/cloud.mjs +1 -1
  25. package/dist-lib/config.cjs +1 -1
  26. package/dist-lib/config.mjs +1 -1
  27. package/dist-lib/detox/index.cjs +1 -1
  28. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  29. package/dist-lib/expo-swift-bundle.cjs +1762 -995
  30. package/dist-lib/expo-swift-metadata.cjs +1 -1
  31. package/dist-lib/expo-swift-metadata.mjs +1 -1
  32. package/dist-lib/home-paths.cjs +1 -1
  33. package/dist-lib/host/bridge-host.cjs +2184 -1417
  34. package/dist-lib/host/fetch-proxy-handler.cjs +3 -3
  35. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  36. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  37. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  38. package/dist-lib/host/websocket-proxy.cjs +1 -1
  39. package/dist-lib/index.cjs +175 -69
  40. package/dist-lib/jump-to-source-babel.cjs +1 -1
  41. package/dist-lib/jump-to-source-native.cjs +1 -1
  42. package/dist-lib/kotlin-host.cjs +1 -1
  43. package/dist-lib/menu.cjs +1 -1
  44. package/dist-lib/menu.mjs +1 -1
  45. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  46. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  47. package/dist-lib/metro-production-bundle.cjs +1 -1
  48. package/dist-lib/metro-production-bundle.mjs +1 -1
  49. package/dist-lib/metro.cjs +174 -68
  50. package/dist-lib/native-app-identity-project.cjs +163 -51
  51. package/dist-lib/native-app-identity-project.mjs +206 -82
  52. package/dist-lib/native-app-identity.cjs +1 -1
  53. package/dist-lib/native-app-identity.mjs +1 -1
  54. package/dist-lib/native-firebase-metadata.cjs +1 -1
  55. package/dist-lib/native-firebase-metadata.mjs +1 -1
  56. package/dist-lib/plist.cjs +1 -1
  57. package/dist-lib/plist.mjs +1 -1
  58. package/dist-lib/profiles.cjs +1 -1
  59. package/dist-lib/public-brand.cjs +1 -1
  60. package/dist-lib/public-origins-lib-esm.json +26 -23
  61. package/dist-lib/public-origins-lib.json +74 -61
  62. package/dist-lib/react-native-host-modules.cjs +1 -1
  63. package/dist-lib/react-native-host-modules.mjs +1 -1
  64. package/dist-lib/reap-browser.cjs +1 -1
  65. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  66. package/dist-lib/sdk.cjs +2 -2
  67. package/dist-lib/sdk.mjs +2 -2
  68. package/dist-lib/skills.cjs +2633 -1840
  69. package/dist-lib/swift-compile.cjs +2478 -100
  70. package/dist-lib/swift-compile.mjs +2475 -100
  71. package/dist-lib/swift-package.cjs +108 -50
  72. package/dist-lib/swift-package.mjs +104 -50
  73. package/dist-lib/swift-submit.cjs +1 -1
  74. package/dist-lib/swift-submit.mjs +1 -1
  75. package/dist-lib/swift-toolchain.cjs +1 -1
  76. package/dist-lib/swift.cjs +1 -1
  77. package/dist-lib/vite-swift.cjs +3979 -985
  78. package/dist-lib/vite.cjs +12 -18
  79. package/dist-lib/worklet-executable.cjs +7 -4
  80. package/dist-lib/worklet-executable.mjs +7 -4
  81. package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +15 -1
  82. package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +6 -0
  83. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  84. package/dist-types/packages/peach-globals/src/nodeContract.d.ts +3 -2
  85. package/dist-types/packages/peach-kit/src/capabilities.d.ts +1 -0
  86. package/package.json +1 -1
  87. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +9 -0
  88. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLAvailability.h +22 -0
  89. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBackgroundActivitySession.h +145 -0
  90. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityCondition.h +113 -0
  91. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconIdentityConstraint.h +34 -0
  92. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBeaconRegion.h +225 -0
  93. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLBody.h +26 -0
  94. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularGeographicCondition.h +59 -0
  95. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCircularRegion.h +64 -0
  96. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLCondition.h +48 -0
  97. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLError.h +52 -0
  98. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLErrorDomain.h +24 -0
  99. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLGeocoder.h +55 -0
  100. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLHeading.h +117 -0
  101. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocation.h +9 -0
  102. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager+CLVisitExtensions.h +45 -0
  103. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManager.h +877 -0
  104. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationManagerDelegate.h +225 -0
  105. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceError.h +33 -0
  106. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationPushServiceExtension.h +28 -0
  107. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLLocationUpdater.h +250 -0
  108. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitor.h +140 -0
  109. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitorConfiguration.h +77 -0
  110. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringEvent.h +184 -0
  111. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLMonitoringRecord.h +57 -0
  112. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLPlacemark.h +98 -0
  113. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLRegion.h +123 -0
  114. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLServiceSession.h +211 -0
  115. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CLVisit.h +66 -0
  116. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Headers/CoreLocation.h +46 -0
  117. package/sdk/ios/System/Library/Frameworks/CoreLocation.framework/Modules/module.modulemap +7 -0
  118. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +96 -2
  119. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceBase.h +52 -0
  120. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceObjC.h +240 -0
  121. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceRef.h +474 -0
  122. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Headers/IOSurfaceTypes.h +66 -0
  123. package/sdk/ios/System/Library/Frameworks/IOSurface.framework/Modules/module.modulemap +10 -0
  124. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4AccelerationStructure.h +9 -0
  125. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Archive.h +16 -0
  126. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ArgumentTable.h +17 -0
  127. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunction.h +13 -0
  128. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BinaryFunctionDescriptor.h +14 -0
  129. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4BufferRange.h +79 -0
  130. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandAllocator.h +15 -0
  131. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandBuffer.h +17 -0
  132. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandEncoder.h +16 -0
  133. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommandQueue.h +19 -0
  134. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CommitFeedback.h +15 -0
  135. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Compiler.h +13 -0
  136. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4CompilerTask.h +13 -0
  137. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputeCommandEncoder.h +19 -0
  138. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4ComputePipeline.h +13 -0
  139. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4Counters.h +19 -0
  140. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4FunctionDescriptor.h +13 -0
  141. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryDescriptor.h +13 -0
  142. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LibraryFunctionDescriptor.h +13 -0
  143. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4LinkingDescriptor.h +13 -0
  144. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningCommandEncoder.h +17 -0
  145. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MachineLearningPipeline.h +13 -0
  146. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4MeshRenderPipeline.h +13 -0
  147. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineDataSetSerializer.h +13 -0
  148. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4PipelineState.h +13 -0
  149. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderCommandEncoder.h +17 -0
  150. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPass.h +17 -0
  151. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4RenderPipeline.h +13 -0
  152. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4SpecializedFunctionDescriptor.h +13 -0
  153. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4StitchedFunctionDescriptor.h +13 -0
  154. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTL4TileRenderPipeline.h +13 -0
  155. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h +1212 -0
  156. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureCommandEncoder.h +322 -0
  157. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureTypes.h +224 -0
  158. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAllocation.h +22 -0
  159. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgument.h +279 -0
  160. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLArgumentEncoder.h +199 -0
  161. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBinaryArchive.h +142 -0
  162. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitCommandEncoder.h +266 -0
  163. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBlitPass.h +82 -0
  164. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLBuffer.h +94 -0
  165. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureManager.h +113 -0
  166. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCaptureScope.h +43 -0
  167. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandBuffer.h +449 -0
  168. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandEncoder.h +148 -0
  169. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCommandQueue.h +102 -0
  170. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputeCommandEncoder.h +350 -0
  171. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePass.h +90 -0
  172. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLComputePipeline.h +274 -0
  173. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLCounters.h +225 -0
  174. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDataType.h +232 -0
  175. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDefines.h +39 -0
  176. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDepthStencil.h +93 -0
  177. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDevice.h +1122 -0
  178. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDeviceCertification.h +29 -0
  179. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDrawable.h +36 -0
  180. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLDynamicLibrary.h +81 -0
  181. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLEvent.h +79 -0
  182. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFence.h +22 -0
  183. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionConstantValues.h +30 -0
  184. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionDescriptor.h +95 -0
  185. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionHandle.h +29 -0
  186. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionLog.h +37 -0
  187. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLFunctionStitching.h +131 -0
  188. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLGPUAddress.h +19 -0
  189. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLHeap.h +284 -0
  190. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandBuffer.h +10 -0
  191. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCommandQueue.h +11 -0
  192. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIOCompressor.h +10 -0
  193. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandBuffer.h +157 -0
  194. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIndirectCommandEncoder.h +110 -0
  195. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLIntersectionFunctionTable.h +186 -0
  196. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLibrary.h +549 -0
  197. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLinkedFunctions.h +57 -0
  198. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLLogState.h +65 -0
  199. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLParallelRenderCommandEncoder.h +77 -0
  200. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPipeline.h +57 -0
  201. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLPixelFormat.h +342 -0
  202. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRasterizationRate.h +323 -0
  203. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderCommandEncoder.h +1068 -0
  204. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPass.h +411 -0
  205. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLRenderPipeline.h +788 -0
  206. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResidencySet.h +141 -0
  207. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResource.h +307 -0
  208. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStateCommandEncoder.h +125 -0
  209. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceStatePass.h +85 -0
  210. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLResourceViewPool.h +22 -0
  211. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLSampler.h +252 -0
  212. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLStageInputOutputDescriptor.h +158 -0
  213. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTensor.h +17 -0
  214. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTexture.h +460 -0
  215. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTextureViewPool.h +18 -0
  216. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLTypes.h +125 -0
  217. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVertexDescriptor.h +153 -0
  218. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLVisibleFunctionTable.h +45 -0
  219. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/Metal.h +94 -0
  220. package/sdk/ios/System/Library/Frameworks/Metal.framework/Modules/module.modulemap +6 -0
  221. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTDefines.h +35 -0
  222. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTTagClass.h +33 -0
  223. package/sdk/ios/System/Library/Frameworks/UniformTypeIdentifiers.framework/Headers/UTType.h +504 -0
  224. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLEssentialsAvailability.h +14 -0
  225. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/CLLocationEssentials.h +444 -0
  226. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Headers/LocationEssentials.h +14 -0
  227. package/sdk/ios/System/Library/Frameworks/_LocationEssentials.framework/Modules/module.modulemap +14 -0
  228. package/sdk/ios/usr/include/complex.h +167 -0
  229. package/sdk/ios/usr/include/dispatch/dispatch.h +5 -0
  230. package/sdk/ios/usr/include/mach/mach_types.h +1 -0
  231. package/sdk/ios/usr/include/math.h +835 -2
  232. package/sdk/ios/usr/include/sys/cdefs.h +0 -1
  233. package/src/generated/swift-c-predefines.json +1988 -0
  234. package/src/nitro-bundle.ts +1 -0
  235. package/src/nitro-compile.ts +4 -0
  236. package/src/nitroContract.ts +18 -2
  237. package/src/swift-compile.ts +446 -49
  238. package/src/swift-coverage/package.ts +3 -1
  239. package/src/swift-coverage/xcode-assets.ts +62 -2
  240. package/src/swift-coverage/xcode-packages.ts +11 -6
  241. package/src/swift-host.ts +333 -57
  242. package/src/swift-objc-compile.ts +20 -5
  243. package/src/swift-objc-standin.ts +21 -11
  244. package/src/swift-package-manifest.ts +151 -28
  245. package/src/swift-package.ts +134 -58
  246. package/src/swift-packages.ts +141 -44
  247. package/src/swift-source-file.ts +10 -15
  248. package/src/swift-standins.ts +87 -13
  249. package/src/swift-submit.ts +5 -0
  250. package/src/swiftContract.ts +160 -75
  251. package/src/target-matcher.ts +15 -2
  252. package/src/worklet-executable.ts +7 -3
  253. package/src/xcode-json-project.ts +14 -2
  254. package/src/xcode-project.ts +154 -59
@@ -0,0 +1,266 @@
1
+ //
2
+ // MTLBlitCommandEncoder.h
3
+ // Metal
4
+ //
5
+ // Copyright (c) 2014 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Metal/MTLDefines.h>
10
+ #import <Metal/MTLTypes.h>
11
+ #import <Metal/MTLCommandEncoder.h>
12
+ #import <Metal/MTLResourceStateCommandEncoder.h>
13
+ #import <Metal/MTLBuffer.h>
14
+ #import <Metal/MTLTexture.h>
15
+ #import <Metal/MTLFence.h>
16
+ #import <Metal/MTLRenderPass.h>
17
+ #import <Metal/MTLBlitPass.h>
18
+ #import <Metal/MTLCounters.h>
19
+
20
+ NS_ASSUME_NONNULL_BEGIN
21
+
22
+ /*!
23
+ @enum MTLBlitOption
24
+ @abstract Controls the blit operation
25
+ */
26
+ typedef NS_OPTIONS(NSUInteger, MTLBlitOption)
27
+ {
28
+ MTLBlitOptionNone = 0,
29
+ MTLBlitOptionDepthFromDepthStencil = 1 << 0,
30
+ MTLBlitOptionStencilFromDepthStencil = 1 << 1,
31
+ MTLBlitOptionRowLinearPVRTC API_AVAILABLE(ios(9.0), macos(11.0), macCatalyst(14.0)) = 1 << 2,
32
+ } API_AVAILABLE(macos(10.11), ios(9.0));
33
+
34
+
35
+ /*!
36
+ @protocol MTLBlitCommandEncoder
37
+ @abstract A command encoder that performs basic copies and blits between buffers and textures.
38
+ */
39
+ API_AVAILABLE(macos(10.11), ios(8.0))
40
+ @protocol MTLBlitCommandEncoder <MTLCommandEncoder>
41
+
42
+ /*!
43
+ @method synchronizeResource:
44
+ @abstract Flush any copy of this resource from the device's caches, and invalidate any CPU caches if needed.
45
+ @param resource The resource to page off.
46
+ @discussion When the device writes to a resource with a storage mode of MTLResourceStorageModeManaged, those writes may be cached (for example, in VRAM or on chip renderer cache),
47
+ making any CPU access (either MTLBuffer.contents or -[MTLTexture getBytes:...] and -[MTLTexture replaceRegion:]) produce undefined results. To allow the CPU to see what the device
48
+ has written, a CommandBuffer containing this synchronization must be executed. After completion of the CommandBuffer, the CPU can access the contents of the resource safely.
49
+ */
50
+ - (void)synchronizeResource:(id<MTLResource>)resource API_DEPRECATED("Managed storage has no effect on Apple Silicon, use Shared storage instead", macos(10.11, 27.0), macCatalyst(13.0, 27.0)) API_UNAVAILABLE(ios);
51
+
52
+ /*!
53
+ @method synchronizeTexture:slice:mipmapLevel:
54
+ @abstract Flush any copy of this image from the device's caches, and invalidate CPU caches if needed.
55
+ @param texture The texture to page off.
56
+ @param slice The slice of the texture to page off.
57
+ @param level The mipmap level of the texture to flush.
58
+ @discussion
59
+ See the discussion of -synchronizeResource. -synchronizeTexture:slice:mipmapLevel performs the same role, except it may flush only a subset of the texture storage, rather than the entire texture.
60
+ */
61
+ - (void)synchronizeTexture:(id<MTLTexture>)texture slice:(NSUInteger)slice level:(NSUInteger)level API_DEPRECATED("Managed storage has no effect on Apple Silicon, use Shared storage instead", macos(10.11, 27.0), macCatalyst(13.0, 27.0)) API_UNAVAILABLE(ios);
62
+
63
+ /*!
64
+ @method copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:
65
+ @abstract Copy a rectangle of pixels between textures.
66
+ */
67
+ - (void)copyFromTexture:(id<MTLTexture>)sourceTexture sourceSlice:(NSUInteger)sourceSlice sourceLevel:(NSUInteger)sourceLevel sourceOrigin:(MTLOrigin)sourceOrigin sourceSize:(MTLSize)sourceSize toTexture:(id<MTLTexture>)destinationTexture destinationSlice:(NSUInteger)destinationSlice destinationLevel:(NSUInteger)destinationLevel destinationOrigin:(MTLOrigin)destinationOrigin;
68
+
69
+ /*!
70
+ @method copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:
71
+ @abstract Copy an image from a buffer into a texture.
72
+ */
73
+ - (void)copyFromBuffer:(id<MTLBuffer>)sourceBuffer sourceOffset:(NSUInteger)sourceOffset sourceBytesPerRow:(NSUInteger)sourceBytesPerRow sourceBytesPerImage:(NSUInteger)sourceBytesPerImage sourceSize:(MTLSize)sourceSize toTexture:(id<MTLTexture>)destinationTexture destinationSlice:(NSUInteger)destinationSlice destinationLevel:(NSUInteger)destinationLevel destinationOrigin:(MTLOrigin)destinationOrigin;
74
+
75
+ /*!
76
+ @method copyFromBuffer:sourceOffset:sourceBytesPerRow:sourceBytesPerImage:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:options:
77
+ @abstract Copy an image from a buffer into a texture.
78
+ */
79
+ - (void)copyFromBuffer:(id<MTLBuffer>)sourceBuffer sourceOffset:(NSUInteger)sourceOffset sourceBytesPerRow:(NSUInteger)sourceBytesPerRow sourceBytesPerImage:(NSUInteger)sourceBytesPerImage sourceSize:(MTLSize)sourceSize toTexture:(id<MTLTexture>)destinationTexture destinationSlice:(NSUInteger)destinationSlice destinationLevel:(NSUInteger)destinationLevel destinationOrigin:(MTLOrigin)destinationOrigin options:(MTLBlitOption)options API_AVAILABLE(macos(10.11), ios(9.0));
80
+
81
+ /*!
82
+ @method copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:
83
+ @abstract Copy an image from a texture into a buffer.
84
+ */
85
+ - (void)copyFromTexture:(id<MTLTexture>)sourceTexture sourceSlice:(NSUInteger)sourceSlice sourceLevel:(NSUInteger)sourceLevel sourceOrigin:(MTLOrigin)sourceOrigin sourceSize:(MTLSize)sourceSize toBuffer:(id<MTLBuffer>)destinationBuffer destinationOffset:(NSUInteger)destinationOffset destinationBytesPerRow:(NSUInteger)destinationBytesPerRow destinationBytesPerImage:(NSUInteger)destinationBytesPerImage;
86
+
87
+ /*!
88
+ @method copyFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:sourceOptions:toBuffer:destinationOffset:destinationBytesPerRow:destinationBytesPerImage:options:
89
+ @abstract Copy an image from a texture into a buffer.
90
+ */
91
+ - (void)copyFromTexture:(id<MTLTexture>)sourceTexture sourceSlice:(NSUInteger)sourceSlice sourceLevel:(NSUInteger)sourceLevel sourceOrigin:(MTLOrigin)sourceOrigin sourceSize:(MTLSize)sourceSize toBuffer:(id<MTLBuffer>)destinationBuffer destinationOffset:(NSUInteger)destinationOffset destinationBytesPerRow:(NSUInteger)destinationBytesPerRow destinationBytesPerImage:(NSUInteger)destinationBytesPerImage options:(MTLBlitOption)options API_AVAILABLE(macos(10.11), ios(9.0));
92
+
93
+ /*!
94
+ @method generateMipmapsForTexture:
95
+ @abstract Generate mipmaps for a texture from the base level up to the max level.
96
+ */
97
+ - (void)generateMipmapsForTexture:(id<MTLTexture>)texture;
98
+
99
+ /*!
100
+ @method fillBuffer:range:value:
101
+ @abstract Fill a buffer with a fixed value in each byte.
102
+ */
103
+ - (void)fillBuffer:(id<MTLBuffer>)buffer range:(NSRange)range value:(uint8_t)value;
104
+
105
+ /*!
106
+ @method copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount:
107
+ @abstract Copy whole surfaces between textures.
108
+ @discussion Convenience function to copy sliceCount * levelCount whole surfaces between textures
109
+ The source and destination pixel format must be identical.
110
+ The source and destination sample count must be identical.
111
+ The sourceLevel mip in sourceTexture must have the same dimension as the destinationLevel mip in destinationTexture.
112
+ The sourceTexture must have at least sourceLevel + levelCount mips
113
+ The destinationTexture must have at least destinationLevel + levelCount mips
114
+ The sourceTexture must have at least sourceSlice + sliceCount array slices
115
+ The destinationTexture must have at least destinationSlice + sliceCount array slices
116
+ */
117
+ - (void)copyFromTexture:(id<MTLTexture>)sourceTexture sourceSlice:(NSUInteger)sourceSlice sourceLevel:(NSUInteger)sourceLevel
118
+ toTexture:(id<MTLTexture>)destinationTexture destinationSlice:(NSUInteger)destinationSlice destinationLevel:(NSUInteger)destinationLevel
119
+ sliceCount:(NSUInteger)sliceCount levelCount:(NSUInteger)levelCount API_AVAILABLE(macos(10.15), ios(13.0));
120
+
121
+ /*!
122
+ @method copyFromTexture:toTexture:
123
+ @abstract Copy as many whole surfaces as possible between textures.
124
+ @discussion Convenience function that calls copyFromTexture:sourceSlice:sourceLevel:toTexture:destinationSlice:destinationLevel:sliceCount:levelCount:
125
+ The source and destination pixel format must be identical.
126
+ The source and destination sample count must be identical.
127
+ Either:
128
+ - sourceTexture must have a mip M with identical dimensions as the first mip of destinationTexture: sourceLevel = M, destinationLevel = 0
129
+ - destinationTexture must have a mip M with identical dimensions as the first mip of sourceTexture: sourceLevel = 0, destinationLevel = M
130
+ Computes: levelCount = min(sourceTexture.mipmapLevelCount - sourceLevel, destinationTexture.mipmapLevelCount - destinationLevel)
131
+ sliceCount = min(sourceTexture.arrayLength, destinationTexture.arrayLength)
132
+ Then invokes the method above using the computed parameters.
133
+ */
134
+ - (void)copyFromTexture:(id<MTLTexture>)sourceTexture toTexture:(id<MTLTexture>)destinationTexture API_AVAILABLE(macos(10.15), ios(13.0));
135
+
136
+ /*!
137
+ @method copyFromBuffer:sourceOffset:toBuffer:destinationOffset:size:
138
+ @abstract Basic memory copy between buffers.
139
+ */
140
+ - (void)copyFromBuffer:(id <MTLBuffer>)sourceBuffer sourceOffset:(NSUInteger)sourceOffset toBuffer:(id <MTLBuffer>)destinationBuffer destinationOffset:(NSUInteger)destinationOffset size:(NSUInteger)size;
141
+
142
+ /*!
143
+ @method updateFence:
144
+ @abstract Update the fence to capture all GPU work so far enqueued by this encoder.
145
+ @discussion The fence is updated at kernel submission to maintain global order and prevent deadlock.
146
+ Drivers may delay fence updates until the end of the encoder. Drivers may also wait on fences at the beginning of an encoder. It is therefore illegal to wait on a fence after it has been updated in the same encoder.
147
+ */
148
+ - (void)updateFence:(id <MTLFence>)fence API_AVAILABLE(macos(10.13), ios(10.0));
149
+
150
+ /*!
151
+ @method waitForFence:
152
+ @abstract Prevent further GPU work until the fence is reached.
153
+ @discussion The fence is evaluated at kernel submission to maintain global order and prevent deadlock.
154
+ Drivers may delay fence updates until the end of the encoder. Drivers may also wait on fences at the beginning of an encoder. It is therefore illegal to wait on a fence after it has been updated in the same encoder.
155
+ */
156
+ - (void)waitForFence:(id <MTLFence>)fence API_AVAILABLE(macos(10.13), ios(10.0));
157
+
158
+
159
+ /*!
160
+ @method getTextureAccessCounters:region:mipLevel:slice:type:resetCounters:countersBuffer:countersBufferOffset
161
+ @abstract Copies tile access counters within specified region into provided buffer
162
+ */
163
+ -(void) getTextureAccessCounters:(id<MTLTexture>)texture
164
+ region:(MTLRegion)region
165
+ mipLevel:(NSUInteger)mipLevel
166
+ slice:(NSUInteger)slice
167
+ resetCounters:(BOOL)resetCounters
168
+ countersBuffer:(id<MTLBuffer>)countersBuffer
169
+ countersBufferOffset:(NSUInteger)countersBufferOffset API_DEPRECATED("Access counters are no longer supported in Metal", macos(11.0, 26.4), macCatalyst(14.0, 26.4), ios(13.0, 26.4), tvos(16.0, 26.4));
170
+
171
+ /*!
172
+ @method resetTextureAccessCounters:region:mipLevel:slice:type:
173
+ @abstract Resets tile access counters within specified region
174
+ */
175
+ -(void) resetTextureAccessCounters:(id<MTLTexture>)texture
176
+ region:(MTLRegion)region
177
+ mipLevel:(NSUInteger)mipLevel
178
+ slice:(NSUInteger)slice API_DEPRECATED("Access counters are no longer supported in Metal", macos(11.0, 26.4), macCatalyst(14.0, 26.4), ios(13.0, 26.4), tvos(16.0, 26.4));
179
+
180
+
181
+
182
+ /*!
183
+ @method optimizeContentsForGPUAccess:
184
+ @abstract Optimizes the texture data to ensure the best possible performance when accessing content on the GPU at the expense of CPU-access performance.
185
+ */
186
+ - (void)optimizeContentsForGPUAccess:(id<MTLTexture>)texture API_AVAILABLE(macos(10.14), ios(12.0));
187
+
188
+ /*!
189
+ @method optimizeContentsForGPUAccess:slice:level:
190
+ @abstract Optimizes a subset of the texture data to ensure the best possible performance when accessing content on the GPU at the expense of CPU-access performance.
191
+ */
192
+ - (void)optimizeContentsForGPUAccess:(id<MTLTexture>)texture slice:(NSUInteger)slice level:(NSUInteger)level API_AVAILABLE(macos(10.14), ios(12.0));
193
+
194
+ /*!
195
+ @method optimizeContentsForCPUAccess:
196
+ @abstract Optimizes the texture data to ensure the best possible performance when accessing content on the CPU at the expense of GPU-access performance.
197
+ */
198
+ - (void)optimizeContentsForCPUAccess:(id<MTLTexture>)texture API_AVAILABLE(macos(10.14), ios(12.0));
199
+
200
+ /*!
201
+ @method optimizeContentsForCPUAccess:slice:level:
202
+ @abstract Optimizes a subset of the texture data to ensure the best possible performance when accessing content on the CPU at the expense of GPU-access performance.
203
+ */
204
+ - (void)optimizeContentsForCPUAccess:(id<MTLTexture>)texture slice:(NSUInteger)slice level:(NSUInteger)level API_AVAILABLE(macos(10.14), ios(12.0));
205
+
206
+
207
+ /*!
208
+ @method resetCommandsInBuffer:withRange:
209
+ @abstract reset commands in a indirect command buffer using the GPU
210
+ */
211
+ - (void) resetCommandsInBuffer:(id<MTLIndirectCommandBuffer>)buffer withRange:(NSRange)range API_AVAILABLE(macos(10.14), ios(12.0));
212
+
213
+ /*!
214
+ @method copyIndirectCommandBuffer:source:sourceRange:destination:destinationIndex
215
+ @abstract copy a region of a buffer into a destination buffer starting at destinationIndex using the GPU
216
+ */
217
+ - (void)copyIndirectCommandBuffer:(id <MTLIndirectCommandBuffer>)source sourceRange:(NSRange)sourceRange
218
+ destination:(id <MTLIndirectCommandBuffer>)destination destinationIndex:(NSUInteger)destinationIndex API_AVAILABLE(macos(10.14), ios(12.0));
219
+
220
+ /*!
221
+ @method optimizeIndirectCommandBuffer:withRange:
222
+ @abstract Encodes a command that can improve the performance of a range of commands within an indirect command buffer.
223
+ */
224
+ - (void)optimizeIndirectCommandBuffer:(id <MTLIndirectCommandBuffer>)indirectCommandBuffer withRange:(NSRange)range API_AVAILABLE(macos(10.14), ios(12.0));
225
+
226
+
227
+ /*!
228
+ @method sampleCountersInBuffer:atSampleIndex:withBarrier:
229
+ @abstract Sample hardware counters at this point in the blit encoder and
230
+ store the counter sample into the sample buffer at the specified index.
231
+ @param sampleBuffer The sample buffer to sample into
232
+ @param sampleIndex The index into the counter buffer to write the sample.
233
+ @param barrier Insert a barrier before taking the sample. Passing
234
+ YES will ensure that all work encoded before this operation in the encoder is
235
+ complete but does not isolate the work with respect to other encoders. Passing
236
+ NO will allow the sample to be taken concurrently with other operations in this
237
+ encoder.
238
+ In general, passing YES will lead to more repeatable counter results but
239
+ may negatively impact performance. Passing NO will generally be higher performance
240
+ but counter results may not be repeatable.
241
+ @discussion On devices where MTLCounterSamplingPointAtBlitBoundary is unsupported,
242
+ this method is not available and will generate an error if called.
243
+ */
244
+ -(void)sampleCountersInBuffer:(id<MTLCounterSampleBuffer>)sampleBuffer
245
+ atSampleIndex:(NSUInteger)sampleIndex
246
+ withBarrier:(BOOL)barrier API_AVAILABLE(macos(10.15), ios(14.0));
247
+
248
+ /*!
249
+ @method resolveCounters:inRange:destinationBuffer:destinationOffset:
250
+ @param sampleBuffer The sample buffer to resolve.
251
+ @param range The range of indices to resolve.
252
+ @param destinationBuffer The buffer to resolve values into.
253
+ @param destinationOffset The offset to begin writing values out to. This must be a multiple of
254
+ the minimum constant buffer alignment.
255
+ @abstract Resolve the counters from the raw buffer to a processed buffer.
256
+ @discussion Samples that encountered an error during resolve will be set to
257
+ MTLCounterErrorValue.
258
+ */
259
+ -(void)resolveCounters:(id<MTLCounterSampleBuffer>)sampleBuffer
260
+ inRange:(NSRange)range
261
+ destinationBuffer:(id<MTLBuffer>)destinationBuffer
262
+ destinationOffset:(NSUInteger)destinationOffset API_AVAILABLE(macos(10.15), ios(14.0));
263
+
264
+
265
+ @end
266
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,82 @@
1
+ //
2
+ // MTLBlitPass.h
3
+ // Metal
4
+ //
5
+ // Copyright © 2020 Apple, Inc. All rights reserved.
6
+ //
7
+ #import <Foundation/Foundation.h>
8
+ #import <Metal/MTLDefines.h>
9
+
10
+
11
+ #import <Metal/MTLTypes.h>
12
+
13
+ #import <Metal/MTLCounters.h>
14
+
15
+ NS_ASSUME_NONNULL_BEGIN
16
+ @protocol MTLDevice;
17
+
18
+ MTL_EXPORT API_AVAILABLE(macos(11.0), ios(14.0))
19
+ @interface MTLBlitPassSampleBufferAttachmentDescriptor : NSObject<NSCopying>
20
+ /*!
21
+ @property sampleBuffer
22
+ @abstract The sample buffer to store samples for the blit-pass defined samples.
23
+ If sampleBuffer is non-nil, the sample indices will be used to store samples into
24
+ the sample buffer. If no sample buffer is provided, no samples will be taken.
25
+ If any of the sample indices are specified as MTLCounterDontSample, no sample
26
+ will be taken for that action.
27
+ */
28
+ @property (nullable, nonatomic, retain) id<MTLCounterSampleBuffer> sampleBuffer;
29
+
30
+ /*!
31
+ @property startOfEncoderSampleIndex
32
+ @abstract The sample index to use to store the sample taken at the start of
33
+ command encoder processing. Setting the value to MTLCounterDontSample will cause
34
+ this sample to be omitted.
35
+ @discussion On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
36
+ this sample index is invalid and must be set to MTLCounterDontSample or creation of a blit pass will fail.
37
+ */
38
+ @property (nonatomic) NSUInteger startOfEncoderSampleIndex;
39
+ /*!
40
+ @property endOfEncoderSampleIndex
41
+ @abstract The sample index to use to store the sample taken at the end of
42
+ Command encoder processing. Setting the value to MTLCounterDontSample will cause
43
+ this sample to be omitted.
44
+ @discussion On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
45
+ this sample index is invalid and must be set to MTLCounterDontSample or creation of a blit pass will fail.
46
+ */
47
+ @property (nonatomic) NSUInteger endOfEncoderSampleIndex;
48
+ @end
49
+
50
+ MTL_EXPORT API_AVAILABLE(macos(11.0), ios(14.0))
51
+ @interface MTLBlitPassSampleBufferAttachmentDescriptorArray : NSObject
52
+ /* Individual attachment state access */
53
+ - (MTLBlitPassSampleBufferAttachmentDescriptor *)objectAtIndexedSubscript:(NSUInteger)attachmentIndex;
54
+
55
+ /* This always uses 'copy' semantics. It is safe to set the attachment state at any legal index to nil, which resets that attachment descriptor state to default values. */
56
+ - (void)setObject:(nullable MTLBlitPassSampleBufferAttachmentDescriptor *)attachment atIndexedSubscript:(NSUInteger)attachmentIndex;
57
+
58
+ @end
59
+
60
+ /*!
61
+ @class MTLBlitPassDescriptor
62
+ @abstract MTLBlitPassDescriptor represents a collection of attachments to be used to create a concrete blit command encoder
63
+ */
64
+ MTL_EXPORT API_AVAILABLE(macos(11.0), ios(14.0))
65
+ @interface MTLBlitPassDescriptor : NSObject <NSCopying>
66
+
67
+ /*!
68
+ @method blitPassDescriptor
69
+ @abstract Create an autoreleased default frame buffer descriptor
70
+ */
71
+ + (MTLBlitPassDescriptor *)blitPassDescriptor;
72
+
73
+
74
+ /*!
75
+ @property sampleBufferAttachments
76
+ @abstract An array of sample buffers and associated sample indices.
77
+ */
78
+ @property (readonly) MTLBlitPassSampleBufferAttachmentDescriptorArray * sampleBufferAttachments;
79
+
80
+ @end
81
+
82
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,94 @@
1
+ //
2
+ // MTLBuffer.h
3
+ // Metal
4
+ //
5
+ // Copyright (c) 2014 Apple Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Metal/MTLDefines.h>
10
+ #import <Metal/MTLPixelFormat.h>
11
+ #import <Metal/MTLResource.h>
12
+ #import <Metal/MTLTensor.h>
13
+ #import <Metal/MTLGPUAddress.h>
14
+
15
+ NS_ASSUME_NONNULL_BEGIN
16
+
17
+ @class MTLTextureDescriptor;
18
+ @protocol MTLTexture;
19
+ @protocol MTLResource;
20
+
21
+ /*!
22
+ @protocol MTLBuffer
23
+ @abstract A typeless allocation accessible by both the CPU and the GPU (MTLDevice) or by only the GPU when the storage mode is
24
+ MTLResourceStorageModePrivate.
25
+
26
+ @discussion
27
+ Unlike in OpenGL and OpenCL, access to buffers is not synchronized. The caller may use the CPU to modify the data at any time
28
+ but is also responsible for ensuring synchronization and coherency.
29
+
30
+ The contents become undefined if both the CPU and GPU write to the same buffer without a synchronizing action between those writes.
31
+ This is true even when the regions written do not overlap.
32
+ */
33
+ API_AVAILABLE(macos(10.11), ios(8.0))
34
+ @protocol MTLBuffer <MTLResource>
35
+
36
+ /*!
37
+ @property length
38
+ @abstract The length of the buffer in bytes.
39
+ */
40
+ @property (readonly) NSUInteger length;
41
+
42
+ /*!
43
+ @method contents
44
+ @abstract Returns the data pointer of this buffer's shared copy.
45
+ */
46
+ - (void*)contents NS_RETURNS_INNER_POINTER;
47
+
48
+ /*!
49
+ @method didModifyRange:
50
+ @abstract Inform the device of the range of a buffer that the CPU has modified, allowing the implementation to invalidate
51
+ its caches of the buffer's content.
52
+ @discussion When the application writes to a buffer's sysmem copy via @a contents, that range of the buffer immediately
53
+ becomes undefined for any accesses by the GPU (MTLDevice). To restore coherency, the buffer modification must be followed
54
+ by -didModifyRange:, and then followed by a commit of the MTLCommandBuffer that will access the buffer.
55
+ -didModifyRange does not make the contents coherent for any previously committed command buffers.
56
+ Note: This method is only required if buffer is created with a storage mode of MTLResourceStorageModeManaged.
57
+ It is not valid to invoke this method on buffers of other storage modes.
58
+ @param range The range of bytes that have been modified.
59
+ */
60
+ - (void)didModifyRange:(NSRange)range API_DEPRECATED("Managed storage has no effect on Apple Silicon, use Shared storage instead", macos(10.11, 27.0), macCatalyst(13.0, 27.0)) API_UNAVAILABLE(ios);
61
+
62
+ /*!
63
+ @method newTextureWithDescriptor:offset:bytesPerRow:
64
+ @abstract Create a 2D texture or texture buffer that shares storage with this buffer.
65
+ */
66
+ - (nullable id <MTLTexture>)newTextureWithDescriptor:(MTLTextureDescriptor*)descriptor offset:(NSUInteger)offset bytesPerRow:(NSUInteger)bytesPerRow API_AVAILABLE(macos(10.13), ios(8.0));
67
+
68
+
69
+ /*!
70
+ @method addDebugMarker:range:
71
+ @abstract Adds a marker to a specific range in the buffer.
72
+ When inspecting a buffer in the GPU debugging tools the marker will be shown.
73
+ @param marker A label used for the marker.
74
+ @param range The range of bytes the marker is using.
75
+ */
76
+ - (void)addDebugMarker:(NSString*)marker range:(NSRange)range API_AVAILABLE(macos(10.12), ios(10.0));
77
+
78
+ /*!
79
+ @method removeAllDebugMarkers
80
+ @abstract Removes all debug markers from a buffer.
81
+ */
82
+ - (void)removeAllDebugMarkers API_AVAILABLE(macos(10.12), ios(10.0));
83
+
84
+
85
+
86
+ /*!
87
+ @property gpuAddress
88
+ @abstract Represents the GPU virtual address of a buffer resource
89
+ */
90
+ @property (readonly) MTLGPUAddress gpuAddress API_AVAILABLE(macos(13.0), ios(16.0));
91
+
92
+
93
+ @end
94
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,113 @@
1
+ //
2
+ // MTLCaptureManager.h
3
+ // Metal
4
+ //
5
+ // Copyright © 2017 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Metal/MTLDefines.h>
10
+
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @protocol MTLCaptureScope;
15
+ @protocol MTLCommandQueue;
16
+ @protocol MTLDevice;
17
+
18
+ API_AVAILABLE(macos(10.15), ios(13.0))
19
+ MTL_EXTERN NSErrorDomain const MTLCaptureErrorDomain;
20
+
21
+ typedef NS_ENUM(NSInteger, MTLCaptureError)
22
+ {
23
+ /// Capturing is not supported, maybe the destination is not supported.
24
+ MTLCaptureErrorNotSupported = 1,
25
+ /// A capture is already in progress.
26
+ MTLCaptureErrorAlreadyCapturing,
27
+ /// The MTLCaptureDescriptor contains an invalid parameters.
28
+ MTLCaptureErrorInvalidDescriptor,
29
+ } API_AVAILABLE(macos(10.15), ios(13.0));
30
+
31
+ /// The destination where you want the GPU trace to be captured to.
32
+ typedef NS_ENUM(NSInteger, MTLCaptureDestination)
33
+ {
34
+ /// Capture to Developer Tools (Xcode) and stop the execution after capturing.
35
+ MTLCaptureDestinationDeveloperTools = 1,
36
+ /// Capture to a GPU Trace document and continue execution after capturing.
37
+ MTLCaptureDestinationGPUTraceDocument,
38
+ } API_AVAILABLE(macos(10.15), ios(13.0));
39
+
40
+ MTL_EXTERN API_AVAILABLE(macos(10.15), ios(13.0))
41
+ @interface MTLCaptureDescriptor: NSObject <NSCopying>
42
+
43
+ /**
44
+ @brief The object that is captured.
45
+
46
+ Must be one of the following:
47
+
48
+ MTLDevice captures all command queues of the device.
49
+
50
+ MTLCommandQueue captures a single command queue.
51
+
52
+ MTLCaptureScope captures between the next begin and end of the scope.
53
+ */
54
+ @property (nonatomic, strong, nullable) id captureObject;
55
+
56
+ /// The destination you want the GPU trace to be captured to.
57
+ @property (nonatomic, assign) MTLCaptureDestination destination;
58
+
59
+ /// URL the GPU Trace document will be captured to.
60
+ /// Must be specified when destiation is MTLCaptureDestinationGPUTraceDocument.
61
+ @property (nonatomic, copy, nullable) NSURL *outputURL;
62
+
63
+ @end
64
+
65
+
66
+ MTL_EXTERN API_AVAILABLE(macos(10.13), ios(11.0))
67
+ @interface MTLCaptureManager : NSObject
68
+
69
+ /** Retrieves the shared capture manager for this process. There is only one capture manager per process.
70
+ The capture manager allows the user to create capture scopes and trigger captures from code.
71
+ When a capture has been completed, it will be displayed in Xcode and the application will be paused.
72
+ @remarks: only MTLCommandBuffers created after starting a capture and committed before stopping it are captured.
73
+ */
74
+ + (MTLCaptureManager*)sharedCaptureManager;
75
+
76
+ // Use +[sharedCaptureManager]
77
+ - (instancetype)init API_UNAVAILABLE(macos, ios);
78
+
79
+ // Creates a new capture scope for the given capture device
80
+ - (id<MTLCaptureScope>)newCaptureScopeWithDevice:(id<MTLDevice>)device;
81
+ // Creates a new capture scope for the given command queue
82
+ - (id<MTLCaptureScope>)newCaptureScopeWithCommandQueue:(id<MTLCommandQueue>)commandQueue;
83
+
84
+ // Checks if a given capture destination is supported.
85
+ - (BOOL)supportsDestination:(MTLCaptureDestination)destination API_AVAILABLE(macos(10.15), ios(13.0));
86
+
87
+ /// Start capturing until stopCapture is called.
88
+ /// @param descriptor MTLCaptureDescriptor specifies the parameters.
89
+ /// @param error Optional error output to check why a capture could not be started.
90
+ /// @return true if the capture was successfully started, otherwise false.
91
+ /// @remarks Only MTLCommandBuffer​s created after starting and committed before stopping it are captured.
92
+ - (BOOL)startCaptureWithDescriptor:(MTLCaptureDescriptor *)descriptor error:(__autoreleasing NSError **)error API_AVAILABLE(macos(10.15), ios(13.0));
93
+
94
+ // Starts capturing, for all queues of the given device, new MTLCommandBuffer's until -[stopCapture] or Xcode’s stop capture button is pressed
95
+ - (void)startCaptureWithDevice:(id<MTLDevice>)device API_DEPRECATED("Use startCaptureWithDescriptor:error: instead", macos(10.13, 10.15), ios(11.0, 13.0));
96
+ // Starts capturing, for the given command queue, command buffers that are created after invoking this method and committed before invoking -[stopCapture] or clicking Xcode’s stop capture button.
97
+ - (void)startCaptureWithCommandQueue:(id<MTLCommandQueue>)commandQueue API_DEPRECATED("Use startCaptureWithDescriptor:error: instead", macos(10.13, 10.15), ios(11.0, 13.0));
98
+ // Start a capture with the given scope: from the scope's begin until its end, restricting the capture to the scope's device(s) and, if selected, the scope's command queue
99
+ - (void)startCaptureWithScope:(id<MTLCaptureScope>)captureScope API_DEPRECATED("Use startCaptureWithDescriptor:error: instead", macos(10.13, 10.15), ios(11.0, 13.0));
100
+
101
+ // Stops a capture started from startCaptureWithDevice:/startCaptureWithCommandQueue:/startCaptureWithScope: or from Xcode’s capture button
102
+ - (void)stopCapture;
103
+
104
+ // Default scope to be captured when a capture is initiated from Xcode’s capture button. When nil, it’ll fall back to presentDrawable:, presentDrawable:atTime:, presentDrawable:afterMinimumDuration: in MTLCommandBuffer or present:, present:atTime:, present:afterMinimumDuration: in MTLDrawable.
105
+ @property (nullable, readwrite, strong, atomic) id<MTLCaptureScope> defaultCaptureScope;
106
+
107
+ // Query if a capture is currently in progress
108
+ @property (readonly) BOOL isCapturing;
109
+
110
+ @end
111
+
112
+ NS_ASSUME_NONNULL_END
113
+
@@ -0,0 +1,43 @@
1
+ //
2
+ // MTLCaptureScope.h
3
+ // Metal
4
+ //
5
+ // Copyright © 2017 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Metal/MTLDefines.h>
10
+
11
+
12
+ NS_ASSUME_NONNULL_BEGIN
13
+
14
+ @protocol MTLDevice;
15
+ @protocol MTLCommandQueue;
16
+
17
+
18
+ API_AVAILABLE(macos(10.13), ios(11.0))
19
+ @protocol MTLCaptureScope <NSObject>
20
+
21
+ // Remarks: only MTLCommandBuffers created after -[beginScope] and committed before -[endScope] are captured.
22
+
23
+ // Marks the begin of the capture scope. Note: This method should be invoked repeatedly per frame.
24
+ - (void)beginScope;
25
+ // Marks the end of the capture scope. Note: This method should be invoked repeatedly per frame.
26
+ - (void)endScope;
27
+
28
+ /** Scope label
29
+ @remarks Created capture scopes are listed in Xcode when long-pressing the capture button, performing the capture over the selected scope
30
+ */
31
+ @property (nullable, copy, atomic) NSString *label;
32
+
33
+ // Associated device: this scope will capture Metal commands from the associated device
34
+ @property (nonnull, readonly, nonatomic) id<MTLDevice> device;
35
+ /** If set, this scope will only capture Metal commands from the associated command queue. Defaults to nil (all command queues from the associated device are captured).
36
+ */
37
+ @property (nullable, readonly, nonatomic) id<MTLCommandQueue> commandQueue;
38
+
39
+
40
+ @end
41
+
42
+ NS_ASSUME_NONNULL_END
43
+