peachsim 0.1.2671 → 0.1.2673

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 (132) hide show
  1. package/dist-lib/agent-daemon-client.cjs +1 -1
  2. package/dist-lib/agent-events.cjs +1 -1
  3. package/dist-lib/attached-projects.cjs +1 -1
  4. package/dist-lib/auth/shared-session.cjs +1 -1
  5. package/dist-lib/backend-origin.cjs +1 -1
  6. package/dist-lib/beta.cjs +1 -1
  7. package/dist-lib/beta.mjs +2 -2
  8. package/dist-lib/bridge-constants.cjs +1 -1
  9. package/dist-lib/bridge-contract-input.cjs +1 -1
  10. package/dist-lib/bridge-contract-input.mjs +5 -5
  11. package/dist-lib/bridge-contract.cjs +1 -1
  12. package/dist-lib/bridge-contract.mjs +3 -3
  13. package/dist-lib/bundle-channel.cjs +55 -16
  14. package/dist-lib/capture-contract.cjs +1 -1
  15. package/dist-lib/capture-contract.mjs +3 -3
  16. package/dist-lib/cloud-contract.cjs +1 -1
  17. package/dist-lib/cloud-contract.mjs +3 -3
  18. package/dist-lib/cloud-test-args.cjs +1 -1
  19. package/dist-lib/cloud-test-args.mjs +2 -2
  20. package/dist-lib/cloud.cjs +1 -1
  21. package/dist-lib/cloud.mjs +7 -7
  22. package/dist-lib/config.cjs +1 -1
  23. package/dist-lib/config.mjs +5 -5
  24. package/dist-lib/detox/index.cjs +1 -1
  25. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  26. package/dist-lib/esm-chunks/{acorn-7T5XSWDY.mjs → acorn-336UC4RP.mjs} +3 -3
  27. package/dist-lib/esm-chunks/{chunk-UCR4RTCY.mjs → chunk-3MZPG7IR.mjs} +1 -1
  28. package/dist-lib/esm-chunks/{chunk-CZ4FJ4KR.mjs → chunk-3ZNNDHDI.mjs} +1 -1
  29. package/dist-lib/esm-chunks/{chunk-ERRKTHCV.mjs → chunk-4GG2PPSU.mjs} +6 -6
  30. package/dist-lib/esm-chunks/{chunk-ITHUCUVE.mjs → chunk-5HOIZ6MQ.mjs} +2 -2
  31. package/dist-lib/esm-chunks/{chunk-BFOXC2Q7.mjs → chunk-7H7ZOZM2.mjs} +4 -4
  32. package/dist-lib/esm-chunks/{chunk-PIG7XXPE.mjs → chunk-BBGS4DZC.mjs} +1 -1
  33. package/dist-lib/esm-chunks/{chunk-MBZ3XJ2G.mjs → chunk-C6REX7EL.mjs} +46 -18
  34. package/dist-lib/esm-chunks/{chunk-VK77DNLO.mjs → chunk-D5FFCNAT.mjs} +1 -1
  35. package/dist-lib/esm-chunks/{chunk-R4IHDAGC.mjs → chunk-E4AUUK5I.mjs} +3 -3
  36. package/dist-lib/esm-chunks/{chunk-WXTSSUQ2.mjs → chunk-FNBMSPNT.mjs} +1 -1
  37. package/dist-lib/esm-chunks/{chunk-XK67F7AF.mjs → chunk-IU77JRSH.mjs} +1 -1
  38. package/dist-lib/esm-chunks/{chunk-7HUIJ5A4.mjs → chunk-KA7WVS2K.mjs} +1 -1
  39. package/dist-lib/esm-chunks/{chunk-WXUUWIEU.mjs → chunk-KXE5HCNR.mjs} +1 -1
  40. package/dist-lib/esm-chunks/{chunk-4O7RWSSK.mjs → chunk-L5O5XBPQ.mjs} +1 -1
  41. package/dist-lib/esm-chunks/{chunk-DAAGX2TQ.mjs → chunk-OZCOKJ7M.mjs} +1 -1
  42. package/dist-lib/esm-chunks/{chunk-F6OTQJ3O.mjs → chunk-P2BIUM7R.mjs} +1 -1
  43. package/dist-lib/esm-chunks/{chunk-NZ32CCPM.mjs → chunk-R6ZDUB54.mjs} +6 -6
  44. package/dist-lib/esm-chunks/{chunk-Q6CMBWUR.mjs → chunk-RF5IVPXG.mjs} +1 -1
  45. package/dist-lib/esm-chunks/{chunk-IDQ7IYVT.mjs → chunk-S4OMJTWN.mjs} +1 -1
  46. package/dist-lib/esm-chunks/{chunk-TIYQ6O26.mjs → chunk-VF6MYLEZ.mjs} +1 -1
  47. package/dist-lib/esm-chunks/{chunk-7Y7AMVKS.mjs → chunk-WSESTR3O.mjs} +1 -1
  48. package/dist-lib/esm-chunks/{chunk-SXDHXETH.mjs → chunk-XJLTGEVV.mjs} +5 -5
  49. package/dist-lib/esm-chunks/{chunk-QTWWJF6F.mjs → chunk-Y6ZJLACG.mjs} +1 -1
  50. package/dist-lib/esm-chunks/{chunk-MN4NLKQY.mjs → chunk-YTDJZT5E.mjs} +1 -1
  51. package/dist-lib/esm-chunks/{metro-layout-parser-GUQJGFTG.mjs → metro-layout-parser-NROJOPLZ.mjs} +3 -3
  52. package/dist-lib/esm-chunks/{swift-package-prebuilt-CA3ZFHLH.mjs → swift-package-prebuilt-2WRORWMA.mjs} +12 -12
  53. package/dist-lib/esm-chunks/{swift-sdk-app-module-4OKMUZBB.mjs → swift-sdk-app-module-SKXQBJ4J.mjs} +16 -16
  54. package/dist-lib/esm-chunks/{swift-sdk-image-WRNWUQRE.mjs → swift-sdk-image-WFS54ICR.mjs} +16 -16
  55. package/dist-lib/esm-chunks/{swift-sdk-image-producer-ERVRGFBT.mjs → swift-sdk-image-producer-P6FOBZHK.mjs} +5 -5
  56. package/dist-lib/expo-swift-bundle.cjs +54 -15
  57. package/dist-lib/expo-swift-metadata.cjs +1 -1
  58. package/dist-lib/expo-swift-metadata.mjs +7 -7
  59. package/dist-lib/home-paths.cjs +1 -1
  60. package/dist-lib/host/bridge-host.cjs +55 -16
  61. package/dist-lib/host/fetch-proxy-handler.cjs +4 -4
  62. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  63. package/dist-lib/host/fetch-proxy-overrides.mjs +2 -2
  64. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  65. package/dist-lib/host/websocket-proxy.cjs +1 -1
  66. package/dist-lib/index.cjs +1 -1
  67. package/dist-lib/kotlin-host.cjs +1 -1
  68. package/dist-lib/menu.cjs +1 -1
  69. package/dist-lib/menu.mjs +3 -3
  70. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  71. package/dist-lib/metro-fingerprint-registry.mjs +3 -3
  72. package/dist-lib/metro-production-bundle.cjs +1 -1
  73. package/dist-lib/metro-production-bundle.mjs +4 -4
  74. package/dist-lib/native-app-identity-project.cjs +1 -1
  75. package/dist-lib/native-app-identity-project.mjs +15 -15
  76. package/dist-lib/native-app-identity.cjs +1 -1
  77. package/dist-lib/native-app-identity.mjs +6 -6
  78. package/dist-lib/native-firebase-metadata.cjs +1 -1
  79. package/dist-lib/native-firebase-metadata.mjs +3 -3
  80. package/dist-lib/pdfium-raster.cjs +1 -1
  81. package/dist-lib/pdfium-raster.mjs +2 -2
  82. package/dist-lib/plist.cjs +1 -1
  83. package/dist-lib/plist.mjs +3 -3
  84. package/dist-lib/profiles.cjs +1 -1
  85. package/dist-lib/public-brand.cjs +1 -1
  86. package/dist-lib/public-origins-lib-esm.json +85 -85
  87. package/dist-lib/public-origins-lib.json +64 -64
  88. package/dist-lib/react-native-host-modules.cjs +1 -1
  89. package/dist-lib/react-native-host-modules.mjs +2 -2
  90. package/dist-lib/reap-browser.cjs +1 -1
  91. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  92. package/dist-lib/sdk.cjs +1 -1
  93. package/dist-lib/sdk.mjs +8 -8
  94. package/dist-lib/skills.cjs +55 -16
  95. package/dist-lib/swift-compile.cjs +33 -5
  96. package/dist-lib/swift-compile.mjs +12 -12
  97. package/dist-lib/swift-package.cjs +1 -1
  98. package/dist-lib/swift-package.mjs +3 -3
  99. package/dist-lib/swift-submit.cjs +1 -1
  100. package/dist-lib/swift-submit.mjs +6 -6
  101. package/dist-lib/swift-svg-raster.cjs +1 -1
  102. package/dist-lib/swift-svg-raster.mjs +2 -2
  103. package/dist-lib/swift-toolchain.cjs +1 -1
  104. package/dist-lib/swift.cjs +1 -1
  105. package/dist-lib/vendor/@peculiar/x509.cjs +1 -1
  106. package/dist-lib/vendor/@ruby/prism/src/nodes.js.cjs +1 -1
  107. package/dist-lib/vendor/@ruby/prism/src/parsePrism.js.cjs +1 -1
  108. package/dist-lib/vendor/acorn.cjs +1 -1
  109. package/dist-lib/vendor/magic-string.cjs +1 -1
  110. package/dist-lib/vendor/stream-json.cjs +1 -1
  111. package/dist-lib/vendor/sucrase/dist/index.js.cjs +1 -1
  112. package/dist-lib/vendor/sucrase/dist/parser/index.js.cjs +1 -1
  113. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/index.js.cjs +1 -1
  114. package/dist-lib/vendor/sucrase/dist/parser/tokenizer/types.js.cjs +1 -1
  115. package/dist-lib/vendor/sucrase.cjs +1 -1
  116. package/dist-lib/vendor/terser.cjs +1 -1
  117. package/dist-lib/vendor/valibot.cjs +1 -1
  118. package/dist-lib/vendor/ws.cjs +1 -1
  119. package/dist-lib/vendor/zod.cjs +1 -1
  120. package/dist-lib/worklet-executable.cjs +1 -1
  121. package/dist-lib/worklet-executable.mjs +3 -3
  122. package/dist-types/packages/peach-engine/src/remote-stream/client-config.d.ts +13 -0
  123. package/dist-types/packages/peach-engine/src/render-worker/host.d.ts +2 -2
  124. package/dist-types/packages/peach-engine/src/render-worker/protocol.d.ts +2 -2
  125. package/package.json +1 -1
  126. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructure.h +1 -261
  127. package/sdk/ios/System/Library/Frameworks/Metal.framework/Headers/MTLAccelerationStructureTypes.h +2 -215
  128. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MTLAccelerationStructureTypes.h +218 -0
  129. package/sdk/ios/System/Library/Frameworks/MetalTypes.framework/Headers/MetalTypes.h +265 -0
  130. package/src/swift-compile.ts +46 -4
  131. package/src/swift-host.ts +9 -2
  132. package/src/swift-objc-compile.ts +14 -5
