@luma.gl/graph 10.0.0-alpha.7 → 10.0.0-alpha.8

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 (177) hide show
  1. package/dist/dist.dev.js +5096 -7269
  2. package/dist/dist.min.js +270 -83
  3. package/dist/experimental/index.cjs.map +2 -2
  4. package/dist/experimental/simulation/index.cjs.map +2 -2
  5. package/dist/gpu-core/compiled-gpu-graph.cjs +99 -14
  6. package/dist/gpu-core/compiled-gpu-graph.d.ts +26 -4
  7. package/dist/gpu-core/compiled-gpu-graph.d.ts.map +1 -1
  8. package/dist/gpu-core/compiled-gpu-graph.js +101 -13
  9. package/dist/gpu-core/compiled-gpu-graph.js.map +1 -1
  10. package/dist/gpu-core/gpu-command-graph-compiler.cjs +35 -3
  11. package/dist/gpu-core/gpu-command-graph-compiler.js +40 -4
  12. package/dist/gpu-core/gpu-command-graph-compiler.js.map +1 -1
  13. package/dist/gpu-core/gpu-command-graph-types.d.ts +2 -0
  14. package/dist/gpu-core/gpu-command-graph-types.d.ts.map +1 -1
  15. package/dist/gpu-core/gpu-compaction-operation.cjs +56 -0
  16. package/dist/gpu-core/gpu-compaction-operation.d.ts +20 -0
  17. package/dist/gpu-core/gpu-compaction-operation.d.ts.map +1 -0
  18. package/dist/gpu-core/gpu-compaction-operation.js +36 -0
  19. package/dist/gpu-core/gpu-compaction-operation.js.map +1 -0
  20. package/dist/gpu-core/gpu-compaction.cjs +35 -3
  21. package/dist/gpu-core/gpu-compaction.d.ts.map +1 -1
  22. package/dist/gpu-core/gpu-compaction.js +38 -3
  23. package/dist/gpu-core/gpu-compaction.js.map +1 -1
  24. package/dist/gpu-core/gpu-expression-operation.cjs +18 -2
  25. package/dist/gpu-core/gpu-expression-operation.d.ts +2 -2
  26. package/dist/gpu-core/gpu-expression-operation.d.ts.map +1 -1
  27. package/dist/gpu-core/gpu-expression-operation.js +20 -1
  28. package/dist/gpu-core/gpu-expression-operation.js.map +1 -1
  29. package/dist/gpu-core/gpu-expression-plan.cjs +140 -29
  30. package/dist/gpu-core/gpu-expression-plan.d.ts +26 -5
  31. package/dist/gpu-core/gpu-expression-plan.d.ts.map +1 -1
  32. package/dist/gpu-core/gpu-expression-plan.js +168 -34
  33. package/dist/gpu-core/gpu-expression-plan.js.map +1 -1
  34. package/dist/gpu-core/gpu-graph-compiler.cjs +100 -11
  35. package/dist/gpu-core/gpu-graph-compiler.d.ts +7 -3
  36. package/dist/gpu-core/gpu-graph-compiler.d.ts.map +1 -1
  37. package/dist/gpu-core/gpu-graph-compiler.js +109 -9
  38. package/dist/gpu-core/gpu-graph-compiler.js.map +1 -1
  39. package/dist/gpu-core/gpu-graph-declarations.cjs +120 -0
  40. package/dist/gpu-core/gpu-graph-declarations.d.ts +4 -0
  41. package/dist/gpu-core/gpu-graph-declarations.d.ts.map +1 -0
  42. package/dist/gpu-core/gpu-graph-declarations.js +110 -0
  43. package/dist/gpu-core/gpu-graph-declarations.js.map +1 -0
  44. package/dist/gpu-core/gpu-graph-validation.cjs +33 -2
  45. package/dist/gpu-core/gpu-graph-validation.d.ts.map +1 -1
  46. package/dist/gpu-core/gpu-graph-validation.js +32 -0
  47. package/dist/gpu-core/gpu-graph-validation.js.map +1 -1
  48. package/dist/gpu-core/gpu-graph-value.cjs +38 -3
  49. package/dist/gpu-core/gpu-graph-value.d.ts +50 -4
  50. package/dist/gpu-core/gpu-graph-value.d.ts.map +1 -1
  51. package/dist/gpu-core/gpu-graph-value.js +39 -1
  52. package/dist/gpu-core/gpu-graph-value.js.map +1 -1
  53. package/dist/gpu-core/gpu-graph.cjs +65 -0
  54. package/dist/gpu-core/gpu-graph.d.ts +15 -2
  55. package/dist/gpu-core/gpu-graph.d.ts.map +1 -1
  56. package/dist/gpu-core/gpu-graph.js +70 -0
  57. package/dist/gpu-core/gpu-graph.js.map +1 -1
  58. package/dist/gpu-core/gpu-operation-contract.cjs +5 -0
  59. package/dist/gpu-core/gpu-operation-contract.d.ts +10 -0
  60. package/dist/gpu-core/gpu-operation-contract.d.ts.map +1 -1
  61. package/dist/gpu-core/gpu-operation-contract.js +6 -1
  62. package/dist/gpu-core/gpu-operation-contract.js.map +1 -1
  63. package/dist/gpu-core/gpu-scan.cjs +11 -2
  64. package/dist/gpu-core/gpu-scan.d.ts.map +1 -1
  65. package/dist/gpu-core/gpu-scan.js +11 -2
  66. package/dist/gpu-core/gpu-scan.js.map +1 -1
  67. package/dist/gpu-core/gpu-texture-copy.cjs +53 -0
  68. package/dist/gpu-core/gpu-texture-copy.d.ts +7 -0
  69. package/dist/gpu-core/gpu-texture-copy.d.ts.map +1 -0
  70. package/dist/gpu-core/gpu-texture-copy.js +39 -0
  71. package/dist/gpu-core/gpu-texture-copy.js.map +1 -0
  72. package/dist/gpu-core/gpu-texture-plan.cjs +181 -0
  73. package/dist/gpu-core/gpu-texture-plan.d.ts +32 -0
  74. package/dist/gpu-core/gpu-texture-plan.d.ts.map +1 -0
  75. package/dist/gpu-core/gpu-texture-plan.js +215 -0
  76. package/dist/gpu-core/gpu-texture-plan.js.map +1 -0
  77. package/dist/gpu-core/gpu-transfer-lowering.cjs +109 -0
  78. package/dist/gpu-core/gpu-transfer-lowering.d.ts +9 -0
  79. package/dist/gpu-core/gpu-transfer-lowering.d.ts.map +1 -0
  80. package/dist/gpu-core/gpu-transfer-lowering.js +88 -0
  81. package/dist/gpu-core/gpu-transfer-lowering.js.map +1 -0
  82. package/dist/gpu-core/gpu-transfer-operation.cjs +100 -0
  83. package/dist/gpu-core/gpu-transfer-operation.d.ts +38 -0
  84. package/dist/gpu-core/gpu-transfer-operation.d.ts.map +1 -0
  85. package/dist/gpu-core/gpu-transfer-operation.js +84 -0
  86. package/dist/gpu-core/gpu-transfer-operation.js.map +1 -0
  87. package/dist/gpu-core/index.cjs +13 -0
  88. package/dist/gpu-core/index.cjs.map +3 -3
  89. package/dist/gpu-core/index.d.ts +11 -1
  90. package/dist/gpu-core/index.d.ts.map +1 -1
  91. package/dist/gpu-core/index.js +4 -1
  92. package/dist/gpu-core/index.js.map +1 -1
  93. package/dist/gpu-dggs/benchmarks.cjs.map +2 -2
  94. package/dist/gpu-graph/index.cjs +8 -0
  95. package/dist/gpu-graph/index.cjs.map +3 -3
  96. package/dist/gpu-graph/index.d.ts +5 -0
  97. package/dist/gpu-graph/index.d.ts.map +1 -1
  98. package/dist/gpu-graph/index.js +2 -0
  99. package/dist/gpu-graph/index.js.map +1 -1
  100. package/dist/gpu-graph-algorithms/benchmarks.cjs.map +3 -3
  101. package/dist/gpu-graph-algorithms/index.cjs.map +2 -2
  102. package/dist/gpu-physics/gpu-rigid-body-world.cjs +56 -17
  103. package/dist/gpu-physics/gpu-rigid-body-world.d.ts +1 -1
  104. package/dist/gpu-physics/gpu-rigid-body-world.d.ts.map +1 -1
  105. package/dist/gpu-physics/gpu-rigid-body-world.js +42 -2
  106. package/dist/gpu-physics/gpu-rigid-body-world.js.map +1 -1
  107. package/dist/gpu-physics/index.cjs.map +2 -2
  108. package/dist/gpu-physics/rigid-body-joints.cjs +6 -1
  109. package/dist/gpu-physics/rigid-body-joints.d.ts.map +1 -1
  110. package/dist/gpu-physics/rigid-body-joints.js +9 -1
  111. package/dist/gpu-physics/rigid-body-joints.js.map +1 -1
  112. package/dist/gpu-physics/rigid-body-parallel-shaders.cjs +4 -2
  113. package/dist/gpu-physics/rigid-body-parallel-shaders.d.ts.map +1 -1
  114. package/dist/gpu-physics/rigid-body-parallel-shaders.js +4 -2
  115. package/dist/gpu-physics/rigid-body-parallel-shaders.js.map +1 -1
  116. package/dist/gpu-physics/rigid-body-shaders.cjs +1 -0
  117. package/dist/gpu-physics/rigid-body-shaders.d.ts.map +1 -1
  118. package/dist/gpu-physics/rigid-body-shaders.js +1 -0
  119. package/dist/gpu-physics/rigid-body-shaders.js.map +1 -1
  120. package/dist/gpu-pointcloud/index.cjs.map +1 -1
  121. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.cjs +54 -7
  122. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts +11 -4
  123. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.d.ts.map +1 -1
  124. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js +56 -4
  125. package/dist/gpu-simple-graph/compiled-gpu-expression-graph.js.map +1 -1
  126. package/dist/gpu-simple-graph/gpu-simple-graph.cjs +16 -0
  127. package/dist/gpu-simple-graph/gpu-simple-graph.d.ts +11 -4
  128. package/dist/gpu-simple-graph/gpu-simple-graph.d.ts.map +1 -1
  129. package/dist/gpu-simple-graph/gpu-simple-graph.js +18 -0
  130. package/dist/gpu-simple-graph/gpu-simple-graph.js.map +1 -1
  131. package/dist/gpu-simple-graph/gpu-transfer-execution.cjs +82 -0
  132. package/dist/gpu-simple-graph/gpu-transfer-execution.d.ts +7 -0
  133. package/dist/gpu-simple-graph/gpu-transfer-execution.d.ts.map +1 -0
  134. package/dist/gpu-simple-graph/gpu-transfer-execution.js +64 -0
  135. package/dist/gpu-simple-graph/gpu-transfer-execution.js.map +1 -0
  136. package/dist/gpu-simple-graph/index.cjs +3 -0
  137. package/dist/gpu-simple-graph/index.cjs.map +3 -3
  138. package/dist/gpu-simple-graph/index.d.ts +3 -0
  139. package/dist/gpu-simple-graph/index.d.ts.map +1 -1
  140. package/dist/gpu-simple-graph/index.js +1 -0
  141. package/dist/gpu-simple-graph/index.js.map +1 -1
  142. package/dist/index.cjs +13 -0
  143. package/dist/index.cjs.map +3 -3
  144. package/dist/index.d.ts +11 -1
  145. package/dist/index.d.ts.map +1 -1
  146. package/dist/index.js +4 -1
  147. package/dist/index.js.map +1 -1
  148. package/package.json +6 -7
  149. package/src/gpu-core/compiled-gpu-graph.ts +118 -15
  150. package/src/gpu-core/gpu-command-graph-compiler.ts +38 -6
  151. package/src/gpu-core/gpu-command-graph-types.ts +2 -0
  152. package/src/gpu-core/gpu-compaction-operation.ts +49 -0
  153. package/src/gpu-core/gpu-compaction.ts +47 -3
  154. package/src/gpu-core/gpu-expression-operation.ts +23 -2
  155. package/src/gpu-core/gpu-expression-plan.ts +247 -44
  156. package/src/gpu-core/gpu-graph-compiler.ts +130 -11
  157. package/src/gpu-core/gpu-graph-declarations.ts +137 -0
  158. package/src/gpu-core/gpu-graph-validation.ts +32 -0
  159. package/src/gpu-core/gpu-graph-value.ts +88 -4
  160. package/src/gpu-core/gpu-graph.ts +104 -2
  161. package/src/gpu-core/gpu-operation-contract.ts +18 -0
  162. package/src/gpu-core/gpu-scan.ts +15 -2
  163. package/src/gpu-core/gpu-texture-copy.ts +51 -0
  164. package/src/gpu-core/gpu-texture-plan.ts +248 -0
  165. package/src/gpu-core/gpu-transfer-lowering.ts +102 -0
  166. package/src/gpu-core/gpu-transfer-operation.ts +110 -0
  167. package/src/gpu-core/index.ts +22 -1
  168. package/src/gpu-graph/index.ts +15 -0
  169. package/src/gpu-physics/gpu-rigid-body-world.ts +44 -3
  170. package/src/gpu-physics/rigid-body-joints.ts +11 -2
  171. package/src/gpu-physics/rigid-body-parallel-shaders.ts +4 -2
  172. package/src/gpu-physics/rigid-body-shaders.ts +1 -0
  173. package/src/gpu-simple-graph/compiled-gpu-expression-graph.ts +90 -8
  174. package/src/gpu-simple-graph/gpu-simple-graph.ts +56 -3
  175. package/src/gpu-simple-graph/gpu-transfer-execution.ts +73 -0
  176. package/src/gpu-simple-graph/index.ts +9 -0
  177. package/src/index.ts +29 -1
