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,141 @@
1
+ //
2
+ // MTLResidencySet.h
3
+ // Framework
4
+ //
5
+ // Copyright © 2023 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Metal/MTLDefines.h>
10
+
11
+ NS_ASSUME_NONNULL_BEGIN
12
+
13
+ @protocol MTLDevice;
14
+ @protocol MTLAllocation;
15
+ @protocol MTLResource;
16
+ @protocol MTLHeap;
17
+
18
+ /*!
19
+ @interface MTLResidencySetDescriptor
20
+ @abstract Specifies the parameters for MTLResidencySet creation.
21
+ */
22
+ API_AVAILABLE(macos(15.0), ios(18.0))
23
+ @interface MTLResidencySetDescriptor : NSObject<NSCopying>
24
+ /*!
25
+ @property label
26
+ @abstract An optional label for the MTLResidencySet.
27
+ */
28
+ @property (nullable, copy, nonatomic) NSString *label;
29
+
30
+ /*!
31
+ @property initialCapacity
32
+ @abstract If non-zero, defines the number of allocations for which to initialize the internal arrays. Defaults to zero.
33
+ */
34
+ @property (nonatomic) NSUInteger initialCapacity;
35
+
36
+
37
+ @end
38
+
39
+ /*!
40
+ @protocol MTLResidencySet
41
+ @abstract A residency set is responsible for managing resource and heap residency and is referenced
42
+ by a command buffer or command queue in order to ensure that resources and heaps are resident.
43
+ Resources and heaps are added and removed uncommitted and a subsequent commit call applies all
44
+ of the changes in bulk.
45
+ */
46
+ API_AVAILABLE(macos(15.0), ios(18.0))
47
+ @protocol MTLResidencySet <NSObject>
48
+ /*!
49
+ @property device
50
+ @abstract The device that created the residency set
51
+ */
52
+ @property (readonly) id<MTLDevice> _Nonnull device;
53
+
54
+ /*!
55
+ @property label
56
+ @abstract The label specified at creation.
57
+ */
58
+ @property (readonly, nullable) NSString* label;
59
+
60
+ /*!
61
+ @property allocatedSize
62
+ @abstract The memory footprint of the set in bytes at the last commit operation. This may include internal allocations as well.
63
+ */
64
+ @property (readonly) uint64_t allocatedSize;
65
+
66
+ /*!
67
+ @method requestResidency
68
+ @abstract Requests that the set and all the committed resources and heaps are made resident.
69
+ */
70
+ - (void)requestResidency;
71
+
72
+ /*!
73
+ @method endResidency
74
+ @abstract Requests that the set and all the committed resources and heaps are made non-resident.
75
+ */
76
+ - (void)endResidency;
77
+
78
+ /*!
79
+ @method addAllocation
80
+ @abstract Adds one allocation to the set, leaving it uncommitted until commit is called.
81
+ */
82
+ - (void)addAllocation:(id<MTLAllocation>)allocation;
83
+
84
+ /*!
85
+ @method addAllocations
86
+ @abstract Adds allocations to the set, leaving them uncommitted until commit is called.
87
+ */
88
+ - (void)addAllocations:(const id<MTLAllocation> _Nonnull[_Nonnull])allocations
89
+ count:(NSUInteger)count;
90
+
91
+ /*!
92
+ @method removeAllocation
93
+ @abstract Marks an allocation to be removed from the set on the next commit call.
94
+ */
95
+ - (void)removeAllocation:(id<MTLAllocation>)allocation;
96
+
97
+ /*!
98
+ @method removeAllocations
99
+ @abstract Marks allocations to be removed from the set on the next commit call.
100
+ */
101
+ - (void)removeAllocations:(const id<MTLAllocation> _Nonnull[_Nonnull])allocations
102
+ count:(NSUInteger)count;
103
+
104
+ /*!
105
+ @method removeAllAllocations
106
+ @abstract Marks all allocations to be removed from the set on the next commit call.
107
+ */
108
+ - (void)removeAllAllocations;
109
+
110
+ /*!
111
+ @method containsAllocation
112
+ @abstract Returns a boolean indicating whether the allocation is present in the set or not.
113
+ @discussion This check includes non-committed allocations in the set.
114
+ */
115
+ - (BOOL)containsAllocation:(id<MTLAllocation>)anAllocation;
116
+
117
+ /*!
118
+ @property allAllocations
119
+ @abstract Array of all allocations associated with the set.
120
+ @discussion This property includes non-committed allocations in the set.
121
+ */
122
+ @property (readonly, copy, nonnull) NSArray<id<MTLAllocation>> *allAllocations;
123
+
124
+ /*!
125
+ @property allocationCount
126
+ @abstract Returns the current number of unique allocations present in the set.
127
+ @discussion This property includes non-committed allocations in the set.
128
+ */
129
+ @property (readonly) NSUInteger allocationCount;
130
+
131
+ /*!
132
+ @method commit
133
+ @abstract Commits any pending adds/removes.
134
+ @discussion If the residency set is resident, this will try to make added resources and heaps resident instantly, and make removed resources and heaps non-resident.
135
+ */
136
+ - (void)commit;
137
+
138
+
139
+ @end
140
+
141
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,307 @@
1
+ //
2
+ // MTLResource.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/MTLAllocation.h>
11
+ #import <mach/mach.h>
12
+
13
+ NS_ASSUME_NONNULL_BEGIN
14
+ /*!
15
+ @enum MTLPurgeableOption
16
+ @abstract Options for setPurgeable call.
17
+
18
+ @constant MTLPurgeableStateNonVolatile
19
+ The contents of this resource may not be discarded.
20
+
21
+ @constant MTLPurgeableStateVolatile
22
+ The contents of this resource may be discarded.
23
+
24
+ @constant MTLPurgeableStateEmpty
25
+ The contents of this are discarded.
26
+
27
+ @constant MTLPurgeableStateKeepCurrent
28
+ The purgeabelity state is not changed.
29
+ */
30
+ typedef NS_ENUM(NSUInteger, MTLPurgeableState)
31
+ {
32
+ MTLPurgeableStateKeepCurrent = 1,
33
+
34
+ MTLPurgeableStateNonVolatile = 2,
35
+ MTLPurgeableStateVolatile = 3,
36
+ MTLPurgeableStateEmpty = 4,
37
+ } API_AVAILABLE(macos(10.11), ios(8.0));
38
+
39
+ /*!
40
+ @enum MTLCPUCacheMode
41
+ @abstract Describes what CPU cache mode is used for the CPU's mapping of a texture resource.
42
+ @constant MTLCPUCacheModeDefaultCache
43
+ The default cache mode for the system.
44
+
45
+ @constant MTLCPUCacheModeWriteCombined
46
+ Write combined memory is optimized for resources that the CPU will write into, but never read. On some implementations, writes may bypass caches avoiding cache pollution, and reads perform very poorly.
47
+
48
+ @discussion
49
+ Applications should only investigate changing the cache mode if writing to normally cached buffers is known to cause performance issues due to cache pollution, as write combined memory can have surprising performance pitfalls. Another approach is to use non-temporal stores to normally cached memory (STNP on ARMv8, _mm_stream_* on x86_64).
50
+ */
51
+ typedef NS_ENUM(NSUInteger, MTLCPUCacheMode)
52
+ {
53
+ MTLCPUCacheModeDefaultCache = 0,
54
+ MTLCPUCacheModeWriteCombined = 1,
55
+ } API_AVAILABLE(macos(10.11), ios(8.0));
56
+
57
+ /*!
58
+ @enum MTLStorageMode
59
+ @abstract Describes location and CPU mapping of MTLTexture.
60
+ @constant MTLStorageModeShared
61
+ In this mode, CPU and device will nominally both use the same underlying memory when accessing the contents of the texture resource.
62
+ However, coherency is only guaranteed at command buffer boundaries to minimize the required flushing of CPU and GPU caches.
63
+ This is the default storage mode for iOS Textures.
64
+
65
+ @constant MTLStorageModeManaged
66
+ This mode relaxes the coherency requirements and requires that the developer make explicit requests to maintain
67
+ coherency between a CPU and GPU version of the texture resource. In order for CPU to access up to date GPU results,
68
+ first, a blit synchronizations must be completed (see synchronize methods of MTLBlitCommandEncoder).
69
+ Blit overhead is only incurred if GPU has modified the resource.
70
+ This is the default storage mode for OS X Textures.
71
+
72
+ @constant MTLStorageModePrivate
73
+ This mode allows the texture resource data to be kept entirely to GPU (or driver) private memory that will never be accessed by the CPU directly, so no
74
+ conherency of any kind must be maintained.
75
+
76
+ @constant MTLStorageModeMemoryless
77
+ This mode allows creation of resources that do not have a GPU or CPU memory backing, but do have on-chip storage for TBDR
78
+ devices. The contents of the on-chip storage is undefined and does not persist, but its configuration is controlled by the
79
+ MTLTexture descriptor. Textures created with MTLStorageModeMemoryless dont have an IOAccelResource at any point in their
80
+ lifetime. The only way to populate such resource is to perform rendering operations on it. Blit operations are disallowed.
81
+ */
82
+ typedef NS_ENUM(NSUInteger, MTLStorageMode)
83
+ {
84
+ MTLStorageModeShared = 0,
85
+ MTLStorageModeManaged 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) = 1,
86
+ MTLStorageModePrivate = 2,
87
+ MTLStorageModeMemoryless API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(10.0)) = 3,
88
+ } API_AVAILABLE(macos(10.11), ios(9.0));
89
+
90
+ /*!
91
+ @enum MTLHazardTrackingMode
92
+ @abstract Describes how hazard tracking is performed.
93
+ @constant MTLHazardTrackingModeDefault The default hazard tracking mode for the context. Refer to the usage of the field for semantics.
94
+ @constant MTLHazardTrackingModeUntracked Do not perform hazard tracking.
95
+ @constant MTLHazardTrackingModeTracked Do perform hazard tracking.
96
+ */
97
+ typedef NS_ENUM(NSUInteger, MTLHazardTrackingMode)
98
+ {
99
+ MTLHazardTrackingModeDefault = 0,
100
+ MTLHazardTrackingModeUntracked = 1,
101
+ MTLHazardTrackingModeTracked = 2,
102
+ } API_AVAILABLE(macos(10.15), ios(13.0));
103
+
104
+ /*!
105
+ @enum MTLResourceOptions
106
+ @abstract A set of optional arguments to influence the creation of a MTLResource (MTLTexture or MTLBuffer)
107
+
108
+ @constant MTLResourceCPUCacheModeDefault
109
+ The default CPU cache mode for the resource.
110
+ Applications should only investigate changing the cache mode if writing to normally cached buffers is known to
111
+ cause performance issues due to cache pollution, as write combined memory can have surprising performance pitfalls.
112
+ Another approach is to use non-temporal stores to normally cached memory (STNP on ARMv8, _mm_stream_* on x86_64).
113
+
114
+ @constant MTLResourceCPUCacheModeWriteCombined
115
+ Write combined memory is optimized for resources that the CPU will write into, but never read.
116
+ On some implementations, writes may bypass caches avoiding cache pollution, and reads perform very poorly.
117
+
118
+ @constant MTLResourceStorageModeShared
119
+ In this mode, CPU and device will nominally both use the same underlying memory when accessing the contents of the resource.
120
+ However, coherency is only guaranteed at command buffer boundaries to minimize the required flushing of CPU and GPU caches.
121
+ This is the default storage mode for iOS Textures.
122
+
123
+ @constant MTLResourceStorageModeManaged
124
+ This mode relaxes the coherency requirements and requires that the developer make explicit requests to maintain
125
+ coherency between a CPU and GPU version of the resource. Changes due to CPU stores outside of the Metal API must be
126
+ indicated to Metal via MTLBuffer::didModifyRange:(NSRange)range. In order for CPU to access up to date GPU results,
127
+ first, a blit synchronizations must be completed (see synchronize methods of MTLBlitCommandEncoder).
128
+ Blit overhead is only incurred if GPU has modified the resource.
129
+ This storage mode is only defined for OS X.
130
+ This is the default storage mode for OS X Textures.
131
+
132
+ @constant MTLResourceStorageModePrivate
133
+ This mode allows the data to be kept entirely to GPU (or driver) private memory that will never be accessed by the CPU directly, so no
134
+ conherency of any kind must be maintained.
135
+
136
+ @constant MTLResourceStorageModeMemoryless
137
+ This mode allows creation of resources that do not have a GPU or CPU memory backing, but do have on-chip storage for TBDR
138
+ devices. The contents of the on-chip storage is undefined and does not persist, but its configuration is controlled by the
139
+ MTLTexture descriptor. Textures created with MTLStorageModeMemoryless dont have an IOAccelResource at any point in their
140
+ lifetime. The only way to populate such resource is to perform rendering operations on it. Blit operations are disallowed.
141
+
142
+ @constant MTLResourceHazardTrackingModeDefault
143
+ This mode is the default for the context in which it is specified,
144
+ which may be either MTLResourceHazardTrackingModeUntracked or MTLResourceHazardTrackingModeTracked.
145
+ Refer to the point of use to determing the meaning of this flag.
146
+
147
+ @constant MTLResourceHazardTrackingModeUntracked
148
+ In this mode, command encoder dependencies for this resource are tracked manually with MTLFence.
149
+ This value is the default for MTLHeap and resources sub-allocated from a MTLHeap,
150
+ and may optionally be specified for non-heap resources.
151
+
152
+ @constant MTLResourceHazardTrackingModeTracked
153
+ In this mode, command encoder dependencies for this resource are tracked automatically.
154
+ This value is the default for resources allocated from a MTLDevice,
155
+ and may optionally be specified for MTLHeap and resources sub-allocated from such heaps.
156
+
157
+ @discussion
158
+ Note that resource options are a property of MTLTextureDescriptor (resourceOptions), so apply to texture creation.
159
+ they are also passed directly into MTLBuffer creation methods.
160
+ */
161
+
162
+ #define MTLResourceCPUCacheModeShift 0
163
+ #define MTLResourceCPUCacheModeMask (0xfUL << MTLResourceCPUCacheModeShift)
164
+
165
+ #define MTLResourceStorageModeShift 4
166
+ #define MTLResourceStorageModeMask (0xfUL << MTLResourceStorageModeShift)
167
+
168
+ #define MTLResourceHazardTrackingModeShift 8
169
+ #define MTLResourceHazardTrackingModeMask (0x3UL << MTLResourceHazardTrackingModeShift)
170
+
171
+ typedef NS_OPTIONS(NSUInteger, MTLResourceOptions)
172
+ {
173
+ MTLResourceCPUCacheModeDefaultCache = MTLCPUCacheModeDefaultCache << MTLResourceCPUCacheModeShift,
174
+ MTLResourceCPUCacheModeWriteCombined = MTLCPUCacheModeWriteCombined << MTLResourceCPUCacheModeShift,
175
+
176
+ MTLResourceStorageModeShared API_AVAILABLE(macos(10.11), ios(9.0)) = MTLStorageModeShared << MTLResourceStorageModeShift,
177
+ MTLResourceStorageModeManaged 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) = MTLStorageModeManaged << MTLResourceStorageModeShift,
178
+ MTLResourceStorageModePrivate API_AVAILABLE(macos(10.11), ios(9.0)) = MTLStorageModePrivate << MTLResourceStorageModeShift,
179
+ MTLResourceStorageModeMemoryless API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(10.0)) = MTLStorageModeMemoryless << MTLResourceStorageModeShift,
180
+
181
+ MTLResourceHazardTrackingModeDefault API_AVAILABLE(macos(10.13), ios(10.0)) = MTLHazardTrackingModeDefault << MTLResourceHazardTrackingModeShift,
182
+ MTLResourceHazardTrackingModeUntracked API_AVAILABLE(macos(10.13), ios(10.0)) = MTLHazardTrackingModeUntracked << MTLResourceHazardTrackingModeShift,
183
+ MTLResourceHazardTrackingModeTracked API_AVAILABLE(macos(10.15), ios(13.0)) = MTLHazardTrackingModeTracked << MTLResourceHazardTrackingModeShift,
184
+
185
+ // Deprecated spellings
186
+ MTLResourceOptionCPUCacheModeDefault API_DEPRECATED_WITH_REPLACEMENT("MTLResourceCPUCacheModeDefaultCache", macos(10.11, 13.0), ios(8.0, 16.0)) = MTLResourceCPUCacheModeDefaultCache,
187
+ MTLResourceOptionCPUCacheModeWriteCombined API_DEPRECATED_WITH_REPLACEMENT("MTLResourceCPUCacheModeWriteCombined", macos(10.11, 13.0), ios(8.0, 16.0)) = MTLResourceCPUCacheModeWriteCombined,
188
+ } API_AVAILABLE(macos(10.11), ios(8.0));
189
+
190
+ /*!
191
+ @enum MTLSparsePageSize
192
+ @abstract Physical size of sparse resource page in KBs.
193
+ */
194
+ typedef NS_ENUM(NSInteger, MTLSparsePageSize)
195
+ {
196
+ MTLSparsePageSize16 = 101,
197
+ MTLSparsePageSize64 = 102,
198
+ MTLSparsePageSize256 = 103,
199
+ } API_AVAILABLE(macos(13.0), ios(16.0));
200
+
201
+
202
+ @protocol MTLDevice;
203
+
204
+ @protocol MTLHeap;
205
+
206
+ /*!
207
+ @protocol MTLResource
208
+ @abstract Common APIs available for MTLBuffer and MTLTexture instances
209
+ */
210
+ API_AVAILABLE(macos(10.11), ios(8.0))
211
+ @protocol MTLResource <MTLAllocation>
212
+
213
+ /*!
214
+ @property label
215
+ @abstract A string to help identify this object.
216
+ */
217
+ @property (nullable, copy, atomic) NSString *label;
218
+
219
+ /*!
220
+ @property device
221
+ @abstract The device this resource was created against. This resource can only be used with this device.
222
+ */
223
+ @property (readonly) id <MTLDevice> device;
224
+
225
+ /*!
226
+ @property cpuCacheMode
227
+ @abstract The cache mode used for the CPU mapping for this resource
228
+ */
229
+ @property (readonly) MTLCPUCacheMode cpuCacheMode;
230
+
231
+ /*!
232
+ @property storageMode
233
+ @abstract The resource storage mode used for the CPU mapping for this resource
234
+ */
235
+ @property (readonly) MTLStorageMode storageMode API_AVAILABLE(macos(10.11), ios(9.0));
236
+
237
+ /*!
238
+ @property hazardTrackingMode
239
+ @abstract Whether or not the resource is hazard tracked.
240
+ @discussion This value can be either MTLHazardTrackingModeUntracked or MTLHazardTrackingModeTracked.
241
+ Resources created from heaps are by default untracked, whereas resources created from the device are by default tracked.
242
+ */
243
+ @property (readonly) MTLHazardTrackingMode hazardTrackingMode API_AVAILABLE(macos(10.15), ios(13.0));
244
+
245
+ /*!
246
+ @property resourceOptions
247
+ @abstract A packed tuple of the storageMode, cpuCacheMode and hazardTrackingMode properties.
248
+ */
249
+ @property (readonly) MTLResourceOptions resourceOptions API_AVAILABLE(macos(10.15), ios(13.0));
250
+
251
+ /*!
252
+ @method setPurgeableState
253
+ @abstract Set (or query) the purgeability state of a resource
254
+ @discussion Synchronously set the purgeability state of a resource and return what the prior (or current) state is.
255
+ FIXME: If the device is keeping a cached copy of the resource, both the shared copy and cached copy are made purgeable. Any access to the resource by either the CPU or device will be undefined.
256
+ */
257
+ - (MTLPurgeableState)setPurgeableState:(MTLPurgeableState)state;
258
+
259
+ /*!
260
+ @property heap
261
+ @abstract The heap from which this resouce was created.
262
+ @discussion Nil when this resource is not backed by a heap.
263
+ */
264
+ @property (readonly, nullable) id <MTLHeap> heap API_AVAILABLE(macos(10.13), ios(10.0));
265
+
266
+ /*!
267
+ @property heapOffset
268
+ @abstract The offset inside the heap at which this resource was created.
269
+ @discussion Zero when this resource was not created on a heap with MTLHeapTypePlacement.
270
+ */
271
+ @property (readonly) NSUInteger heapOffset API_AVAILABLE(macos(10.15), ios(13.0));
272
+
273
+ /*!
274
+ @property allocatedSize
275
+ @abstract The size in bytes occupied by this resource
276
+ */
277
+ @property (readonly) NSUInteger allocatedSize API_AVAILABLE(macos(10.13), ios(11.0));
278
+
279
+ /*!
280
+ @method makeAliasable
281
+ @abstract Allow future heap sub-allocations to alias against this resource's memory.
282
+ @discussion It is illegal to call this method on a non heap-based resource.
283
+ It is also illegal to call this method on texture views created from heap-based textures.
284
+ The debug layer will raise an exception. Calling this method on textures sub-allocated
285
+ from Buffers backed by heap memory has no effect.
286
+ Once a resource is made aliasable, the decision cannot be reverted.
287
+ */
288
+ -(void) makeAliasable API_AVAILABLE(macos(10.13), ios(10.0));
289
+
290
+ /*!
291
+ @method isAliasable
292
+ @abstract Returns whether future heap sub-allocations may alias against this resource's memory.
293
+ @return YES if <st>makeAliasable</st> was previously successfully called on this resource. NO otherwise.
294
+ If resource is sub-allocated from other resource created on the heap, isAliasable returns
295
+ aliasing state of that base resource. Also returns NO when storage mode is memoryless.
296
+ */
297
+ -(BOOL) isAliasable API_AVAILABLE(macos(10.13), ios(10.0));
298
+
299
+ /*!
300
+ @method setOwnerWithIdentity:
301
+ @abstract Assigns ownership of the resource's underlying memory to another task for the purposes of VM accounting.
302
+ */
303
+ - (kern_return_t)setOwnerWithIdentity:(task_id_token_t)task_id_token API_AVAILABLE(ios(17.4), watchos(10.4), tvos(17.4), macos(14.4));
304
+ @end
305
+
306
+
307
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,125 @@
1
+ //
2
+ // MTLResourceStateCommandEncoder.h
3
+ // Metal
4
+ //
5
+ // Copyright © 2018 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/MTLTexture.h>
13
+ #import <Metal/MTLFence.h>
14
+ #import <Metal/MTLResourceStatePass.h>
15
+
16
+ NS_ASSUME_NONNULL_BEGIN
17
+
18
+ /*!
19
+ @enum MTLSparseTextureMappingMode
20
+ @abstract Type of mapping operation for sparse texture
21
+ */
22
+ typedef NS_ENUM(NSUInteger, MTLSparseTextureMappingMode)
23
+ {
24
+ MTLSparseTextureMappingModeMap = 0,
25
+ MTLSparseTextureMappingModeUnmap = 1,
26
+ } API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0), tvos(16.0));
27
+
28
+ /*!
29
+ @enum MTLMapIndirectArguments
30
+ @abstract Structure describing indirect mapping region. This structure is used to populate a buffer for the method 'MTLResourceStateCommandEncoder updateTextureMapping:indirectBuffer:indirectBufferOffset:'
31
+ @discussion The correct data format for the buffer used in 'MTLResourceStateCommandEncoder updateTextureMapping:indirectBuffer:indirectBufferOffset: is the following:
32
+
33
+ struct MTLMapIndirectBufferFormat{
34
+ uint32_t numMappings;
35
+ MTLMapIndirectArguments mappings[numMappings];
36
+ }
37
+ */
38
+ typedef struct {
39
+ uint32_t regionOriginX;
40
+ uint32_t regionOriginY;
41
+ uint32_t regionOriginZ;
42
+ uint32_t regionSizeWidth;
43
+ uint32_t regionSizeHeight;
44
+ uint32_t regionSizeDepth;
45
+ uint32_t mipMapLevel;
46
+ uint32_t sliceId;
47
+ } MTLMapIndirectArguments;
48
+
49
+ API_AVAILABLE(macos(10.15), ios(13.0), tvos(16.0))
50
+ @protocol MTLResourceStateCommandEncoder <MTLCommandEncoder>
51
+
52
+
53
+ /*!
54
+ @method updateTextureMappings:regions:mipLevels:slices:numRegions:mode:
55
+ @abstract Updates multiple regions within a sparse texture.
56
+ */
57
+ -(void) updateTextureMappings:(id<MTLTexture>) texture
58
+ mode:(const MTLSparseTextureMappingMode)mode
59
+ regions:(const MTLRegion[_Nonnull])regions
60
+ mipLevels:(const NSUInteger[_Nonnull])mipLevels
61
+ slices:(const NSUInteger[_Nonnull])slices
62
+ numRegions:(NSUInteger)numRegions API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0), tvos(16.0));
63
+
64
+ /*!
65
+ @method updateTextureMapping:region:mipLevel:slice:mode:
66
+ @abstract Updates mapping for given sparse texture
67
+ */
68
+ -(void) updateTextureMapping:(id<MTLTexture>) texture
69
+ mode:(const MTLSparseTextureMappingMode)mode
70
+ region:(const MTLRegion)region
71
+ mipLevel:(const NSUInteger)mipLevel
72
+ slice:(const NSUInteger)slice API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0), tvos(16.0));
73
+
74
+ /*!
75
+ @method updateTextureMapping:indirectBuffer:indirectBufferOffset:
76
+ @abstract Updates mapping for given sparse texture. Updates are driven via a MTLBuffer with the structure format defined by MTLMapIndirectBufferFormat.
77
+
78
+ struct MTLMapIndirectBufferFormat{
79
+ uint32_t numMappings;
80
+ MTLMapIndirectArguments mappings[numMappings];
81
+ }
82
+ */
83
+ -(void) updateTextureMapping:(id<MTLTexture>) texture
84
+ mode:(const MTLSparseTextureMappingMode)mode
85
+ indirectBuffer:(id<MTLBuffer>)indirectBuffer
86
+ indirectBufferOffset:(NSUInteger)indirectBufferOffset API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0), tvos(16.0));
87
+
88
+ /*!
89
+ @method updateFence:
90
+ @abstract Update the fence to capture all GPU work so far enqueued by this encoder.
91
+ @discussion The fence is updated at kernel submission to maintain global order and prevent deadlock.
92
+ 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.
93
+ */
94
+ - (void)updateFence:(id <MTLFence>)fence API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0), tvos(16.0));
95
+
96
+ /*!
97
+ @method waitForFence:
98
+ @abstract Prevent further GPU work until the fence is reached.
99
+ @discussion The fence is evaluated at kernel submission to maintain global order and prevent deadlock.
100
+ 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.
101
+ */
102
+ - (void)waitForFence:(id <MTLFence>)fence API_AVAILABLE(macos(11.0), macCatalyst(14.0), ios(13.0), tvos(16.0));
103
+
104
+
105
+ /*!
106
+ @method moveTextureMappingsFromTexture:sourceSlice:sourceLevel:sourceOrigin:sourceSize:toTexture:destinationSlice:destinationLevel:destinationOrigin:
107
+ @abstract Move sparse page mappings from one sparse texture to another from the same heap.
108
+ @discussion The tile mapping is moved from the source texture only if the destination texture tile is unmapped. The textures must also have matching a texture format,
109
+ texture type, sample count, usage and resource options.
110
+ */
111
+ -(void) moveTextureMappingsFromTexture:(id<MTLTexture>) sourceTexture
112
+ sourceSlice:(NSUInteger)sourceSlice
113
+ sourceLevel:(NSUInteger)sourceLevel
114
+ sourceOrigin:(MTLOrigin)sourceOrigin
115
+ sourceSize:(MTLSize)sourceSize
116
+ toTexture:(id<MTLTexture>) destinationTexture
117
+ destinationSlice:(NSUInteger)destinationSlice
118
+ destinationLevel:(NSUInteger)destinationLevel
119
+ destinationOrigin:(MTLOrigin)destinationOrigin API_AVAILABLE(macos(13.0), ios(16.0));
120
+
121
+
122
+
123
+ @end
124
+ NS_ASSUME_NONNULL_END
125
+
@@ -0,0 +1,85 @@
1
+ //
2
+ // MTLResourceStatePass.h
3
+ // Metal
4
+ //
5
+ // Copyright © 2020 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #import <Foundation/Foundation.h>
9
+ #import <Metal/MTLDefines.h>
10
+
11
+
12
+ #import <Metal/MTLTypes.h>
13
+
14
+ #import <Metal/MTLCounters.h>
15
+
16
+ NS_ASSUME_NONNULL_BEGIN
17
+ @protocol MTLDevice;
18
+
19
+ MTL_EXPORT API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0))
20
+ @interface MTLResourceStatePassSampleBufferAttachmentDescriptor : NSObject<NSCopying>
21
+ /*!
22
+ @property sampleBuffer
23
+ @abstract The sample buffer to store samples for the resourceState-pass defined samples.
24
+ If sampleBuffer is non-nil, the sample indices will be used to store samples into
25
+ the sample buffer. If no sample buffer is provided, no samples will be taken.
26
+ If any of the sample indices are specified as MTLCounterDontSample, no sample
27
+ will be taken for that action.
28
+ */
29
+ @property (nullable, nonatomic, retain) id<MTLCounterSampleBuffer> sampleBuffer;
30
+
31
+ /*!
32
+ @property startOfEncoderSampleIndex
33
+ @abstract The sample index to use to store the sample taken at the start of
34
+ command encoder processing. Setting the value to MTLCounterDontSample will cause
35
+ this sample to be omitted.
36
+ @discussion On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
37
+ this sample index is invalid and must be set to MTLCounterDontSample or creation of a resourceState pass will fail.
38
+ */
39
+ @property (nonatomic) NSUInteger startOfEncoderSampleIndex;
40
+
41
+ /*!
42
+ @property endOfEncoderSampleIndex
43
+ @abstract The sample index to use to store the sample taken at the end of
44
+ Command encoder processing. Setting the value to MTLCounterDontSample will cause
45
+ this sample to be omitted.
46
+ @discussion On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
47
+ this sample index is invalid and must be set to MTLCounterDontSample or creation of a resourceState pass will fail.
48
+ */
49
+ @property (nonatomic) NSUInteger endOfEncoderSampleIndex;
50
+
51
+ @end
52
+
53
+ MTL_EXPORT API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0))
54
+ @interface MTLResourceStatePassSampleBufferAttachmentDescriptorArray : NSObject
55
+ /* Individual attachment state access */
56
+ - (MTLResourceStatePassSampleBufferAttachmentDescriptor *)objectAtIndexedSubscript:(NSUInteger)attachmentIndex;
57
+
58
+ /* 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. */
59
+ - (void)setObject:(nullable MTLResourceStatePassSampleBufferAttachmentDescriptor *)attachment atIndexedSubscript:(NSUInteger)attachmentIndex;
60
+
61
+ @end
62
+
63
+ /*!
64
+ @class MTLResourceStatePassDescriptor
65
+ @abstract MTLResourceStatePassDescriptor represents a collection of attachments to be used to create a concrete resourceState command encoder
66
+ */
67
+ MTL_EXPORT API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0))
68
+ @interface MTLResourceStatePassDescriptor : NSObject <NSCopying>
69
+
70
+ /*!
71
+ @method resourceStatePassDescriptor
72
+ @abstract Create an autoreleased default frame buffer descriptor
73
+ */
74
+ + (MTLResourceStatePassDescriptor *)resourceStatePassDescriptor;
75
+
76
+
77
+ /*!
78
+ @property sampleBufferAttachments
79
+ @abstract An array of sample buffers and associated sample indices.
80
+ */
81
+ @property (readonly) MTLResourceStatePassSampleBufferAttachmentDescriptorArray * sampleBufferAttachments API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0));
82
+
83
+ @end
84
+
85
+ NS_ASSUME_NONNULL_END
@@ -0,0 +1,22 @@
1
+ //
2
+ // MTLResourceViewPool.h
3
+ // Metal
4
+ //
5
+ // Copyright © 2024 Apple, Inc. All rights reserved.
6
+ //
7
+
8
+ #ifndef MTLResourceViewPool_h
9
+ #define MTLResourceViewPool_h
10
+
11
+ #import <Metal/MTLDefines.h>
12
+ #import <Metal/MTLAllocation.h>
13
+ #import <Metal/MTLDevice.h>
14
+ #import <Metal/MTLTypes.h>
15
+
16
+ NS_ASSUME_NONNULL_BEGIN
17
+
18
+
19
+ NS_ASSUME_NONNULL_END
20
+
21
+ #endif //MTLResourceViewPool_h
22
+