@@ -0,0 +1,218 @@
1
+ #pragma once
2
+
3
+ #ifdef __METAL_VERSION__
4
+ #import <metal_stdlib>
5
+
6
+ typedef metal::packed_float3 MTLPackedFloat3;
7
+ typedef metal::packed_float4 MTLPackedFloatQuaternion;
8
+ #else
9
+ #include <math.h>
10
+ #include <stdint.h>
11
+
12
+ typedef struct _MTLPackedFloat3 {
13
+ union {
14
+ struct {
15
+ float x;
16
+ float y;
17
+ float z;
18
+ };
19
+ float elements[3];
20
+ };
21
+
22
+ #ifdef __cplusplus
23
+ _MTLPackedFloat3()
24
+ : x(0.0f), y(0.0f), z(0.0f)
25
+ {
26
+ }
27
+
28
+ _MTLPackedFloat3(float x, float y, float z)
29
+ : x(x), y(y), z(z)
30
+ {
31
+ }
32
+
33
+ float & operator[](int idx) {
34
+ return elements[idx];
35
+ }
36
+
37
+ const float & operator[](int idx) const {
38
+ return elements[idx];
39
+ }
40
+ #endif
41
+ } MTLPackedFloat3;
42
+
43
+ static inline MTLPackedFloat3 MTLPackedFloat3Make(float x, float y, float z)
44
+ {
45
+ MTLPackedFloat3 packedFloat3;
46
+ packedFloat3.x = x;
47
+ packedFloat3.y = y;
48
+ packedFloat3.z = z;
49
+ return packedFloat3;
50
+ }
51
+
52
+ typedef struct MTLPackedFloatQuaternion {
53
+ float x;
54
+ float y;
55
+ float z;
56
+ float w;
57
+
58
+ #ifdef __cplusplus
59
+ MTLPackedFloatQuaternion()
60
+ : x(0.0f), y(0.0f), z(0.0f), w(1.0f)
61
+ {
62
+ }
63
+
64
+ MTLPackedFloatQuaternion(float x, float y, float z, float w)
65
+ : x(x), y(y), z(z), w(w)
66
+ {
67
+ }
68
+
69
+ float & operator[](int idx) {
70
+ float *elements = &x;
71
+
72
+ return elements[idx];
73
+ }
74
+
75
+ const float & operator[](int idx) const {
76
+ const float *elements = &x;
77
+
78
+ return elements[idx];
79
+ }
80
+ #endif
81
+ } MTLPackedFloatQuaternion;
82
+
83
+ static inline MTLPackedFloatQuaternion MTLPackedFloatQuaternionMake(float x, float y, float z, float w)
84
+ {
85
+ MTLPackedFloatQuaternion packedQuaternion;
86
+ packedQuaternion.x = x;
87
+ packedQuaternion.y = y;
88
+ packedQuaternion.z = z;
89
+ packedQuaternion.w = w;
90
+ return packedQuaternion;
91
+ }
92
+
93
+ #endif
94
+
95
+ typedef struct _MTLPackedFloat4x3 {
96
+ MTLPackedFloat3 columns[4];
97
+
98
+ #ifdef __cplusplus
99
+ _MTLPackedFloat4x3() {
100
+ columns[0] = MTLPackedFloat3(0.0f, 0.0f, 0.0f);
101
+ columns[1] = MTLPackedFloat3(0.0f, 0.0f, 0.0f);
102
+ columns[2] = MTLPackedFloat3(0.0f, 0.0f, 0.0f);
103
+ columns[3] = MTLPackedFloat3(0.0f, 0.0f, 0.0f);
104
+ }
105
+
106
+ _MTLPackedFloat4x3(MTLPackedFloat3 column0, MTLPackedFloat3 column1, MTLPackedFloat3 column2, MTLPackedFloat3 column3) {
107
+ columns[0] = column0;
108
+ columns[1] = column1;
109
+ columns[2] = column2;
110
+ columns[3] = column3;
111
+ }
112
+
113
+ #ifndef __METAL_VERSION__
114
+ MTLPackedFloat3 & operator[](int idx) {
115
+ return columns[idx];
116
+ }
117
+
118
+ const MTLPackedFloat3 & operator[](int idx) const {
119
+ return columns[idx];
120
+ }
121
+ #else
122
+ thread MTLPackedFloat3 & operator[](int idx) thread {
123
+ return columns[idx];
124
+ }
125
+
126
+ const thread MTLPackedFloat3 & operator[](int idx) const thread {
127
+ return columns[idx];
128
+ }
129
+
130
+ device MTLPackedFloat3 & operator[](int idx) device {
131
+ return columns[idx];
132
+ }
133
+
134
+ const device MTLPackedFloat3 & operator[](int idx) const device {
135
+ return columns[idx];
136
+ }
137
+
138
+ const constant MTLPackedFloat3 & operator[](int idx) const constant {
139
+ return columns[idx];
140
+ }
141
+ #endif
142
+ #endif
143
+ } MTLPackedFloat4x3;
144
+
145
+ /**
146
+ * @brief An axis aligned bounding box with a min and max point
147
+ */
148
+ typedef struct _MTLAxisAlignedBoundingBox {
149
+ /**
150
+ * @brief Minimum point
151
+ */
152
+ MTLPackedFloat3 min;
153
+
154
+ /**
155
+ * @brief Maximum point
156
+ */
157
+ MTLPackedFloat3 max;
158
+
159
+ #ifdef __cplusplus
160
+ _MTLAxisAlignedBoundingBox()
161
+ : min(INFINITY, INFINITY, INFINITY),
162
+ max(-INFINITY, -INFINITY, -INFINITY)
163
+ {
164
+ }
165
+
166
+ #ifdef __METAL_VERSION__
167
+ _MTLAxisAlignedBoundingBox() threadgroup = default;
168
+ #endif
169
+
170
+
171
+ _MTLAxisAlignedBoundingBox(MTLPackedFloat3 p)
172
+ : min(p),
173
+ max(p)
174
+ {
175
+ }
176
+
177
+ _MTLAxisAlignedBoundingBox(MTLPackedFloat3 min, MTLPackedFloat3 max)
178
+ : min(min),
179
+ max(max)
180
+ {
181
+ }
182
+ #endif
183
+ } MTLAxisAlignedBoundingBox;
184
+
185
+ /**
186
+ * @brief A transformation represented by individual components such as translation and
187
+ * rotation. The rotation is represented by a quaternion, allowing for correct motion
188
+ * interpolation.
189
+ */
190
+ typedef struct {
191
+ /**
192
+ * @brief The scale of the instance applied before rotation alongside shear and pivot
193
+ */
194
+ MTLPackedFloat3 scale;
195
+
196
+ /**
197
+ * @brief The shear of the instance applied before rotation alongside scale and pivot
198
+ */
199
+ MTLPackedFloat3 shear;
200
+
201
+ /**
202
+ * @brief Translation applied before rotation alongside scale and shear. Allows
203
+ * rotation to pivot around a point.
204
+ */
205
+ MTLPackedFloat3 pivot;
206
+
207
+ /**
208
+ * @brief The rotation of the instance as a normalized quaternion. Applied after scale,
209
+ * shear, and pivot and before translation
210
+ */
211
+ MTLPackedFloatQuaternion rotation;
212
+
213
+ /**
214
+ * @brief The translation of the instance. Applied after rotation. Typically contains
215
+ * the composition of object translation and the inverse of the pivot translation.
216
+ */
217
+ MTLPackedFloat3 translation;
218
+ } MTLComponentTransform;
@@ -127,3 +127,268 @@ typedef NS_OPTIONS(NSUInteger, MTLCommandBufferErrorOption) {
127
127
  MTLCommandBufferErrorOptionNone = 0,
128
128
  MTLCommandBufferErrorOptionEncoderExecutionStatus = 1 << 0,
129
129
  } API_AVAILABLE(macos(11.0), ios(14.0));