@@ -383,7 +383,7 @@ class GPURigidBodyWorld {
383
383
  };
384
384
  }
385
385
  addToGraph(graph) {
386
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
386
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t;
387
387
  if (this.device || this.destroyed)
388
388
  throw new Error("Rigid-body world already attached or destroyed");
389
389
  const { packed, sparse, extended, parallel, geometryOffset, pairOffset, diagnosticOffset, metadataLength, parallelByteLength, triggerLayout, buffers: allocationPlan } = this.getStorageLayout();
@@ -623,6 +623,23 @@ class GPURigidBodyWorld {
623
623
  parallelSleep: ["velocities", "angularVelocities", "bodies", "sleepStates", "parallelState"]
624
624
  };
625
625
  parallelBindings["parallelSolve"] = parallelBindings["parallelPairs"];
626
+ if ((_f = this.props.joints) == null ? void 0 : _f.length) {
627
+ const jointBindings = [
628
+ "settings",
629
+ "positions",
630
+ "orientations",
631
+ "velocities",
632
+ "angularVelocities",
633
+ "bodies",
634
+ "sleepStates",
635
+ "targets"
636
+ ];
637
+ parallelBindings["parallelJointWarm"] = jointBindings;
638
+ parallelBindings["parallelJointSolve"] = jointBindings;
639
+ parallelBindings["parallelSolve"] = [
640
+ .../* @__PURE__ */ new Set([...parallelBindings["parallelSolve"], ...jointBindings])
641
+ ];
642
+ }
626
643
  this.simulationStatistics = allocate("simulation-statistics", 64);
627
644
  const statisticsResource = graph.importBuffer({ id: `${this.id}-statistics`, byteLength: 64, usage: import_core.Buffer.STORAGE }, this.simulationStatistics);
628
645
  const checkpointStates = [
@@ -649,15 +666,15 @@ class GPURigidBodyWorld {
649
666
  return { buffer: binding.buffer, resource: binding.resource };
650
667
  }), { buffer: this.simulationStatistics, resource: statisticsResource }, allocate) : void 0;
