@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/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({ id: "animation-loop", adapters: props == null ? void 0 : props.adapters, createCanvasContext: true });
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: (animationProps) => renderLoop == null ? void 0 : renderLoop.onRender(animationProps),
806
- onFinalize: (animationProps) => renderLoop == null ? void 0 : renderLoop.onFinalize(animationProps)
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 animationLoop;
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.pipeline = this._updatePipeline();
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
  /**