pixi-effects 0.42.0 → 0.43.0

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 (37) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +5 -5
  3. package/ai/chat-template.html +3 -3
  4. package/dist/{Base-Jgkud1Aw.d.ts → Base-DKFQtqzW.d.ts} +1 -1
  5. package/dist/{Base-DQWIJ6bJ.d.cts → Base-lb5Uhaqu.d.cts} +1 -1
  6. package/dist/Controller.d.cts +2 -2
  7. package/dist/Controller.d.ts +2 -2
  8. package/dist/{Movie-CBVFZ1kg.d.ts → Movie-B_qQIYV6.d.ts} +3 -1
  9. package/dist/{Movie-BHGhg-fJ.d.cts → Movie-BdUm2Mc9.d.cts} +3 -1
  10. package/dist/{chunk-NFJKBWYO.js → chunk-6N5ZBUOU.js} +21 -2
  11. package/dist/chunk-6N5ZBUOU.js.map +1 -0
  12. package/dist/{chunk-WVZLAIKK.cjs → chunk-BEGOKE7Q.cjs} +21 -2
  13. package/dist/chunk-BEGOKE7Q.cjs.map +1 -0
  14. package/dist/index.cjs +25 -25
  15. package/dist/index.d.cts +4 -4
  16. package/dist/index.d.ts +4 -4
  17. package/dist/index.js +1 -1
  18. package/dist/loader.css +1 -1
  19. package/dist/present.cjs +1 -1
  20. package/dist/present.d.cts +2 -2
  21. package/dist/present.d.ts +2 -2
  22. package/dist/present.js +1 -1
  23. package/dist/three.cjs +81 -23
  24. package/dist/three.cjs.map +1 -1
  25. package/dist/three.d.cts +17 -2
  26. package/dist/three.d.ts +17 -2
  27. package/dist/three.js +83 -25
  28. package/dist/three.js.map +1 -1
  29. package/dist/{types-DIh93lFb.d.cts → types-DiNHtdrS.d.cts} +19 -0
  30. package/dist/{types-DIh93lFb.d.ts → types-DiNHtdrS.d.ts} +19 -0
  31. package/docs/dsl.md +3 -2
  32. package/llms-full.txt +4 -3
  33. package/package.json +2 -1
  34. package/skills/pixi-effects/SKILL.md +1 -1
  35. package/skills/pixi-effects/template.html +6 -6
  36. package/dist/chunk-NFJKBWYO.js.map +0 -1
  37. package/dist/chunk-WVZLAIKK.cjs.map +0 -1
@@ -9,6 +9,21 @@ var chunkTWZNOUM7_cjs = require('./chunk-TWZNOUM7.cjs');
9
9
  var pixi_js = require('pixi.js');
10
10
  var mediabunny = require('mediabunny');
11
11
 
12
+ // src/core/gpuShare.ts
13
+ function sharedGpuOf(renderer) {
14
+ const r = renderer;
15
+ if (!r || r.name !== "webgpu" || !r.gpu?.device) return void 0;
16
+ const uid = r.uid;
17
+ return {
18
+ device: r.gpu.device,
19
+ adopt(source, texture) {
20
+ const data = source._gpuData;
21
+ if (!data || typeof data !== "object") throw new Error("this PixiJS keeps no _gpuData on its texture sources");
22
+ data[uid] = { textureView: null, textureViews: /* @__PURE__ */ Object.create(null), gpuTexture: texture, destroy() {
23
+ } };
24
+ }
25
+ };
26
+ }
12
27
  var registered = false;
13
28
  function ensureLoadersRegistered(audioContext) {
14
29
  if (registered) return;
@@ -1636,6 +1651,7 @@ function inspectScene(root, frame, time, canvas, opts = {}) {
1636
1651
  if (typeof drawn.renderer === "string") {
1637
1652
  info.renderer = drawn.renderer;
1638
1653
  if (typeof drawn.backend === "string") info.backend = drawn.backend;
1654
+ if (info.renderer === "webgpu") info.sharedGpu = drawn.sharedGpu === true;
1639
1655
  }
1640
1656
  layers.push(info);
1641
1657
  chainAlpha.set(info, parentAlpha * alpha);
@@ -2729,12 +2745,15 @@ var Movie = class {
2729
2745
  */
2730
2746
  async _construct(composition, vars, width, height, lp, sizeWins = this._resized) {
2731
2747
  const spec = applyVars(composition, vars);
2748
+ const gpu = sharedGpuOf(this.app?.renderer);
2749
+ const gpuField = gpu ? { gpu } : {};
2732
2750
  const rootShape = {
2733
2751
  width,
2734
2752
  height,
2735
2753
  duration: this.duration,
2736
2754
  frameRate: this.frameRate,
2737
2755
  vars: numericVars(vars),
2756
+ ...gpuField,
2738
2757
  ...lp ? { onLayerBuilt: async () => {
2739
2758
  lp.tick();
2740
2759
  await lp.yieldIfDue();
@@ -4749,5 +4768,5 @@ exports.splitText = splitText;
4749
4768
  exports.stagger = stagger;
4750
4769
  exports.wiggle = wiggle;
4751
4770
  exports.withFade = withFade;
4752
- //# sourceMappingURL=chunk-WVZLAIKK.cjs.map
4753
- //# sourceMappingURL=chunk-WVZLAIKK.cjs.map
4771
+ //# sourceMappingURL=chunk-BEGOKE7Q.cjs.map
4772
+ //# sourceMappingURL=chunk-BEGOKE7Q.cjs.map