651
668
  const continuousSelection = new Uint32Array(this.count);
652
- for (const body of ((_f = this.props.continuous) == null ? void 0 : _f.bodies) ?? [])
669
+ for (const body of ((_g = this.props.continuous) == null ? void 0 : _g.bodies) ?? [])
653
670
  continuousSelection[body] = this.colliders.findIndex((collider) => collider.body === body) + 1;
654
- const continuous = this.props.continuous ? (0, import_rigid_body_continuous.addRigidBodyContinuous)(graph, this.id, source, this.count, continuousSelection, this.props.continuous.maximumImpacts ?? 4, bindings, allocate, Boolean((_g = this.props.joints) == null ? void 0 : _g.length), this.props.continuous.mode === "convex" ? this.props.continuous.maximumCandidates ?? this.maximumPairs : 0, this.colliderStorageCount, extended, this.colliders.some((collider) => collider.shape.type === "convex-hull")) : void 0;
671
+ const continuous = this.props.continuous ? (0, import_rigid_body_continuous.addRigidBodyContinuous)(graph, this.id, source, this.count, continuousSelection, this.props.continuous.maximumImpacts ?? 4, bindings, allocate, Boolean((_h = this.props.joints) == null ? void 0 : _h.length), this.props.continuous.mode === "convex" ? this.props.continuous.maximumCandidates ?? this.maximumPairs : 0, this.colliderStorageCount, extended, this.colliders.some((collider) => collider.shape.type === "convex-hull")) : void 0;
655
672
  const triggers = triggerLayout ? (0, import_rigid_body_triggers.addRigidBodyTriggers)(graph, this.id, source, this.colliderStorageCount, triggerLayout, this.props.triggerEventCapacity ?? 256, bindings, {
656
673
  name: "triggerStatistics",
657
674
  buffer: this.simulationStatistics,
658
675
  resource: statisticsResource,
659
676
  location: 18
660
- }, allocate, Boolean((_h = this.props.joints) == null ? void 0 : _h.length), extended) : void 0;
677
+ }, allocate, Boolean((_i = this.props.joints) == null ? void 0 : _i.length), extended) : void 0;
661
678
  this.triggerEvents = (triggers == null ? void 0 : triggers.events) ?? null;