130
+
131
+ #include "MTLAccelerationStructureTypes.h"
132
+
133
+ typedef NS_OPTIONS(uint32_t, MTLAccelerationStructureInstanceOptions) {
134
+ /**
135
+ * @brief No options
136
+ */
137
+ MTLAccelerationStructureInstanceOptionNone = 0,
138
+
139
+ /**
140
+ * @brief Disable triangle back or front face culling
141
+ */
142
+ MTLAccelerationStructureInstanceOptionDisableTriangleCulling = (1 << 0),
143
+
144
+ /**
145
+ * @brief Override triangle front-facing winding. By default, the winding is
146
+ * assumed to be clockwise unless overridden by the intersector object. This overrides
147
+ * the intersector's winding order.
148
+ */
149
+ MTLAccelerationStructureInstanceOptionTriangleFrontFacingWindingCounterClockwise = (1 << 1),
150
+
151
+ /**
152
+ * @brief Geometry is opaque
153
+ */
154
+ MTLAccelerationStructureInstanceOptionOpaque = (1 << 2),
155
+
156
+ /**
157
+ * @brief Geometry is non-opaque
158
+ */
159
+ MTLAccelerationStructureInstanceOptionNonOpaque = (1 << 3),
160
+ } API_AVAILABLE(macos(11.0), ios(14.0), tvos(16.0));
161
+
162
+ /**
163
+ * @brief Describes what happens to the object before the first motion key and after the last
164
+ * motion key.
165
+ */
166
+ typedef NS_ENUM(uint32_t, MTLMotionBorderMode){
167
+
168
+ /**
169
+ * @brief Motion is stopped. (default)
170
+ */
171
+ MTLMotionBorderModeClamp = 0,
172
+
173
+ /**
174
+ * @brief Object disappears
175
+ */
176
+ MTLMotionBorderModeVanish = 1
177
+ } API_AVAILABLE(macos(12.0), ios(15.0), tvos(16.0));
178
+
179
+ typedef struct {
180
+ /**
181
+ * @brief Transformation matrix describing how to transform the bottom-level acceleration structure.
182
+ */
183
+ MTLPackedFloat4x3 transformationMatrix;
184
+
185
+ /**
186
+ * @brief Instance options
187
+ */
188
+ MTLAccelerationStructureInstanceOptions options;
189
+
190
+ /**
191
+ * @brief Instance mask used to ignore geometry during ray tracing
192
+ */
193
+ uint32_t mask;
194
+
195
+ /**
196
+ * @brief Used to index into intersection function tables
197
+ */
198
+ uint32_t intersectionFunctionTableOffset;
199
+
200
+ /**
201
+ * @brief Acceleration structure index to use for this instance
202
+ */
203
+ uint32_t accelerationStructureIndex;
204
+ } MTLAccelerationStructureInstanceDescriptor API_AVAILABLE(macos(11.0), ios(14.0));
205
+
206
+ typedef struct {
207
+ /**
208
+ * @brief Transformation matrix describing how to transform the bottom-level acceleration structure.
209
+ */
210
+ MTLPackedFloat4x3 transformationMatrix;
211
+
212
+ /**
213
+ * @brief Instance options
214
+ */
215
+ MTLAccelerationStructureInstanceOptions options;
216
+
217
+ /**
218
+ * @brief Instance mask used to ignore geometry during ray tracing
219
+ */
220
+ uint32_t mask;
221
+
222
+ /**
223
+ * @brief Used to index into intersection function tables
224
+ */
225
+ uint32_t intersectionFunctionTableOffset;
226
+
227
+ /**
228
+ * @brief Acceleration structure index to use for this instance
229
+ */
230
+ uint32_t accelerationStructureIndex;
231
+
232
+ /**
233
+ * @brief User-assigned instance ID to help identify this instance in an
234
+ * application-defined way
235
+ */
236
+ uint32_t userID;
237
+ } MTLAccelerationStructureUserIDInstanceDescriptor API_AVAILABLE(macos(12.0), ios(15.0), tvos(16.0));
238
+
239
+ typedef struct {
240
+ /**
241
+ * @brief Instance options
242
+ */
243
+ MTLAccelerationStructureInstanceOptions options;
244
+
245
+ /**
246
+ * @brief Instance mask used to ignore geometry during ray tracing
247
+ */
248
+ uint32_t mask;
249
+
250
+ /**
251
+ * @brief Used to index into intersection function tables
252
+ */
253
+ uint32_t intersectionFunctionTableOffset;
254
+
255
+ /**
256
+ * @brief Acceleration structure index to use for this instance
257
+ */
258
+ uint32_t accelerationStructureIndex;
259
+
260
+ /**
261
+ * @brief User-assigned instance ID to help identify this instance in an
262
+ * application-defined way
263
+ */
264
+ uint32_t userID;
265
+
266
+ /**
267
+ * @brief The index of the first set of transforms describing one keyframe of the animation.
268
+ * These transforms are stored in a separate buffer and they are uniformly distributed over
269
+ * time time span of the motion.
270
+ */
271
+ uint32_t motionTransformsStartIndex;
272
+
273
+ /**
274
+ * @brief The count of motion transforms belonging to this motion which are stored in consecutive
275
+ * memory addresses at the separate motionTransforms buffer.
276
+ */
277
+ uint32_t motionTransformsCount;
278
+ /**
279
+ * @brief Motion border mode describing what happens if acceleration structure is sampled
280
+ * before motionStartTime
281
+ */
282
+ MTLMotionBorderMode motionStartBorderMode;
283
+
284
+ /**
285
+ * @brief Motion border mode describing what happens if acceleration structure is sampled
286
+ * after motionEndTime
287
+ */
288
+ MTLMotionBorderMode motionEndBorderMode;
289
+
290
+ /**
291
+ * @brief Motion start time of this instance
292
+ */
293
+ float motionStartTime;
294
+
295
+ /**
296
+ * @brief Motion end time of this instance
297
+ */
298
+ float motionEndTime;
299
+ } MTLAccelerationStructureMotionInstanceDescriptor API_AVAILABLE(macos(12.0), ios(15.0), tvos(16.0));
300
+
301
+ typedef struct {
302
+ /**
303
+ * @brief Transformation matrix describing how to transform the bottom-level acceleration structure.
304
+ */
305
+ MTLPackedFloat4x3 transformationMatrix;
306
+
307
+ /**
308
+ * @brief Instance options
309
+ */
310
+ MTLAccelerationStructureInstanceOptions options;
311
+
312
+ /**
313
+ * @brief Instance mask used to ignore geometry during ray tracing
314
+ */
315
+ uint32_t mask;
316
+
317
+ /**
318
+ * @brief Used to index into intersection function tables
319
+ */
320
+ uint32_t intersectionFunctionTableOffset;
321
+
322
+ /**
323
+ * @brief User-assigned instance ID to help identify this instance in an
324
+ * application-defined way
325
+ */
326
+ uint32_t userID;
327
+
328
+ /**
329
+ * @brief Acceleration structure resource handle to use for this instance
330
+ */
331
+ MTLResourceID accelerationStructureID;
332
+ } MTLIndirectAccelerationStructureInstanceDescriptor API_AVAILABLE(macos(14.0), ios(17.0));
333
+
334
+ typedef struct {
335
+ /**
336
+ * @brief Instance options
337
+ */
338
+ MTLAccelerationStructureInstanceOptions options;
339
+
340
+ /**
341
+ * @brief Instance mask used to ignore geometry during ray tracing
342
+ */
343
+ uint32_t mask;
344
+
345
+ /**
346
+ * @brief Used to index into intersection function tables
347
+ */
348
+ uint32_t intersectionFunctionTableOffset;
349
+
350
+ /**
351
+ * @brief User-assigned instance ID to help identify this instance in an
352
+ * application-defined way
353
+ */
354
+ uint32_t userID;
355
+
356
+ /**
357
+ * @brief Acceleration structure resource handle to use for this instance
358
+ */
359
+ MTLResourceID accelerationStructureID;
360
+
361
+ /**
362
+ * @brief The index of the first set of transforms describing one keyframe of the animation.
363
+ * These transforms are stored in a separate buffer and they are uniformly distributed over
364
+ * time time span of the motion.
365
+ */
366
+ uint32_t motionTransformsStartIndex;
367
+
368
+ /**
369
+ * @brief The count of motion transforms belonging to this motion which are stored in consecutive
370
+ * memory addresses at the separate motionTransforms buffer.
371
+ */
372
+ uint32_t motionTransformsCount;
373
+ /**
374
+ * @brief Motion border mode describing what happens if acceleration structure is sampled
375
+ * before motionStartTime
376
+ */
377
+ MTLMotionBorderMode motionStartBorderMode;
378
+
379
+ /**
380
+ * @brief Motion border mode describing what happens if acceleration structure is sampled
381
+ * after motionEndTime
382
+ */
383
+ MTLMotionBorderMode motionEndBorderMode;
384
+
385
+ /**
386
+ * @brief Motion start time of this instance
387
+ */
388
+ float motionStartTime;
389
+
390
+ /**
391
+ * @brief Motion end time of this instance
392
+ */
393
+ float motionEndTime;
394
+ } MTLIndirectAccelerationStructureMotionInstanceDescriptor API_AVAILABLE(macos(14.0), ios(17.0));
@@ -3262,6 +3262,35 @@ function clangImportModuleMapFlags(
3262
3262
  })
