@antv/g-webgpu 1.6.1 → 1.6.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.umd.js CHANGED
@@ -11276,8 +11276,14 @@
11276
11276
  var segmentsLength = lineDash.reduce(function (cur, prev) {
11277
11277
  return cur + prev.value;
11278
11278
  }, 0);
11279
- dashSegmentPercent = segmentsLength / totalLength;
11280
- dashRatioInEachSegment = lineDash[1].value / segmentsLength;
11279
+
11280
+ if (segmentsLength === 0) {
11281
+ dashSegmentPercent = 1;
11282
+ dashRatioInEachSegment = 0;
11283
+ } else {
11284
+ dashSegmentPercent = segmentsLength / totalLength;
11285
+ dashRatioInEachSegment = lineDash[1].value / segmentsLength;
11286
+ }
11281
11287
  }
11282
11288
 
11283
11289
  return {
@@ -14533,7 +14539,7 @@
14533
14539
  var currentView = _extends({}, this.camera.getView());
14534
14540
 
14535
14541
  return new Promise(function (resolve) {
14536
- // prevent unsed RTs like main color being destroyed
14542
+ // prevent unused RTs like main color being destroyed
14537
14543
  _this3.renderHelper.renderGraph.renderTargetDeadPool.forEach(function (rt) {
14538
14544
  rt.age = -1;
14539
14545
  }); // picking pass
@@ -15604,7 +15610,7 @@
15604
15610
  var addTouchEventListener = function addTouchEventListener($el) {
15605
15611
  $el.addEventListener('touchstart', onPointerDown, true);
15606
15612
  $el.addEventListener('touchend', onPointerUp, true);
15607
- globalThis.document.addEventListener('touchmove', onPointerMove, true);
15613
+ $el.addEventListener('touchmove', onPointerMove, true);
15608
15614
  $el.addEventListener('touchcancel', onPointerCancel, true);
15609
15615
  };
15610
15616
 
@@ -15627,8 +15633,8 @@
15627
15633
  var removeTouchEventListener = function removeTouchEventListener($el) {
15628
15634
  $el.removeEventListener('touchstart', onPointerDown, true);
15629
15635
  $el.removeEventListener('touchend', onPointerUp, true);
15636
+ $el.removeEventListener('touchmove', onPointerMove, true);
15630
15637
  $el.removeEventListener('touchcancel', onPointerCancel, true);
15631
- globalThis.document.removeEventListener('touchmove', onPointerMove, true);
15632
15638
  };
15633
15639
 
15634
15640
  var removeMouseEventListener = function removeMouseEventListener($el) {
@@ -15681,7 +15687,17 @@
15681
15687
  }, _callee);
15682
15688
  })));
15683
15689
  renderingService.hooks.destroy.tap(DOMInteractionPlugin_1.tag, function () {
15684
- var $el = _this.contextService.getDomElement();
15690
+ var $el = _this.contextService.getDomElement(); // @ts-ignore
15691
+
15692
+
15693
+ if (globalThis.navigator.msPointerEnabled) {
15694
+ // @ts-ignore
15695
+ $el.style.msContentZooming = ''; // @ts-ignore
15696
+
15697
+ $el.style.msTouchAction = '';
15698
+ } else if (canvas.supportsPointerEvents) {
15699
+ $el.style.touchAction = '';
15700
+ }
15685
15701
 
15686
15702
  if (canvas.supportsPointerEvents) {
15687
15703
  removePointerEventListener($el);
@@ -17763,7 +17779,7 @@
17763
17779
  */
17764
17780
 
17765
17781
  _proto.dispatch = function dispatch(x, y, z) {
17766
- this.gpuComputePassEncoder.dispatch(x, y, z); // TODO: dispatchIndirect read from GPUBuffer
17782
+ this.gpuComputePassEncoder.dispatchWorkgroups(x, y, z); // TODO: dispatchIndirect read from GPUBuffer
17767
17783
  };
17768
17784
 
17769
17785
  _proto.finish = function finish() {
@@ -17822,7 +17838,7 @@
17822
17838
  if (computeStage === null) return _assertThisInitialized$1(_this);
17823
17839
  var gpuComputePipeline = {
17824
17840
  compute: _extends$1({}, computeStage),
17825
- layout: undefined
17841
+ layout: 'auto'
17826
17842
  }; // @see https://www.w3.org/TR/webgpu/#dom-gpudevice-createrenderpipeline
17827
17843
 
17828
17844
  _this.gpuComputePipeline = _this.device.device.createComputePipeline(gpuComputePipeline);