662
679
  const passDescriptions = {
663
680
  integrate: "Apply gravity and advance body velocities and predicted poses for this timestep.",
@@ -708,10 +725,10 @@ class GPURigidBodyWorld {
708
725
  ...this.ensembleBuffer ? ["parallelPrepareSleep"] : [],
709
726
  "parallelMarkSleep",
710
727
  "parallelSleep"
711
- ] : [...extended && ((_i = this.props.joints) == null ? void 0 : _i.length) ? ["meshCollect"] : [], "solve", "finish"]
728
+ ] : [...extended && ((_j = this.props.joints) == null ? void 0 : _j.length) ? ["meshCollect"] : [], "solve", "finish"]
712
729
  ]) {
713
730
  if (entryPoint === "integrate")
714
- (_j = restoreCheckpoint == null ? void 0 : restoreCheckpoint.save) == null ? void 0 : _j.call(restoreCheckpoint);
731
+ (_k = restoreCheckpoint == null ? void 0 : restoreCheckpoint.save) == null ? void 0 : _k.call(restoreCheckpoint);
715
732
  if (sparse && entryPoint === "collide") {
716
733
  const bodyBinding = bindings.find((binding) => binding.name === "bodies");
717
734
  const minimumBinding = bindings.find((binding) => binding.name === "minima");
@@ -758,11 +775,11 @@ class GPURigidBodyWorld {
758
775
  "maxima"
759
776
  ].includes(binding.name)).map((binding) => binding.name) : entryPoint === "meshCollide" ? ["velocities", "angularVelocities", "manifolds", "sleepStates", "targets"] : entryPoint === "integrate" ? ["manifolds", ...this.ensembleBuffer ? ["meshTasks"] : []] : entryPoint === "collide" ? [
760
777
  "sleepStates",
761
- ...extended || sparse || ((_k = this.props.joints) == null ? void 0 : _k.length) ? [] : ["targets"]
762
- ] : entryPoint === "finish" ? ["manifolds", "meshTasks"] : ((_l = this.props.joints) == null ? void 0 : _l.length) ? [] : ["targets"];
778
+ ...extended || sparse || ((_l = this.props.joints) == null ? void 0 : _l.length) ? [] : ["targets"]
779
+ ] : entryPoint === "finish" ? ["manifolds", "meshTasks"] : ((_m = this.props.joints) == null ? void 0 : _m.length) ? [] : ["targets"];
763
780
  const unused = [
764
781
  ...unusedCore,
765
- ...entryPoint === "solve" && ((_m = this.props.joints) == null ? void 0 : _m.length) ? ["meshTasks"] : [],
782
+ ...entryPoint === "solve" && ((_n = this.props.joints) == null ? void 0 : _n.length) ? ["meshTasks"] : [],
766
783
  ...entryPoint.startsWith("parallel") ? [] : ["parallelState", "parallelDispatch"],
767
784
  ...entryPoint === "bounds" ? [] : ["minima", "maxima"]
768
785
  ];