3263
3263
  }
3264
3264
 
3265
+ function stagedPodModuleMap(
3266
+ file: string,
3267
+ contents: string,
3268
+ inputs: SwiftCompileInput['files'],
3269
+ ): string {
3270
+ const pod = /^((?:.*\/)?Pods\/Headers\/Public)\/([^/]+)\/([^/]+)\.modulemap$/.exec(file)
3271
+ if (!pod || pod[2] === pod[3]) return contents
3272
+ const generated =
3273
+ /^\s*module \w+ \{\s*umbrella header "([^"/]+)"\s*export \*\s*module \* \{\s*export \*\s*\}\s*\}\s*$/.exec(
3274
+ contents,
3275
+ )
3276
+ if (!generated || generated[1] !== `${pod[3]}-umbrella.h`) return contents
3277
+ const directory = path.posix.dirname(file)
3278
+ const umbrella = inputs[path.posix.join(directory, generated[1])]
3279
+ if (!umbrella) return contents
3280
+ // CocoaPods can put the umbrella under the module name and the public headers
3281
+ // under the pod name. clang otherwise imports those headers textually as well.
3282
+ const publicHeaders = path.posix.join(pod[1]!, pod[3]!)
3283
+ const headers = [...new Set(nativeHeaderIncludes(umbrella))].flatMap((name) => {
3284
+ const header = path.posix.join(publicHeaders, name)
3285
+ return header.startsWith(`${publicHeaders}/`) && Object.hasOwn(inputs, header)
3286
+ ? [` header ${JSON.stringify(path.posix.relative(directory, header))}`]
3287
+ : []
3288
+ })
3289
+ if (headers.length === 0) return contents
3290
+ const declaration = `umbrella header ${JSON.stringify(generated[1])}`
3291
+ return contents.replace(declaration, `${declaration}\n${headers.join('\n')}`)
3292
+ }
3293
+
3265
3294
  // a unit that names the libxml2 interface reaches the library, as
