@antv/g-webgpu 1.6.0 → 1.6.3
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 +26 -16
- package/dist/index.umd.min.js +3 -3
- package/package.json +7 -7
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
|
-
|
|
11280
|
-
|
|
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 {
|
|
@@ -13132,14 +13138,13 @@
|
|
|
13132
13138
|
}
|
|
13133
13139
|
|
|
13134
13140
|
var instance = this.instance;
|
|
13135
|
-
var instancedAttributes = ['fontFamily', 'fontWeight', 'textBaseline', 'letterSpacing']; // fontStack & fontSize should be same
|
|
13136
|
-
|
|
13137
|
-
|
|
13138
|
-
|
|
13139
|
-
}
|
|
13141
|
+
var instancedAttributes = ['fontSize', 'fontFamily', 'fontWeight', 'textBaseline', 'letterSpacing']; // fontStack & fontSize should be same
|
|
13142
|
+
// if (instance.parsedStyle.fontSize.value !== object.parsedStyle.fontSize.value) {
|
|
13143
|
+
// return false;
|
|
13144
|
+
// }
|
|
13140
13145
|
|
|
13141
13146
|
if (instance.parsedStyle.metrics.font !== object.parsedStyle.metrics.font || instancedAttributes.some(function (name) {
|
|
13142
|
-
return instance.parsedStyle[name] !== object.parsedStyle[name];
|
|
13147
|
+
return instance.parsedStyle[name].value !== object.parsedStyle[name].value;
|
|
13143
13148
|
})) {
|
|
13144
13149
|
return false;
|
|
13145
13150
|
}
|
|
@@ -13154,8 +13159,7 @@
|
|
|
13154
13159
|
var _object$parsedStyle = object.parsedStyle,
|
|
13155
13160
|
textBaseline = _object$parsedStyle.textBaseline,
|
|
13156
13161
|
fontSize = _object$parsedStyle.fontSize,
|
|
13157
|
-
|
|
13158
|
-
letterSpacing = _object$parsedStyle$l === void 0 ? 0 : _object$parsedStyle$l; // scale current font size to base(24)
|
|
13162
|
+
letterSpacing = _object$parsedStyle.letterSpacing; // scale current font size to base(24)
|
|
13159
13163
|
|
|
13160
13164
|
var fontScale = BASE_FONT_WIDTH / fontSize.value;
|
|
13161
13165
|
var indices = [];
|
|
@@ -13206,7 +13210,7 @@
|
|
|
13206
13210
|
lineHeight: fontScale * lineHeight,
|
|
13207
13211
|
offsetX: fontScale * offsetX,
|
|
13208
13212
|
offsetY: fontScale * (linePositionY + offsetY),
|
|
13209
|
-
letterSpacing: fontScale * letterSpacing,
|
|
13213
|
+
letterSpacing: fontScale * letterSpacing.value,
|
|
13210
13214
|
glyphAtlas: glyphAtlas,
|
|
13211
13215
|
indicesOffset: indicesOff
|
|
13212
13216
|
}),
|
|
@@ -14128,6 +14132,9 @@
|
|
|
14128
14132
|
*/
|
|
14129
14133
|
|
|
14130
14134
|
renderingService.hooks.beginFrame.tap(RenderGraphPlugin_1.tag, function () {
|
|
14135
|
+
// if (this.renderingContext.renderListCurrentFrame.length === 0) {
|
|
14136
|
+
// return;
|
|
14137
|
+
// }
|
|
14131
14138
|
var canvas = _this.swapChain.getCanvas();
|
|
14132
14139
|
|
|
14133
14140
|
var renderInstManager = _this.renderHelper.renderInstManager;
|
|
@@ -14169,6 +14176,9 @@
|
|
|
14169
14176
|
_this.builder.resolveRenderTargetToExternalTexture(mainColorTargetID, _this.swapChain.getOnscreenTexture());
|
|
14170
14177
|
});
|
|
14171
14178
|
renderingService.hooks.endFrame.tap(RenderGraphPlugin_1.tag, function () {
|
|
14179
|
+
// if (this.renderingContext.renderListCurrentFrame.length === 0) {
|
|
14180
|
+
// return;
|
|
14181
|
+
// }
|
|
14172
14182
|
var renderInstManager = _this.renderHelper.renderInstManager; // TODO: time for GPU Animation
|
|
14173
14183
|
// const timeInMilliseconds = window.performance.now();
|
|
14174
14184
|
// Push our outer template, which contains the dynamic UBO bindings...
|
|
@@ -14529,7 +14539,7 @@
|
|
|
14529
14539
|
var currentView = _extends({}, this.camera.getView());
|
|
14530
14540
|
|
|
14531
14541
|
return new Promise(function (resolve) {
|
|
14532
|
-
// prevent
|
|
14542
|
+
// prevent unused RTs like main color being destroyed
|
|
14533
14543
|
_this3.renderHelper.renderGraph.renderTargetDeadPool.forEach(function (rt) {
|
|
14534
14544
|
rt.age = -1;
|
|
14535
14545
|
}); // picking pass
|
|
@@ -15600,7 +15610,7 @@
|
|
|
15600
15610
|
var addTouchEventListener = function addTouchEventListener($el) {
|
|
15601
15611
|
$el.addEventListener('touchstart', onPointerDown, true);
|
|
15602
15612
|
$el.addEventListener('touchend', onPointerUp, true);
|
|
15603
|
-
|
|
15613
|
+
$el.addEventListener('touchmove', onPointerMove, true);
|
|
15604
15614
|
$el.addEventListener('touchcancel', onPointerCancel, true);
|
|
15605
15615
|
};
|
|
15606
15616
|
|
|
@@ -15623,8 +15633,8 @@
|
|
|
15623
15633
|
var removeTouchEventListener = function removeTouchEventListener($el) {
|
|
15624
15634
|
$el.removeEventListener('touchstart', onPointerDown, true);
|
|
15625
15635
|
$el.removeEventListener('touchend', onPointerUp, true);
|
|
15636
|
+
$el.removeEventListener('touchmove', onPointerMove, true);
|
|
15626
15637
|
$el.removeEventListener('touchcancel', onPointerCancel, true);
|
|
15627
|
-
globalThis.document.removeEventListener('touchmove', onPointerMove, true);
|
|
15628
15638
|
};
|
|
15629
15639
|
|
|
15630
15640
|
var removeMouseEventListener = function removeMouseEventListener($el) {
|
|
@@ -17759,7 +17769,7 @@
|
|
|
17759
17769
|
*/
|
|
17760
17770
|
|
|
17761
17771
|
_proto.dispatch = function dispatch(x, y, z) {
|
|
17762
|
-
this.gpuComputePassEncoder.
|
|
17772
|
+
this.gpuComputePassEncoder.dispatchWorkgroups(x, y, z); // TODO: dispatchIndirect read from GPUBuffer
|
|
17763
17773
|
};
|
|
17764
17774
|
|
|
17765
17775
|
_proto.finish = function finish() {
|
|
@@ -17818,7 +17828,7 @@
|
|
|
17818
17828
|
if (computeStage === null) return _assertThisInitialized$1(_this);
|
|
17819
17829
|
var gpuComputePipeline = {
|
|
17820
17830
|
compute: _extends$1({}, computeStage),
|
|
17821
|
-
layout:
|
|
17831
|
+
layout: 'auto'
|
|
17822
17832
|
}; // @see https://www.w3.org/TR/webgpu/#dom-gpudevice-createrenderpipeline
|
|
17823
17833
|
|
|
17824
17834
|
_this.gpuComputePipeline = _this.device.device.createComputePipeline(gpuComputePipeline);
|