@@ -813,7 +830,12 @@ class GPURigidBodyWorld {
813
830
  ].includes(entryPoint));
814
831
  const indirectResources = scheduledDispatch ? [{ buffer: schedulerBinding.resource, usage: "indirect" }] : indirectPairs ? [{ buffer: dispatchBinding.resource, usage: "indirect" }] : [];
815
832
  if (entryPoint === "parallelSolve") {
816
- const stages = ["parallelWarm", "parallelPairs", "parallelGather"];
833
+ const stages = [
834
+ "parallelWarm",
835
+ "parallelPairs",
836
+ "parallelGather",
837
+ ...((_o = this.props.joints) == null ? void 0 : _o.length) ? ["parallelJointWarm", "parallelJointSolve"] : []
838
+ ];
817
839
  const properties = stages.map((stage) => ({
818
840
  id: `${this.id}-${stage}`,
819
841
  source,
@@ -858,9 +880,19 @@ class GPURigidBodyWorld {
858
880
  };
859
881
  dispatchPairs(computations[0]);
860
882
  dispatchBodies(computations[2]);
883
+ if (computations[3])
884
+ computations[3].kernel.dispatch(computePass, {
885
+ bindings: computations[3].bindings,
886
+ x: 1
887
+ });
861
888
  for (let iteration = 0; iteration < (this.props.iterations ?? 16); iteration++) {
862
889
  dispatchPairs(computations[1]);
863
890
  dispatchBodies(computations[2]);
891
+ if (computations[4])
892
+ computations[4].kernel.dispatch(computePass, {
893
+ bindings: computations[4].bindings,
894
+ x: 1
895
+ });
864
896
  }
865
897
  },
866
898
  destroy: () => {
@@ -870,7 +902,9 @@ class GPURigidBodyWorld {
870
902
  });
871
903
  graph.addComputePass({
872
904
  id: `${this.id}-solve`,
873
- workload: { commandCount: 2 + 2 * (this.props.iterations ?? 16) },
905
+ workload: {
906
+ commandCount: (((_p = this.props.joints) == null ? void 0 : _p.length) ? 3 : 2) + (((_q = this.props.joints) == null ? void 0 : _q.length) ? 3 : 2) * (this.props.iterations ?? 16)
907
+ },
874
908
  description: passDescriptions["solve"],
875
909
  resources: [
876
910
  ...indirectResources,
@@ -1098,14 +1132,14 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
1098
1132
  }
1099
1133
  else if(command.bodyIndex.y==5u){let body=command.bodyIndex.x;if(dynamic(body)){angularVelocities[body]=vec4f(angularVelocities[body].xyz+inverseInertia(body,command.impulse.xyz),0);}}
1100
1134
  else if(command.bodyIndex.y==2u) {applyImpulse(command.bodyIndex.x,positions[command.bodyIndex.x].xyz,command.impulse.xyz);}
1101
- ${((_n = this.props.joints) == null ? void 0 : _n.length) ? "else if(command.bodyIndex.y==3u){targets.joints[command.bodyIndex.x].control.x=command.impulse.x;}" : ""}
1135
+ ${((_r = this.props.joints) == null ? void 0 : _r.length) ? "else if(command.bodyIndex.y==3u){targets.joints[command.bodyIndex.x].control.x=command.impulse.x;}" : ""}
1102
1136
  else {targets.entries[command.bodyIndex.x].position=vec4f(command.point.xyz,1);targets.entries[command.bodyIndex.x].orientation=command.orientation;}
1103
1137
  }
1104
1138
  @compute @workgroup_size(64) fn invalidate(@builtin(global_invocation_id) invocation:vec3u) {
1105
1139
  let index=invocation.x+invocation.y*4194240u;
1106
1140
  if(index<BODY_COUNT){sleepStates[index]=vec4f(0);}
1107
1141
  if(index<PAIR_CAPACITY){manifolds[index].count=0u;}
1108
- ${((_o = this.props.joints) == null ? void 0 : _o.length) ? `if(index<${this.props.joints.length}u){for(var row=0u;row<8u;row++){targets.joints[index].impulses[row]=0.0;}}` : ""}
1142
+ ${((_s = this.props.joints) == null ? void 0 : _s.length) ? `if(index<${this.props.joints.length}u){for(var row=0u;row<8u;row++){targets.joints[index].impulses[row]=0.0;}}` : ""}
1109
1143
  }`,
1110
1144
  entryPoint: "control",
1111
1145
  shaderLayout: {
@@ -1143,7 +1177,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
1143
1177
  const invalidationBindings = [
1144
1178
  "sleepStates",
1145
1179
  "manifolds",
1146
- ...((_p = this.props.joints) == null ? void 0 : _p.length) ? ["targets"] : []
1180
+ ...((_t = this.props.joints) == null ? void 0 : _t.length) ? ["targets"] : []
1147
1181
  ];
1148
1182
  this.invalidation = (0, import_bound_kernel.createBoundKernel)(graph.device, {
1149
1183
  ...controlProperties,
@@ -1381,7 +1415,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
1381
1415
  }
1382
1416
  /** Update motion properties between submissions; preserve the node pose when its COM changes. */
1383
1417
  setBodyParameters(bodyIndex, parameters) {
1384
- var _a, _b;
1418
+ var _a, _b, _c;
1385
1419
  if (!this.device || !this.control || !this.controlSettings || this.destroyed || !Number.isInteger(bodyIndex) || !this.props.bodies[bodyIndex])
1386
1420
  throw new Error("Invalid body mutation");
1387
1421
  const previous = this.props.bodies[bodyIndex];
@@ -1397,11 +1431,16 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
1397
1431
  next.gravityFactor ?? 1
1398
1432
  ].every((value) => Number.isFinite(Math.fround(value))) || (next.inertiaDiagonal ?? []).some((value) => !Number.isFinite(Math.fround(value)) || value < 0) || next.inertiaOrientation && !next.inertiaDiagonal)
1399
1433
  throw new Error("Invalid motion properties");
1434
+ if ((_a = this.props.joints) == null ? void 0 : _a.length) {
1435
+ const proposedBodies = [...this.props.bodies];
1436
+ proposedBodies[bodyIndex] = next;
1437
+ (0, import_rigid_body_joints.validateRigidBodyJoints)(this.props.joints, proposedBodies, this.solver);
1438
+ }
1400
1439
  const colliders = this.colliders.filter((collider) => collider.body === bodyIndex);
1401
1440
  for (const collider of colliders)
1402
1441
  if ((collider.shape.type === "convex-hull" || collider.shape.type === "triangle-mesh") && mode !== "static" && mass > 0 && (!collider.shape.geometry.closed || !((0, import_rigid_body_shape_properties.getRigidBodyShapeProperties)(collider.shape).volume > 0)))
1403
1442
  throw new Error("Dynamic meshes require closed positive-volume geometry");
1404
- if (((_a = this.props.continuous) == null ? void 0 : _a.bodies.includes(bodyIndex)) && (mode !== "dynamic" || mass === 0 || this.props.continuous.mode !== "convex" && (colliders[0].position ?? [0, 0, 0]).some((value, axis) => value !== center[axis])))
1443
+ if (((_b = this.props.continuous) == null ? void 0 : _b.bodies.includes(bodyIndex)) && (mode !== "dynamic" || mass === 0 || this.props.continuous.mode !== "convex" && (colliders[0].position ?? [0, 0, 0]).some((value, axis) => value !== center[axis])))
1405
1444
  throw new Error("Mutation exceeds the continuous body envelope");
1406
1445
  const compound = (0, import_rigid_body_properties.getCompoundBodyInertia)(mass, colliders, center);
1407
1446
  const inertia = next.inertiaDiagonal ?? compound.diagonal;
@@ -1422,7 +1461,7 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
1422
1461
  metadata.write(new Float32Array((collider.position ?? [0, 0, 0]).map((value, axis) => value - center[axis])), this.count * 48 + index * 96 + 16);
1423
1462
  attributes == null ? void 0 : attributes.write(new Uint32Array([bodyIndex | (mode === "dynamic" ? 65536 : 0)]), index * 4);
1424
1463
  }
1425
- (_b = this.ownedBuffers.find((buffer) => buffer.id === `${this.id}-pose-metadata`)) == null ? void 0 : _b.write(new Float32Array(center), bodyIndex * 48);
1464
+ (_c = this.ownedBuffers.find((buffer) => buffer.id === `${this.id}-pose-metadata`)) == null ? void 0 : _c.write(new Float32Array(center), bodyIndex * 48);
1426
1465
  const data = new ArrayBuffer(64);
1427
1466
  new Float32Array(data).set([
1428
1467
  ...center.map((value, axis) => value - oldCenter[axis]),
@@ -36,7 +36,7 @@ export type GPURigidBodyWorldProps = {
36
36
  publicationBounds?: readonly GPURigidBodyBounds[];
37
37
  /** Publish rigid body-node matrices without requiring authored visual bounds. */
38
38
  publishPoses?: boolean;
39
- /** Up to 64 ordered-solver joints with persistent impulses and connected-island sleeping. */
39
+ /** Up to 64 joints. Parallel solving supports static-anchored distance joints only. */
40
40
  joints?: readonly GPURigidBodyJoint[];
41
41
  gravity?: Vector3;
42
42
  timeStep?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"gpu-rigid-body-world.d.ts","sourceRoot":"","sources":["../../src/gpu-physics/gpu-rigid-body-world.ts"],"names":[],"mappings":"AAWA,OAAO,EACL,MAAM,EAMP,MAAM,eAAe,CAAC;AAEvB,OAAO,EACL,eAAe,EAEhB,yCAAsC;AAMvC,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,iBAAiB,EAEtB,KAAK,oBAAoB,EAC1B,mCAAgC;AACjC,YAAY,EACV,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,oBAAoB,EACrB,mCAAgC;AAEjC,OAAO,EAEL,oCAAoC,EACrC,oCAAiC;AAElC,OAAO,EAGL,KAAK,iCAAiC,EACvC,oCAAiC;AAClC,OAAO,EAA4B,KAAK,wBAAwB,EAAC,iCAA8B;AAE/F,OAAO,EAAyB,KAAK,6BAA6B,EAAC,mCAAgC;AACnG,OAAO,EAIL,KAAK,mBAAmB,EACxB,KAAK,wBAAwB,EAC9B,iCAA8B;AAI/B,OAAO,E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AAM,EAAE,MAAM,CAAC;QACf,cAAc,EAAE,MAAM,CAAC;QACvB,uBAAuB,EAAE,MAAM,CAAC;QAChC,OAAO,EAAE,MAAM,CAAC;QAChB,UAAU,EAAE,OAAO,CAAC;KACrB,GAAG,IAAI,CAAC;IAsBT,6FAA6F;IACvF,cAAc,IAAI,OAAO,CAAC;QAC9B,SAAS,EAAE,OAAO,CAAC;QACnB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;QAC9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;QAC3B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,cAAc,EAAE,MAAM,CAAC;KACxB,GAAG,IAAI,CAAC;IAgBT,mFAAmF;IAC7E,yBAAyB,IAAI,OAAO,CAAC,iCAAiC,CAAC;IAQ7E,2EAA2E;IACrE,wBAAwB,IAAI,OAAO,CAAC;QACxC,iBAAiB,EAAE,MAAM,CAAC;QAC1B,eAAe,EAAE,MAAM,CAAC;QACxB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,qBAAqB,EAAE,MAAM,CAAC;QAC9B,gBAAgB,EAAE,MAAM,CAAC;QACzB,sBAAsB,EAAE,MAAM,CAAC;QAC/B,UAAU,CAAC,EAAE,UAAU,CAAC,OAAO,oCAAoC,CAAC,CAAC;KACtE,CAAC;IA8BF,mFAAmF;IACnF,OAAO,IAAI,IAAI;CAYhB"}
@@ -737,6 +737,23 @@ export class GPURigidBodyWorld {
737
737
  parallelSleep: ['velocities', 'angularVelocities', 'bodies', 'sleepStates', 'parallelState']
738
738
  };
739
739
  parallelBindings['parallelSolve'] = parallelBindings['parallelPairs'];
740
+ if (this.props.joints?.length) {
741
+ const jointBindings = [
742
+ 'settings',
743
+ 'positions',
744
+ 'orientations',
745
+ 'velocities',
746
+ 'angularVelocities',
747
+ 'bodies',
748
+ 'sleepStates',
749
+ 'targets'
750
+ ];
751
+ parallelBindings['parallelJointWarm'] = jointBindings;
752
+ parallelBindings['parallelJointSolve'] = jointBindings;
753
+ parallelBindings['parallelSolve'] = [
754
+ ...new Set([...parallelBindings['parallelSolve'], ...jointBindings])
755
+ ];
756
+ }
740
757
  this.simulationStatistics = allocate('simulation-statistics', 64);
741
758
  const statisticsResource = graph.importBuffer({ id: `${this.id}-statistics`, byteLength: 64, usage: Buffer.STORAGE }, this.simulationStatistics);
742
759
  const checkpointStates = [
@@ -996,7 +1013,12 @@ export class GPURigidBodyWorld {
996
1013
  ? [{ buffer: dispatchBinding.resource, usage: 'indirect' }]
997
1014
  : [];
998
1015
  if (entryPoint === 'parallelSolve') {
999
- const stages = ['parallelWarm', 'parallelPairs', 'parallelGather'];
1016
+ const stages = [
1017
+ 'parallelWarm',
1018
+ 'parallelPairs',
1019
+ 'parallelGather',
1020
+ ...(this.props.joints?.length ? ['parallelJointWarm', 'parallelJointSolve'] : [])
1021
+ ];
1000
1022
  const properties = stages.map(stage => ({
1001
1023
  id: `${this.id}-${stage}`,
1002
1024
  source,
@@ -1041,9 +1063,19 @@ export class GPURigidBodyWorld {
1041
1063
  };
1042
1064
  dispatchPairs(computations[0]);
1043
1065
  dispatchBodies(computations[2]);
1066
+ if (computations[3])
1067
+ computations[3].kernel.dispatch(computePass, {
1068
+ bindings: computations[3].bindings,
1069
+ x: 1
1070
+ });
1044
1071
  for (let iteration = 0; iteration < (this.props.iterations ?? 16); iteration++) {
1045
1072
  dispatchPairs(computations[1]);
1046
1073
  dispatchBodies(computations[2]);
1074
+ if (computations[4])
1075
+ computations[4].kernel.dispatch(computePass, {
1076
+ bindings: computations[4].bindings,
1077
+ x: 1
1078
+ });
1047
1079
  }
1048
1080
  },
1049
1081
  destroy: () => {
@@ -1054,7 +1086,10 @@ export class GPURigidBodyWorld {
1054
1086
  // Iterations share one semantic graph node; dispatch boundaries synchronize pair and body owners.
1055
1087
  graph.addComputePass({
1056
1088
  id: `${this.id}-solve`,
1057
- workload: { commandCount: 2 + 2 * (this.props.iterations ?? 16) },
1089
+ workload: {
1090
+ commandCount: (this.props.joints?.length ? 3 : 2) +
1091
+ (this.props.joints?.length ? 3 : 2) * (this.props.iterations ?? 16)
1092
+ },
1058
1093
  description: passDescriptions['solve'],
1059
1094
  resources: [
1060
1095
  ...indirectResources,
@@ -1665,6 +1700,11 @@ struct Command { impulse: vec4f, point: vec4f, orientation: vec4f, bodyIndex: ve
1665
1700
  (next.inertiaDiagonal ?? []).some(value => !Number.isFinite(Math.fround(value)) || value < 0) ||
1666
1701
  (next.inertiaOrientation && !next.inertiaDiagonal))
1667
1702
  throw new Error('Invalid motion properties');
1703
+ if (this.props.joints?.length) {
1704
+ const proposedBodies = [...this.props.bodies];
1705
+ proposedBodies[bodyIndex] = next;
1706
+ validateRigidBodyJoints(this.props.joints, proposedBodies, this.solver);
1707
+ }
1668
1708
  const colliders = this.colliders.filter(collider => collider.body === bodyIndex);
1669
1709
  for (const collider of colliders)
1670
1710
  if ((collider.shape.type === 'convex-hull' || collider.shape.type === 'triangle-mesh') &&