@luma.gl/engine 9.4.0-alpha.3 → 9.4.0-alpha.4
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.
- package/dist/animation-loop/make-animation-loop.d.ts +9 -1
- package/dist/animation-loop/make-animation-loop.d.ts.map +1 -1
- package/dist/animation-loop/make-animation-loop.js +20 -4
- package/dist/animation-loop/make-animation-loop.js.map +1 -1
- package/dist/compute/computation.d.ts +3 -0
- package/dist/compute/computation.d.ts.map +1 -1
- package/dist/compute/computation.js +23 -9
- package/dist/compute/computation.js.map +1 -1
- package/dist/dist.dev.js +36 -8
- package/dist/dist.min.js +5 -5
- package/dist/index.cjs +37 -8
- package/dist/index.cjs.map +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/animation-loop/make-animation-loop.ts +32 -5
- package/src/compute/computation.ts +25 -12
- package/src/index.ts +1 -0
package/dist/index.cjs
CHANGED
|
@@ -785,7 +785,11 @@ __publicField(AnimationLoop, "defaultAnimationLoopProps", {
|
|
|
785
785
|
var import_core3 = require("@luma.gl/core");
|
|
786
786
|
function makeAnimationLoop(AnimationLoopTemplateCtor, props) {
|
|
787
787
|
let renderLoop = null;
|
|
788
|
-
const device = (props == null ? void 0 : props.device) || import_core3.luma.createDevice({
|
|
788
|
+
const device = (props == null ? void 0 : props.device) || import_core3.luma.createDevice({
|
|
789
|
+
id: "animation-loop",
|
|
790
|
+
adapters: props == null ? void 0 : props.adapters,
|
|
791
|
+
createCanvasContext: true
|
|
792
|
+
});
|
|
789
793
|
const animationLoop = new AnimationLoop({
|
|
790
794
|
...props,
|
|
791
795
|
device,
|
|
@@ -802,13 +806,25 @@ function makeAnimationLoop(AnimationLoopTemplateCtor, props) {
|
|
|
802
806
|
return null;
|
|
803
807
|
}
|
|
804
808
|
},
|
|
805
|
-
onRender
|
|
806
|
-
|
|
809
|
+
onRender(animationProps) {
|
|
810
|
+
var _a;
|
|
811
|
+
renderLoop == null ? void 0 : renderLoop.onRender(animationProps);
|
|
812
|
+
(_a = props == null ? void 0 : props.onAfterRender) == null ? void 0 : _a.call(props, animationProps, renderLoop);
|
|
813
|
+
},
|
|
814
|
+
onFinalize(animationProps) {
|
|
815
|
+
try {
|
|
816
|
+
renderLoop == null ? void 0 : renderLoop.onFinalize(animationProps);
|
|
817
|
+
} finally {
|
|
818
|
+
renderLoop = null;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
807
821
|
});
|
|
822
|
+
const templateAnimationLoop = animationLoop;
|
|
823
|
+
templateAnimationLoop.getAnimationLoopTemplate = () => renderLoop;
|
|
808
824
|
animationLoop.getInfo = () => {
|
|
809
825
|
return this.AnimationLoopTemplateCtor.info;
|
|
810
826
|
};
|
|
811
|
-
return
|
|
827
|
+
return templateAnimationLoop;
|
|
812
828
|
}
|
|
813
829
|
function setError(device, error) {
|
|
814
830
|
var _a;
|
|
@@ -7373,15 +7389,28 @@ var _Computation = class {
|
|
|
7373
7389
|
dispatch(computePass, x, y, z) {
|
|
7374
7390
|
try {
|
|
7375
7391
|
this._logDrawCallStart();
|
|
7376
|
-
this.
|
|
7377
|
-
this.pipeline.setBindings(this.bindings);
|
|
7378
|
-
computePass.setPipeline(this.pipeline);
|
|
7379
|
-
computePass.setBindings({});
|
|
7392
|
+
this._setPipeline(computePass);
|
|
7380
7393
|
computePass.dispatch(x, y, z);
|
|
7381
7394
|
} finally {
|
|
7382
7395
|
this._logDrawCallEnd();
|
|
7383
7396
|
}
|
|
7384
7397
|
}
|
|
7398
|
+
/** Dispatches a GPU-written workgroup count from an indirect buffer. */
|
|
7399
|
+
dispatchIndirect(computePass, indirectBuffer, indirectOffset = 0) {
|
|
7400
|
+
try {
|
|
7401
|
+
this._logDrawCallStart();
|
|
7402
|
+
this._setPipeline(computePass);
|
|
7403
|
+
computePass.dispatchIndirect(indirectBuffer, indirectOffset);
|
|
7404
|
+
} finally {
|
|
7405
|
+
this._logDrawCallEnd();
|
|
7406
|
+
}
|
|
7407
|
+
}
|
|
7408
|
+
_setPipeline(computePass) {
|
|
7409
|
+
this.pipeline = this._updatePipeline();
|
|
7410
|
+
this.pipeline.setBindings(this.bindings);
|
|
7411
|
+
computePass.setPipeline(this.pipeline);
|
|
7412
|
+
computePass.setBindings({});
|
|
7413
|
+
}
|
|
7385
7414
|
// Update fixed fields (can trigger pipeline rebuild)
|
|
7386
7415
|
// Update dynamic fields
|
|
7387
7416
|
/**
|