3266
3295
  // `import libxml2` in an app source already does through siblings: the sdk
3267
3296
  // headers compile its `#include <libxml/...>`, and the link needs the
@@ -3727,6 +3756,7 @@ export function writeSwiftProject(
3727
3756
  // implementations consume. give those implementations a downstream target.
3728
3757
  const importModuleMaps = new Map<string, string>()
3729
3758
  const sourceModuleMaps = new Map<string, { path: string; contents: string }>()
3759
+ const podHeaderOwnership: [string, string][] = []
3730
3760
  const executableNativeUnits = new Map<
3731
3761
  string,
3732
3762
  { path: string; sources: string[]; index: number }
@@ -4064,7 +4094,7 @@ export function writeSwiftProject(
4064
4094
  target.name,
4065
4095
  'module.modulemap',
4066
4096
  )
4067
- const moduleContents = originalModuleMap
4097
+ const originalContents = originalModuleMap
4068
4098
  ? input.files[originalModuleMap[1]]
4069
4099
  : (swiftpmModuleMap?.contents ??
4070
4100
  packageModuleMap?.[1] ??
@@ -4073,8 +4103,17 @@ export function writeSwiftProject(
4073
4103
  roots.map((file) => path.join(layout.root, file)),
4074
4104
  submoduleImports.get(swiftTargetModuleName(target.name)),
4075
4105
  ))
4076
- if (moduleContents === undefined)
4106
+ if (originalContents === undefined)
4077
4107
  throw new Error('missing original module map ' + modulemap)
4108
+ const moduleContents =
4109
+ originalModuleMap && typeof originalContents === 'string'
4110
+ ? stagedPodModuleMap(modulemap, originalContents, input.files)
4111
+ : originalContents
4112
+ if (moduleContents !== originalContents)
4113
+ podHeaderOwnership.push([
4114
+ modulemap,
4115
+ createHash('sha256').update(moduleContents).digest('hex'),
4116
+ ])
4078
4117
  const framework =
4079
4118
  nativeC && moduleMapTokens(moduleContents.toString())[0] === 'framework'
4080
4119
  ? /^(.*)\/[^/]+\.framework\/Modules\/module\.modulemap$/.exec(modulemap)
@@ -4566,13 +4605,16 @@ export function writeSwiftProject(
4566
4605
  if (!stagedProducts.includes(entry.replace(/\.framework$/, '')))
4567
4606
  rmSync(path.join(providedFrameworks, entry), { recursive: true, force: true })
4568
4607
  const providedFrameworkFlags = stagedProducts.length ? ['-F', providedFrameworks] : []
4569
- // clang keys its module cache without search paths, so a module built before
4570
- // a framework became visible keeps its old __has_include answers.
4608
+ // clang caches __has_include results and textual declarations without recording
4609
+ // the missing module or header owner, so those changes invalidate its cache.
4571
4610
  const frameworkSearch = JSON.stringify([
4572
4611
  stagedProducts.sort(),
4573
4612
  [
4574
4613
  ...new Set(nativeTargets.flatMap((settings) => settings.frameworkSearchPaths)),
4575
4614
  ].sort(),
4615
+ ...(podHeaderOwnership.length > 0
4616
+ ? [podHeaderOwnership.sort(([a], [b]) => a.localeCompare(b))]
4617
+ : []),
4576
4618
  ])
4577
4619
  const frameworkSearchRecord = path.join(
4578
4620
  layout.root,
package/src/swift-host.ts CHANGED
@@ -1587,7 +1587,12 @@ async function buildXcodeLayout(root: string): Promise<XcodeLayout | null> {
1587
1587
  ? relative(settings.bridgingHeader)
1588
1588
  : null,
1589
1589
  prefixHeader: settings.prefixHeader ? relative(settings.prefixHeader) : null,
1590
- headerSearchPaths: settings.headerSearchPaths
1590
+ headerSearchPaths: [
1591
+ ...new Set([
1592
+ ...settings.headerSearchPaths,
1593
+ ...(target.swift?.includePaths ?? []),
1594
+ ]),
1595
+ ]
1591
1596
  .filter(
1592
1597
  (file) => file !== '/usr/include' && !file.startsWith('/usr/include/'),
1593
1598
  )
@@ -3481,7 +3486,9 @@ async function compile(
3481
3486
  (input.nativeTargets ?? []).map(({ name, headerSearchPaths }) => [
3482
3487
  name,
3483
3488
  headerSearchPaths.flatMap((directory) => {
3484
- const map = input.files[path.posix.join(directory, 'module.modulemap')]
3489
+ const map =
3490
+ input.files[path.posix.join(directory, 'module.modulemap')] ??
3491
+ input.files[path.posix.join(directory, 'module.map')]
3485
3492
  return map === undefined ? [] : moduleMapModules(map).map(({ name }) => name)
3486
3493
  }),
3487
3494
  ]),
@@ -823,10 +823,15 @@ function* xcodeObjCInputSteps(
823
823
  }
824
824
  return regular ? source : null
825
825
  }
826
- for (const directory of target.objc.headerSearchPaths) {
826
+ for (const directory of [
827
+ ...target.objc.headerSearchPaths,
828
+ ...(target.swift?.includePaths ?? []),
829
+ ]) {
827
830
  if (isSdkInclude(directory)) continue
828
- const file = availableHeader(path.join(directory, 'module.modulemap'))
829
- if (file) queue.push({ file, origin: directory })
831
+ for (const mapName of ['module.modulemap', 'module.map']) {
832
+ const file = availableHeader(path.join(directory, mapName))
833
+ if (file) queue.push({ file, origin: directory })
834
+ }
830
835
  }
831
836
  // a forced include on the search path is found like a quoted include; an
832
837
  // sdk header is no project input
@@ -852,8 +857,12 @@ function* xcodeObjCInputSteps(
852
857
  if (visited.has(visit)) continue
853
858
  visited.add(visit)
854
859
  add(file, !files.includes(file))
860
+ const isModuleMap = (candidate: string) =>
861
+ candidate.endsWith('.modulemap') ||
862
+ candidate === 'module.map' ||
863
+ candidate.endsWith(`${path.sep}module.map`)
855
864
  const real = links[file]
856
- if (real && !file.endsWith('.modulemap')) {
865
+ if (real && !isModuleMap(file)) {
857
866
  queue.push({ file: real, origin: foundIn })
858
867
  }
859
868
  let references = scannedReferences.get(file)
@@ -891,7 +900,7 @@ function* xcodeObjCInputSteps(
891
900
  ),
892
901
  ),
893
902
  )
894
- if (file.endsWith('.modulemap'))
903
+ if (isModuleMap(file))
895
904
  for (const match of text.matchAll(/\b(?:umbrella\s+)?header\s+"([^"]+)"/g))
896
905
  references.push({ name: match[1]!, quoted: true, next: false })
897
906
  scannedReferences.set(file, references)