@antv/g-webgpu 1.5.3 → 1.6.1
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/ContextRegisterPlugin.d.ts +4 -4
- package/dist/ContextRegisterPlugin.d.ts.map +1 -1
- package/dist/index.esm.js +18 -12
- package/dist/index.js +17 -11
- package/dist/index.umd.js +450 -352
- package/dist/index.umd.min.js +6 -6
- package/package.json +7 -7
package/dist/index.umd.js
CHANGED
|
@@ -1534,169 +1534,6 @@
|
|
|
1534
1534
|
}
|
|
1535
1535
|
});
|
|
1536
1536
|
|
|
1537
|
-
var ImagePool = /*#__PURE__*/function () {
|
|
1538
|
-
function ImagePool() {
|
|
1539
|
-
this.imageCache = {};
|
|
1540
|
-
this.gradientCache = {};
|
|
1541
|
-
this.patternCache = {};
|
|
1542
|
-
this.canvasConfig = void 0;
|
|
1543
|
-
}
|
|
1544
|
-
|
|
1545
|
-
var _proto = ImagePool.prototype;
|
|
1546
|
-
|
|
1547
|
-
_proto.getImageSync = function getImageSync(src, callback) {
|
|
1548
|
-
if (!this.imageCache[src]) {
|
|
1549
|
-
this.getOrCreateImage(src).then(function () {
|
|
1550
|
-
if (callback) {
|
|
1551
|
-
callback();
|
|
1552
|
-
}
|
|
1553
|
-
});
|
|
1554
|
-
}
|
|
1555
|
-
|
|
1556
|
-
return this.imageCache[src];
|
|
1557
|
-
};
|
|
1558
|
-
|
|
1559
|
-
_proto.getOrCreateImage = function getOrCreateImage(src) {
|
|
1560
|
-
var _this = this;
|
|
1561
|
-
|
|
1562
|
-
if (this.imageCache[src]) {
|
|
1563
|
-
return Promise.resolve(this.imageCache[src]);
|
|
1564
|
-
} // @see https://github.com/antvis/g/issues/938
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
var createImage = this.canvasConfig.createImage;
|
|
1568
|
-
return new Promise(function (resolve, reject) {
|
|
1569
|
-
var image;
|
|
1570
|
-
|
|
1571
|
-
if (createImage) {
|
|
1572
|
-
image = createImage(src);
|
|
1573
|
-
} else if (g.isBrowser) {
|
|
1574
|
-
image = new window.Image();
|
|
1575
|
-
}
|
|
1576
|
-
|
|
1577
|
-
if (image) {
|
|
1578
|
-
image.onload = function () {
|
|
1579
|
-
resolve(image);
|
|
1580
|
-
};
|
|
1581
|
-
|
|
1582
|
-
image.onerror = function (ev) {
|
|
1583
|
-
reject(ev);
|
|
1584
|
-
};
|
|
1585
|
-
|
|
1586
|
-
image.crossOrigin = 'Anonymous';
|
|
1587
|
-
image.src = src;
|
|
1588
|
-
_this.imageCache[src] = image;
|
|
1589
|
-
}
|
|
1590
|
-
});
|
|
1591
|
-
};
|
|
1592
|
-
|
|
1593
|
-
_proto.getOrCreatePatternSync = function getOrCreatePatternSync(pattern, context, callback) {
|
|
1594
|
-
var patternKey = this.generatePatternKey(pattern);
|
|
1595
|
-
|
|
1596
|
-
if (patternKey && this.patternCache[patternKey]) {
|
|
1597
|
-
return this.patternCache[patternKey];
|
|
1598
|
-
}
|
|
1599
|
-
|
|
1600
|
-
var image = pattern.image,
|
|
1601
|
-
repetition = pattern.repetition;
|
|
1602
|
-
var src; // Image URL
|
|
1603
|
-
|
|
1604
|
-
if (g.isString(image)) {
|
|
1605
|
-
src = this.getImageSync(image, callback);
|
|
1606
|
-
} else {
|
|
1607
|
-
src = image;
|
|
1608
|
-
} // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createPattern
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
var canvasPattern = src && context.createPattern(src, repetition);
|
|
1612
|
-
|
|
1613
|
-
if (patternKey && canvasPattern) {
|
|
1614
|
-
this.patternCache[patternKey] = canvasPattern;
|
|
1615
|
-
}
|
|
1616
|
-
|
|
1617
|
-
return canvasPattern;
|
|
1618
|
-
};
|
|
1619
|
-
|
|
1620
|
-
_proto.getOrCreateGradient = function getOrCreateGradient(params, context) {
|
|
1621
|
-
var key = this.generateGradientKey(params); // @ts-ignore
|
|
1622
|
-
|
|
1623
|
-
var type = params.type,
|
|
1624
|
-
steps = params.steps,
|
|
1625
|
-
width = params.width,
|
|
1626
|
-
height = params.height,
|
|
1627
|
-
angle = params.angle,
|
|
1628
|
-
cx = params.cx,
|
|
1629
|
-
cy = params.cy;
|
|
1630
|
-
|
|
1631
|
-
if (this.gradientCache[key]) {
|
|
1632
|
-
return this.gradientCache[key];
|
|
1633
|
-
}
|
|
1634
|
-
|
|
1635
|
-
var gradient = null;
|
|
1636
|
-
|
|
1637
|
-
if (type === g.GradientType.LinearGradient) {
|
|
1638
|
-
var _computeLinearGradien = g.computeLinearGradient(width, height, angle),
|
|
1639
|
-
x1 = _computeLinearGradien.x1,
|
|
1640
|
-
y1 = _computeLinearGradien.y1,
|
|
1641
|
-
x2 = _computeLinearGradien.x2,
|
|
1642
|
-
y2 = _computeLinearGradien.y2; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createLinearGradient
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
gradient = context.createLinearGradient(x1, y1, x2, y2);
|
|
1646
|
-
} else if (type === g.GradientType.RadialGradient) {
|
|
1647
|
-
var _computeRadialGradien = g.computeRadialGradient(width, height, cx, cy),
|
|
1648
|
-
x = _computeRadialGradien.x,
|
|
1649
|
-
y = _computeRadialGradien.y,
|
|
1650
|
-
r = _computeRadialGradien.r; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createRadialGradient
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
gradient = context.createRadialGradient(x, y, 0, x, y, r);
|
|
1654
|
-
}
|
|
1655
|
-
|
|
1656
|
-
if (gradient) {
|
|
1657
|
-
steps.forEach(function (_ref) {
|
|
1658
|
-
var _gradient;
|
|
1659
|
-
|
|
1660
|
-
var offset = _ref[0],
|
|
1661
|
-
color = _ref[1];
|
|
1662
|
-
(_gradient = gradient) === null || _gradient === void 0 ? void 0 : _gradient.addColorStop(offset, color);
|
|
1663
|
-
});
|
|
1664
|
-
this.gradientCache[key] = gradient;
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
|
-
return this.gradientCache[key];
|
|
1668
|
-
};
|
|
1669
|
-
|
|
1670
|
-
_proto.generateGradientKey = function generateGradientKey(params) {
|
|
1671
|
-
// @ts-ignore
|
|
1672
|
-
var type = params.type,
|
|
1673
|
-
width = params.width,
|
|
1674
|
-
height = params.height,
|
|
1675
|
-
steps = params.steps,
|
|
1676
|
-
angle = params.angle,
|
|
1677
|
-
cx = params.cx,
|
|
1678
|
-
cy = params.cy;
|
|
1679
|
-
return "gradient-" + type + "-" + (angle || 0) + "-" + (cx || 0) + "-" + (cy || 0) + "-" + width + "-" + height + "-" + steps.map(function (step) {
|
|
1680
|
-
return step.join('');
|
|
1681
|
-
}).join('-');
|
|
1682
|
-
};
|
|
1683
|
-
|
|
1684
|
-
_proto.generatePatternKey = function generatePatternKey(pattern) {
|
|
1685
|
-
var image = pattern.image,
|
|
1686
|
-
repetition = pattern.repetition; // only generate cache for Image
|
|
1687
|
-
|
|
1688
|
-
if (g.isString(image)) {
|
|
1689
|
-
return "pattern-" + image + "-" + repetition;
|
|
1690
|
-
}
|
|
1691
|
-
};
|
|
1692
|
-
|
|
1693
|
-
return ImagePool;
|
|
1694
|
-
}();
|
|
1695
|
-
|
|
1696
|
-
__decorate([g.inject(g.CanvasConfig), __metadata("design:type", Object)], ImagePool.prototype, "canvasConfig", void 0);
|
|
1697
|
-
|
|
1698
|
-
ImagePool = __decorate([g.singleton()], ImagePool);
|
|
1699
|
-
|
|
1700
1537
|
function _regeneratorRuntime$1() {
|
|
1701
1538
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
1702
1539
|
_regeneratorRuntime$1 = function _regeneratorRuntime() {
|
|
@@ -2070,18 +1907,196 @@
|
|
|
2070
1907
|
return new Promise(function (resolve, reject) {
|
|
2071
1908
|
var gen = fn.apply(self, args);
|
|
2072
1909
|
|
|
2073
|
-
function _next(value) {
|
|
2074
|
-
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
|
|
2075
|
-
}
|
|
1910
|
+
function _next(value) {
|
|
1911
|
+
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "next", value);
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
function _throw(err) {
|
|
1915
|
+
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
_next(undefined);
|
|
1919
|
+
});
|
|
1920
|
+
};
|
|
1921
|
+
}
|
|
1922
|
+
|
|
1923
|
+
function _inheritsLoose$1(subClass, superClass) {
|
|
1924
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
1925
|
+
subClass.prototype.constructor = subClass;
|
|
1926
|
+
|
|
1927
|
+
_setPrototypeOf$1(subClass, superClass);
|
|
1928
|
+
}
|
|
1929
|
+
|
|
1930
|
+
function _setPrototypeOf$1(o, p) {
|
|
1931
|
+
_setPrototypeOf$1 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
1932
|
+
o.__proto__ = p;
|
|
1933
|
+
return o;
|
|
1934
|
+
};
|
|
1935
|
+
return _setPrototypeOf$1(o, p);
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
var ImagePool = /*#__PURE__*/function () {
|
|
1939
|
+
function ImagePool() {
|
|
1940
|
+
this.imageCache = {};
|
|
1941
|
+
this.gradientCache = {};
|
|
1942
|
+
this.patternCache = {};
|
|
1943
|
+
this.canvasConfig = void 0;
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
var _proto = ImagePool.prototype;
|
|
1947
|
+
|
|
1948
|
+
_proto.getImageSync = function getImageSync(src, callback) {
|
|
1949
|
+
if (!this.imageCache[src]) {
|
|
1950
|
+
this.getOrCreateImage(src).then(function () {
|
|
1951
|
+
if (callback) {
|
|
1952
|
+
callback();
|
|
1953
|
+
}
|
|
1954
|
+
});
|
|
1955
|
+
}
|
|
1956
|
+
|
|
1957
|
+
return this.imageCache[src];
|
|
1958
|
+
};
|
|
1959
|
+
|
|
1960
|
+
_proto.getOrCreateImage = function getOrCreateImage(src) {
|
|
1961
|
+
var _this = this;
|
|
1962
|
+
|
|
1963
|
+
if (this.imageCache[src]) {
|
|
1964
|
+
return Promise.resolve(this.imageCache[src]);
|
|
1965
|
+
} // @see https://github.com/antvis/g/issues/938
|
|
1966
|
+
|
|
1967
|
+
|
|
1968
|
+
var createImage = this.canvasConfig.createImage;
|
|
1969
|
+
return new Promise(function (resolve, reject) {
|
|
1970
|
+
var image;
|
|
1971
|
+
|
|
1972
|
+
if (createImage) {
|
|
1973
|
+
image = createImage(src);
|
|
1974
|
+
} else if (g.isBrowser) {
|
|
1975
|
+
image = new window.Image();
|
|
1976
|
+
}
|
|
1977
|
+
|
|
1978
|
+
if (image) {
|
|
1979
|
+
image.onload = function () {
|
|
1980
|
+
resolve(image);
|
|
1981
|
+
};
|
|
1982
|
+
|
|
1983
|
+
image.onerror = function (ev) {
|
|
1984
|
+
reject(ev);
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1987
|
+
image.crossOrigin = 'Anonymous';
|
|
1988
|
+
image.src = src;
|
|
1989
|
+
_this.imageCache[src] = image;
|
|
1990
|
+
}
|
|
1991
|
+
});
|
|
1992
|
+
};
|
|
1993
|
+
|
|
1994
|
+
_proto.getOrCreatePatternSync = function getOrCreatePatternSync(pattern, context, callback) {
|
|
1995
|
+
var patternKey = this.generatePatternKey(pattern);
|
|
1996
|
+
|
|
1997
|
+
if (patternKey && this.patternCache[patternKey]) {
|
|
1998
|
+
return this.patternCache[patternKey];
|
|
1999
|
+
}
|
|
2000
|
+
|
|
2001
|
+
var image = pattern.image,
|
|
2002
|
+
repetition = pattern.repetition;
|
|
2003
|
+
var src; // Image URL
|
|
2004
|
+
|
|
2005
|
+
if (g.isString(image)) {
|
|
2006
|
+
src = this.getImageSync(image, callback);
|
|
2007
|
+
} else {
|
|
2008
|
+
src = image;
|
|
2009
|
+
} // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createPattern
|
|
2010
|
+
|
|
2011
|
+
|
|
2012
|
+
var canvasPattern = src && context.createPattern(src, repetition);
|
|
2013
|
+
|
|
2014
|
+
if (patternKey && canvasPattern) {
|
|
2015
|
+
this.patternCache[patternKey] = canvasPattern;
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
return canvasPattern;
|
|
2019
|
+
};
|
|
2020
|
+
|
|
2021
|
+
_proto.getOrCreateGradient = function getOrCreateGradient(params, context) {
|
|
2022
|
+
var key = this.generateGradientKey(params); // @ts-ignore
|
|
2023
|
+
|
|
2024
|
+
var type = params.type,
|
|
2025
|
+
steps = params.steps,
|
|
2026
|
+
width = params.width,
|
|
2027
|
+
height = params.height,
|
|
2028
|
+
angle = params.angle,
|
|
2029
|
+
cx = params.cx,
|
|
2030
|
+
cy = params.cy;
|
|
2031
|
+
|
|
2032
|
+
if (this.gradientCache[key]) {
|
|
2033
|
+
return this.gradientCache[key];
|
|
2034
|
+
}
|
|
2035
|
+
|
|
2036
|
+
var gradient = null;
|
|
2037
|
+
|
|
2038
|
+
if (type === g.GradientType.LinearGradient) {
|
|
2039
|
+
var _computeLinearGradien = g.computeLinearGradient(width, height, angle),
|
|
2040
|
+
x1 = _computeLinearGradien.x1,
|
|
2041
|
+
y1 = _computeLinearGradien.y1,
|
|
2042
|
+
x2 = _computeLinearGradien.x2,
|
|
2043
|
+
y2 = _computeLinearGradien.y2; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createLinearGradient
|
|
2044
|
+
|
|
2045
|
+
|
|
2046
|
+
gradient = context.createLinearGradient(x1, y1, x2, y2);
|
|
2047
|
+
} else if (type === g.GradientType.RadialGradient) {
|
|
2048
|
+
var _computeRadialGradien = g.computeRadialGradient(width, height, cx, cy),
|
|
2049
|
+
x = _computeRadialGradien.x,
|
|
2050
|
+
y = _computeRadialGradien.y,
|
|
2051
|
+
r = _computeRadialGradien.r; // @see https://developer.mozilla.org/zh-CN/docs/Web/API/CanvasRenderingContext2D/createRadialGradient
|
|
2052
|
+
|
|
2053
|
+
|
|
2054
|
+
gradient = context.createRadialGradient(x, y, 0, x, y, r);
|
|
2055
|
+
}
|
|
2056
|
+
|
|
2057
|
+
if (gradient) {
|
|
2058
|
+
steps.forEach(function (_ref) {
|
|
2059
|
+
var _gradient;
|
|
2060
|
+
|
|
2061
|
+
var offset = _ref[0],
|
|
2062
|
+
color = _ref[1];
|
|
2063
|
+
(_gradient = gradient) === null || _gradient === void 0 ? void 0 : _gradient.addColorStop(offset, color);
|
|
2064
|
+
});
|
|
2065
|
+
this.gradientCache[key] = gradient;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
return this.gradientCache[key];
|
|
2069
|
+
};
|
|
2070
|
+
|
|
2071
|
+
_proto.generateGradientKey = function generateGradientKey(params) {
|
|
2072
|
+
// @ts-ignore
|
|
2073
|
+
var type = params.type,
|
|
2074
|
+
width = params.width,
|
|
2075
|
+
height = params.height,
|
|
2076
|
+
steps = params.steps,
|
|
2077
|
+
angle = params.angle,
|
|
2078
|
+
cx = params.cx,
|
|
2079
|
+
cy = params.cy;
|
|
2080
|
+
return "gradient-" + type + "-" + (angle || 0) + "-" + (cx || 0) + "-" + (cy || 0) + "-" + width + "-" + height + "-" + steps.map(function (step) {
|
|
2081
|
+
return step.join('');
|
|
2082
|
+
}).join('-');
|
|
2083
|
+
};
|
|
2084
|
+
|
|
2085
|
+
_proto.generatePatternKey = function generatePatternKey(pattern) {
|
|
2086
|
+
var image = pattern.image,
|
|
2087
|
+
repetition = pattern.repetition; // only generate cache for Image
|
|
2088
|
+
|
|
2089
|
+
if (g.isString(image)) {
|
|
2090
|
+
return "pattern-" + image + "-" + repetition;
|
|
2091
|
+
}
|
|
2092
|
+
};
|
|
2093
|
+
|
|
2094
|
+
return ImagePool;
|
|
2095
|
+
}();
|
|
2076
2096
|
|
|
2077
|
-
|
|
2078
|
-
asyncGeneratorStep$1(gen, resolve, reject, _next, _throw, "throw", err);
|
|
2079
|
-
}
|
|
2097
|
+
__decorate([g.inject(g.CanvasConfig), __metadata("design:type", Object)], ImagePool.prototype, "canvasConfig", void 0);
|
|
2080
2098
|
|
|
2081
|
-
|
|
2082
|
-
});
|
|
2083
|
-
};
|
|
2084
|
-
}
|
|
2099
|
+
ImagePool = __decorate([g.singleton()], ImagePool);
|
|
2085
2100
|
|
|
2086
2101
|
var _class;
|
|
2087
2102
|
|
|
@@ -2171,23 +2186,33 @@
|
|
|
2171
2186
|
register(LoadImagePlugin);
|
|
2172
2187
|
});
|
|
2173
2188
|
|
|
2174
|
-
var Plugin = /*#__PURE__*/function () {
|
|
2189
|
+
var Plugin = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
2190
|
+
_inheritsLoose$1(Plugin, _AbstractRendererPlug);
|
|
2191
|
+
|
|
2175
2192
|
function Plugin() {
|
|
2176
|
-
|
|
2193
|
+
var _this;
|
|
2194
|
+
|
|
2195
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
2196
|
+
args[_key] = arguments[_key];
|
|
2197
|
+
}
|
|
2198
|
+
|
|
2199
|
+
_this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
|
|
2200
|
+
_this.name = 'image-loader';
|
|
2201
|
+
return _this;
|
|
2177
2202
|
}
|
|
2178
2203
|
|
|
2179
2204
|
var _proto = Plugin.prototype;
|
|
2180
2205
|
|
|
2181
|
-
_proto.init = function init(
|
|
2182
|
-
container.load(containerModule, true);
|
|
2206
|
+
_proto.init = function init() {
|
|
2207
|
+
this.container.load(containerModule, true);
|
|
2183
2208
|
};
|
|
2184
2209
|
|
|
2185
|
-
_proto.destroy = function destroy(
|
|
2186
|
-
container.unload(containerModule);
|
|
2210
|
+
_proto.destroy = function destroy() {
|
|
2211
|
+
this.container.unload(containerModule);
|
|
2187
2212
|
};
|
|
2188
2213
|
|
|
2189
2214
|
return Plugin;
|
|
2190
|
-
}();
|
|
2215
|
+
}(g.AbstractRendererPlugin);
|
|
2191
2216
|
|
|
2192
2217
|
var earcut_1 = earcut;
|
|
2193
2218
|
var _default = earcut;
|
|
@@ -3016,80 +3041,6 @@
|
|
|
3016
3041
|
}
|
|
3017
3042
|
}
|
|
3018
3043
|
|
|
3019
|
-
var Renderable3D = function Renderable3D() {
|
|
3020
|
-
this.pickingId = void 0;
|
|
3021
|
-
this.encodedPickingColor = void 0;
|
|
3022
|
-
this.meshes = [];
|
|
3023
|
-
};
|
|
3024
|
-
|
|
3025
|
-
Renderable3D.tag = 'c-renderable-3d';
|
|
3026
|
-
|
|
3027
|
-
var LightPool = /*#__PURE__*/function () {
|
|
3028
|
-
function LightPool() {
|
|
3029
|
-
this.lights = [];
|
|
3030
|
-
this.fog = void 0;
|
|
3031
|
-
}
|
|
3032
|
-
|
|
3033
|
-
var _proto = LightPool.prototype;
|
|
3034
|
-
|
|
3035
|
-
_proto.addLight = function addLight(light) {
|
|
3036
|
-
this.lights.push(light);
|
|
3037
|
-
this.sortLights();
|
|
3038
|
-
};
|
|
3039
|
-
|
|
3040
|
-
_proto.removeLight = function removeLight(light) {
|
|
3041
|
-
var i = this.lights.indexOf(light);
|
|
3042
|
-
this.lights.splice(i, 1);
|
|
3043
|
-
this.sortLights();
|
|
3044
|
-
};
|
|
3045
|
-
|
|
3046
|
-
_proto.addFog = function addFog(fog) {
|
|
3047
|
-
this.fog = fog;
|
|
3048
|
-
};
|
|
3049
|
-
|
|
3050
|
-
_proto.removeFog = function removeFog(fog) {
|
|
3051
|
-
this.fog = null;
|
|
3052
|
-
};
|
|
3053
|
-
|
|
3054
|
-
_proto.getFog = function getFog() {
|
|
3055
|
-
return this.fog;
|
|
3056
|
-
};
|
|
3057
|
-
|
|
3058
|
-
_proto.getAllLights = function getAllLights() {
|
|
3059
|
-
return this.lights;
|
|
3060
|
-
}
|
|
3061
|
-
/**
|
|
3062
|
-
* USE_LIGHT
|
|
3063
|
-
* NUM_AMBIENT_LIGHTS
|
|
3064
|
-
* NUM_DIR_LIGHTS
|
|
3065
|
-
*/
|
|
3066
|
-
;
|
|
3067
|
-
|
|
3068
|
-
_proto.getDefines = function getDefines() {
|
|
3069
|
-
var defines = {
|
|
3070
|
-
USE_LIGHT: !!this.lights.length
|
|
3071
|
-
};
|
|
3072
|
-
this.lights.forEach(function (light) {
|
|
3073
|
-
if (!defines[light.define]) {
|
|
3074
|
-
defines[light.define] = 0;
|
|
3075
|
-
}
|
|
3076
|
-
|
|
3077
|
-
defines[light.define]++;
|
|
3078
|
-
});
|
|
3079
|
-
return defines;
|
|
3080
|
-
};
|
|
3081
|
-
|
|
3082
|
-
_proto.sortLights = function sortLights() {
|
|
3083
|
-
this.lights.sort(function (a, b) {
|
|
3084
|
-
return a.order - b.order;
|
|
3085
|
-
});
|
|
3086
|
-
};
|
|
3087
|
-
|
|
3088
|
-
return LightPool;
|
|
3089
|
-
}();
|
|
3090
|
-
|
|
3091
|
-
LightPool = __decorate([g.singleton()], LightPool);
|
|
3092
|
-
|
|
3093
3044
|
function _regeneratorRuntime$2() {
|
|
3094
3045
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3095
3046
|
_regeneratorRuntime$2 = function _regeneratorRuntime() {
|
|
@@ -3512,19 +3463,19 @@
|
|
|
3512
3463
|
return _extends.apply(this, arguments);
|
|
3513
3464
|
}
|
|
3514
3465
|
|
|
3515
|
-
function _inheritsLoose$
|
|
3466
|
+
function _inheritsLoose$2(subClass, superClass) {
|
|
3516
3467
|
subClass.prototype = Object.create(superClass.prototype);
|
|
3517
3468
|
subClass.prototype.constructor = subClass;
|
|
3518
3469
|
|
|
3519
|
-
_setPrototypeOf$
|
|
3470
|
+
_setPrototypeOf$2(subClass, superClass);
|
|
3520
3471
|
}
|
|
3521
3472
|
|
|
3522
|
-
function _setPrototypeOf$
|
|
3523
|
-
_setPrototypeOf$
|
|
3473
|
+
function _setPrototypeOf$2(o, p) {
|
|
3474
|
+
_setPrototypeOf$2 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
3524
3475
|
o.__proto__ = p;
|
|
3525
3476
|
return o;
|
|
3526
3477
|
};
|
|
3527
|
-
return _setPrototypeOf$
|
|
3478
|
+
return _setPrototypeOf$2(o, p);
|
|
3528
3479
|
}
|
|
3529
3480
|
|
|
3530
3481
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
@@ -3590,10 +3541,83 @@
|
|
|
3590
3541
|
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
3591
3542
|
}
|
|
3592
3543
|
|
|
3544
|
+
var Renderable3D = function Renderable3D() {
|
|
3545
|
+
this.pickingId = void 0;
|
|
3546
|
+
this.encodedPickingColor = void 0;
|
|
3547
|
+
this.meshes = [];
|
|
3548
|
+
};
|
|
3549
|
+
|
|
3550
|
+
Renderable3D.tag = 'c-renderable-3d';
|
|
3551
|
+
|
|
3552
|
+
var LightPool = /*#__PURE__*/function () {
|
|
3553
|
+
function LightPool() {
|
|
3554
|
+
this.lights = [];
|
|
3555
|
+
this.fog = void 0;
|
|
3556
|
+
}
|
|
3557
|
+
|
|
3558
|
+
var _proto = LightPool.prototype;
|
|
3559
|
+
|
|
3560
|
+
_proto.addLight = function addLight(light) {
|
|
3561
|
+
this.lights.push(light);
|
|
3562
|
+
this.sortLights();
|
|
3563
|
+
};
|
|
3564
|
+
|
|
3565
|
+
_proto.removeLight = function removeLight(light) {
|
|
3566
|
+
var i = this.lights.indexOf(light);
|
|
3567
|
+
this.lights.splice(i, 1);
|
|
3568
|
+
this.sortLights();
|
|
3569
|
+
};
|
|
3570
|
+
|
|
3571
|
+
_proto.addFog = function addFog(fog) {
|
|
3572
|
+
this.fog = fog;
|
|
3573
|
+
};
|
|
3574
|
+
|
|
3575
|
+
_proto.removeFog = function removeFog(fog) {
|
|
3576
|
+
this.fog = null;
|
|
3577
|
+
};
|
|
3578
|
+
|
|
3579
|
+
_proto.getFog = function getFog() {
|
|
3580
|
+
return this.fog;
|
|
3581
|
+
};
|
|
3582
|
+
|
|
3583
|
+
_proto.getAllLights = function getAllLights() {
|
|
3584
|
+
return this.lights;
|
|
3585
|
+
}
|
|
3586
|
+
/**
|
|
3587
|
+
* USE_LIGHT
|
|
3588
|
+
* NUM_AMBIENT_LIGHTS
|
|
3589
|
+
* NUM_DIR_LIGHTS
|
|
3590
|
+
*/
|
|
3591
|
+
;
|
|
3592
|
+
|
|
3593
|
+
_proto.getDefines = function getDefines() {
|
|
3594
|
+
var defines = {
|
|
3595
|
+
USE_LIGHT: !!this.lights.length
|
|
3596
|
+
};
|
|
3597
|
+
this.lights.forEach(function (light) {
|
|
3598
|
+
if (!defines[light.define]) {
|
|
3599
|
+
defines[light.define] = 0;
|
|
3600
|
+
}
|
|
3601
|
+
|
|
3602
|
+
defines[light.define]++;
|
|
3603
|
+
});
|
|
3604
|
+
return defines;
|
|
3605
|
+
};
|
|
3606
|
+
|
|
3607
|
+
_proto.sortLights = function sortLights() {
|
|
3608
|
+
this.lights.sort(function (a, b) {
|
|
3609
|
+
return a.order - b.order;
|
|
3610
|
+
});
|
|
3611
|
+
};
|
|
3612
|
+
|
|
3613
|
+
return LightPool;
|
|
3614
|
+
}();
|
|
3615
|
+
|
|
3616
|
+
LightPool = __decorate([g.singleton()], LightPool);
|
|
3593
3617
|
var _excluded = ["style"];
|
|
3594
3618
|
|
|
3595
3619
|
var Mesh = /*#__PURE__*/function (_DisplayObject) {
|
|
3596
|
-
_inheritsLoose$
|
|
3620
|
+
_inheritsLoose$2(Mesh, _DisplayObject);
|
|
3597
3621
|
|
|
3598
3622
|
function Mesh(_ref) {
|
|
3599
3623
|
var _this;
|
|
@@ -6017,7 +6041,7 @@
|
|
|
6017
6041
|
|
|
6018
6042
|
|
|
6019
6043
|
var BufferGeometry = /*#__PURE__*/function (_EventEmitter) {
|
|
6020
|
-
_inheritsLoose$
|
|
6044
|
+
_inheritsLoose$2(BufferGeometry, _EventEmitter);
|
|
6021
6045
|
/**
|
|
6022
6046
|
* 绘制模式
|
|
6023
6047
|
*/
|
|
@@ -6517,7 +6541,7 @@
|
|
|
6517
6541
|
|
|
6518
6542
|
|
|
6519
6543
|
var Material = /*#__PURE__*/function (_EventEmitter) {
|
|
6520
|
-
_inheritsLoose$
|
|
6544
|
+
_inheritsLoose$2(Material, _EventEmitter);
|
|
6521
6545
|
|
|
6522
6546
|
function Material(device, props) {
|
|
6523
6547
|
var _this;
|
|
@@ -6870,7 +6894,7 @@
|
|
|
6870
6894
|
}(eventemitter3.EventEmitter);
|
|
6871
6895
|
|
|
6872
6896
|
var ShaderMaterial = /*#__PURE__*/function (_Material) {
|
|
6873
|
-
_inheritsLoose$
|
|
6897
|
+
_inheritsLoose$2(ShaderMaterial, _Material);
|
|
6874
6898
|
|
|
6875
6899
|
function ShaderMaterial(device, props) {
|
|
6876
6900
|
var _this;
|
|
@@ -10875,7 +10899,7 @@
|
|
|
10875
10899
|
*/
|
|
10876
10900
|
|
|
10877
10901
|
var SDFMesh = /*#__PURE__*/function (_Instanced) {
|
|
10878
|
-
_inheritsLoose$
|
|
10902
|
+
_inheritsLoose$2(SDFMesh, _Instanced);
|
|
10879
10903
|
|
|
10880
10904
|
function SDFMesh() {
|
|
10881
10905
|
return _Instanced.apply(this, arguments) || this;
|
|
@@ -11069,7 +11093,7 @@
|
|
|
11069
11093
|
};
|
|
11070
11094
|
|
|
11071
11095
|
var InstancedLineMesh = /*#__PURE__*/function (_Instanced) {
|
|
11072
|
-
_inheritsLoose$
|
|
11096
|
+
_inheritsLoose$2(InstancedLineMesh, _Instanced);
|
|
11073
11097
|
|
|
11074
11098
|
function InstancedLineMesh() {
|
|
11075
11099
|
return _Instanced.apply(this, arguments) || this;
|
|
@@ -11700,7 +11724,7 @@
|
|
|
11700
11724
|
})(Uniform || (Uniform = {}));
|
|
11701
11725
|
|
|
11702
11726
|
var LineMesh = /*#__PURE__*/function (_Instanced) {
|
|
11703
|
-
_inheritsLoose$
|
|
11727
|
+
_inheritsLoose$2(LineMesh, _Instanced);
|
|
11704
11728
|
|
|
11705
11729
|
function LineMesh() {
|
|
11706
11730
|
return _Instanced.apply(this, arguments) || this;
|
|
@@ -12241,7 +12265,7 @@
|
|
|
12241
12265
|
var meshVert = "#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(std140) uniform ub_ObjectParams {\n mat4 u_ModelMatrix;\n vec4 u_FillColor;\n vec3 u_PickingColor;\n float u_Opacity;\n float u_FillOpacity;\n float u_Visible;\n float u_ZIndex;\n};\n\nlayout(location = POSITION) in vec2 a_Position;\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\nvoid main() {\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n gl_Position = u_ProjectionMatrix * u_ViewMatrix * u_ModelMatrix * vec4(a_Position, u_ZIndex, 1.0);\n}"; // eslint-disable-line
|
|
12242
12266
|
|
|
12243
12267
|
var FillMesh = /*#__PURE__*/function (_Instanced) {
|
|
12244
|
-
_inheritsLoose$
|
|
12268
|
+
_inheritsLoose$2(FillMesh, _Instanced);
|
|
12245
12269
|
|
|
12246
12270
|
function FillMesh() {
|
|
12247
12271
|
return _Instanced.apply(this, arguments) || this;
|
|
@@ -12424,7 +12448,7 @@
|
|
|
12424
12448
|
var vert$3 = "#define GLSLIFY 1\nlayout(std140) uniform ub_SceneParams {\n mat4 u_ProjectionMatrix;\n mat4 u_ViewMatrix;\n vec3 u_CameraPosition;\n float u_DevicePixelRatio;\n vec2 u_Viewport;\n float u_IsOrtho;\n float u_IsPicking;\n};\nlayout(location = MODEL_MATRIX0) in vec4 a_ModelMatrix0;\nlayout(location = MODEL_MATRIX1) in vec4 a_ModelMatrix1;\nlayout(location = MODEL_MATRIX2) in vec4 a_ModelMatrix2;\nlayout(location = MODEL_MATRIX3) in vec4 a_ModelMatrix3;\nlayout(location = COLOR) in vec4 a_Color;\nlayout(location = STROKE_COLOR) in vec4 a_StrokeColor;\nlayout(location = PACKED_STYLE1) in vec4 a_StylePacked1;\nlayout(location = PACKED_STYLE2) in vec4 a_StylePacked2;\nlayout(location = PICKING_COLOR) in vec4 a_PickingColor;\n\nout vec4 v_PickingResult;\nout vec4 v_Color;\nout vec4 v_StrokeColor;\nout vec4 v_StylePacked1;\nout vec4 v_StylePacked2;\n\n#define COLOR_SCALE 1. / 255.\nvoid setPickingColor(vec3 pickingColor) {\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\n}\nvec4 project(vec4 pos, mat4 pm, mat4 vm, mat4 mm) {\n return pm * vm * mm * pos;\n}\n\nlayout(location = POSITION) in vec2 a_Size;\n\n#ifdef USE_UV\n layout(location = UV) in vec2 a_Uv;\n out vec2 v_Uv;\n#endif\n\nvoid main() {\n mat4 u_ModelMatrix = mat4(a_ModelMatrix0, a_ModelMatrix1, a_ModelMatrix2, a_ModelMatrix3);\nvec4 u_StrokeColor = a_StrokeColor;\nfloat u_Opacity = a_StylePacked1.x;\nfloat u_FillOpacity = a_StylePacked1.y;\nfloat u_StrokeOpacity = a_StylePacked1.z;\nfloat u_StrokeWidth = a_StylePacked1.w;\nfloat u_ZIndex = a_PickingColor.w;\nvec2 u_Anchor = a_StylePacked2.yz;\nfloat u_IncreasedLineWidthForHitTesting = a_StylePacked2.w;\n\nsetPickingColor(a_PickingColor.xyz);\n\nv_Color = a_Color;\nv_StrokeColor = a_StrokeColor;\nv_StylePacked1 = a_StylePacked1;\nv_StylePacked2 = a_StylePacked2;\n\n#ifdef CLIPSPACE_NEAR_ZERO\n gl_Position.z = gl_Position.z * 0.5 + 0.5;\n#endif\n\n vec2 offset = (a_Uv - u_Anchor.xy) * a_Size;\n\n gl_Position = project(vec4(offset, u_ZIndex, 1.0), u_ProjectionMatrix, u_ViewMatrix, u_ModelMatrix);\n\n #ifdef USE_UV\n v_Uv = a_Uv;\n #ifdef VIEWPORT_ORIGIN_TL\n v_Uv.y = 1.0 - v_Uv.y;\n #endif\n#endif\n\n}"; // eslint-disable-line
|
|
12425
12449
|
|
|
12426
12450
|
var ImageMesh = /*#__PURE__*/function (_Instanced) {
|
|
12427
|
-
_inheritsLoose$
|
|
12451
|
+
_inheritsLoose$2(ImageMesh, _Instanced);
|
|
12428
12452
|
|
|
12429
12453
|
function ImageMesh() {
|
|
12430
12454
|
return _Instanced.apply(this, arguments) || this;
|
|
@@ -13080,7 +13104,7 @@
|
|
|
13080
13104
|
})(TextUniform || (TextUniform = {}));
|
|
13081
13105
|
|
|
13082
13106
|
var TextMesh = /*#__PURE__*/function (_Instanced) {
|
|
13083
|
-
_inheritsLoose$
|
|
13107
|
+
_inheritsLoose$2(TextMesh, _Instanced);
|
|
13084
13108
|
|
|
13085
13109
|
function TextMesh() {
|
|
13086
13110
|
var _this;
|
|
@@ -13108,14 +13132,13 @@
|
|
|
13108
13132
|
}
|
|
13109
13133
|
|
|
13110
13134
|
var instance = this.instance;
|
|
13111
|
-
var instancedAttributes = ['fontFamily', 'fontWeight', 'textBaseline', 'letterSpacing']; // fontStack & fontSize should be same
|
|
13112
|
-
|
|
13113
|
-
|
|
13114
|
-
|
|
13115
|
-
}
|
|
13135
|
+
var instancedAttributes = ['fontSize', 'fontFamily', 'fontWeight', 'textBaseline', 'letterSpacing']; // fontStack & fontSize should be same
|
|
13136
|
+
// if (instance.parsedStyle.fontSize.value !== object.parsedStyle.fontSize.value) {
|
|
13137
|
+
// return false;
|
|
13138
|
+
// }
|
|
13116
13139
|
|
|
13117
13140
|
if (instance.parsedStyle.metrics.font !== object.parsedStyle.metrics.font || instancedAttributes.some(function (name) {
|
|
13118
|
-
return instance.parsedStyle[name] !== object.parsedStyle[name];
|
|
13141
|
+
return instance.parsedStyle[name].value !== object.parsedStyle[name].value;
|
|
13119
13142
|
})) {
|
|
13120
13143
|
return false;
|
|
13121
13144
|
}
|
|
@@ -13130,8 +13153,7 @@
|
|
|
13130
13153
|
var _object$parsedStyle = object.parsedStyle,
|
|
13131
13154
|
textBaseline = _object$parsedStyle.textBaseline,
|
|
13132
13155
|
fontSize = _object$parsedStyle.fontSize,
|
|
13133
|
-
|
|
13134
|
-
letterSpacing = _object$parsedStyle$l === void 0 ? 0 : _object$parsedStyle$l; // scale current font size to base(24)
|
|
13156
|
+
letterSpacing = _object$parsedStyle.letterSpacing; // scale current font size to base(24)
|
|
13135
13157
|
|
|
13136
13158
|
var fontScale = BASE_FONT_WIDTH / fontSize.value;
|
|
13137
13159
|
var indices = [];
|
|
@@ -13182,7 +13204,7 @@
|
|
|
13182
13204
|
lineHeight: fontScale * lineHeight,
|
|
13183
13205
|
offsetX: fontScale * offsetX,
|
|
13184
13206
|
offsetY: fontScale * (linePositionY + offsetY),
|
|
13185
|
-
letterSpacing: fontScale * letterSpacing,
|
|
13207
|
+
letterSpacing: fontScale * letterSpacing.value,
|
|
13186
13208
|
glyphAtlas: glyphAtlas,
|
|
13187
13209
|
indicesOffset: indicesOff
|
|
13188
13210
|
}),
|
|
@@ -13399,7 +13421,7 @@
|
|
|
13399
13421
|
TextMesh = __decorate([g.injectable()], TextMesh);
|
|
13400
13422
|
|
|
13401
13423
|
var MeshMesh = /*#__PURE__*/function (_Instanced) {
|
|
13402
|
-
_inheritsLoose$
|
|
13424
|
+
_inheritsLoose$2(MeshMesh, _Instanced);
|
|
13403
13425
|
|
|
13404
13426
|
function MeshMesh() {
|
|
13405
13427
|
return _Instanced.apply(this, arguments) || this;
|
|
@@ -13528,7 +13550,7 @@
|
|
|
13528
13550
|
*/
|
|
13529
13551
|
|
|
13530
13552
|
var CircleRenderer = /*#__PURE__*/function (_Batch) {
|
|
13531
|
-
_inheritsLoose$
|
|
13553
|
+
_inheritsLoose$2(CircleRenderer, _Batch);
|
|
13532
13554
|
|
|
13533
13555
|
function CircleRenderer() {
|
|
13534
13556
|
var _this;
|
|
@@ -13596,7 +13618,7 @@
|
|
|
13596
13618
|
})], CircleRenderer);
|
|
13597
13619
|
|
|
13598
13620
|
var PathRenderer = /*#__PURE__*/function (_Batch) {
|
|
13599
|
-
_inheritsLoose$
|
|
13621
|
+
_inheritsLoose$2(PathRenderer, _Batch);
|
|
13600
13622
|
|
|
13601
13623
|
function PathRenderer() {
|
|
13602
13624
|
var _this;
|
|
@@ -13672,7 +13694,7 @@
|
|
|
13672
13694
|
// }
|
|
13673
13695
|
|
|
13674
13696
|
var GroupRenderer = /*#__PURE__*/function (_Batch) {
|
|
13675
|
-
_inheritsLoose$
|
|
13697
|
+
_inheritsLoose$2(GroupRenderer, _Batch);
|
|
13676
13698
|
|
|
13677
13699
|
function GroupRenderer() {
|
|
13678
13700
|
var _this;
|
|
@@ -13703,7 +13725,7 @@
|
|
|
13703
13725
|
})], GroupRenderer);
|
|
13704
13726
|
|
|
13705
13727
|
var ImageRenderer = /*#__PURE__*/function (_Batch) {
|
|
13706
|
-
_inheritsLoose$
|
|
13728
|
+
_inheritsLoose$2(ImageRenderer, _Batch);
|
|
13707
13729
|
|
|
13708
13730
|
function ImageRenderer() {
|
|
13709
13731
|
var _this;
|
|
@@ -13734,7 +13756,7 @@
|
|
|
13734
13756
|
})], ImageRenderer);
|
|
13735
13757
|
|
|
13736
13758
|
var TextRenderer = /*#__PURE__*/function (_Batch) {
|
|
13737
|
-
_inheritsLoose$
|
|
13759
|
+
_inheritsLoose$2(TextRenderer, _Batch);
|
|
13738
13760
|
|
|
13739
13761
|
function TextRenderer() {
|
|
13740
13762
|
var _this;
|
|
@@ -13788,7 +13810,7 @@
|
|
|
13788
13810
|
*/
|
|
13789
13811
|
|
|
13790
13812
|
var LineRenderer = /*#__PURE__*/function (_Batch) {
|
|
13791
|
-
_inheritsLoose$
|
|
13813
|
+
_inheritsLoose$2(LineRenderer, _Batch);
|
|
13792
13814
|
|
|
13793
13815
|
function LineRenderer() {
|
|
13794
13816
|
var _this;
|
|
@@ -13819,7 +13841,7 @@
|
|
|
13819
13841
|
})], LineRenderer);
|
|
13820
13842
|
|
|
13821
13843
|
var MeshRenderer = /*#__PURE__*/function (_Batch) {
|
|
13822
|
-
_inheritsLoose$
|
|
13844
|
+
_inheritsLoose$2(MeshRenderer, _Batch);
|
|
13823
13845
|
|
|
13824
13846
|
function MeshRenderer() {
|
|
13825
13847
|
var _this;
|
|
@@ -13846,7 +13868,7 @@
|
|
|
13846
13868
|
var _excluded$1 = ["style"];
|
|
13847
13869
|
|
|
13848
13870
|
var Light = /*#__PURE__*/function (_DisplayObject) {
|
|
13849
|
-
_inheritsLoose$
|
|
13871
|
+
_inheritsLoose$2(Light, _DisplayObject);
|
|
13850
13872
|
|
|
13851
13873
|
function Light(_temp) {
|
|
13852
13874
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
@@ -13876,7 +13898,7 @@
|
|
|
13876
13898
|
})(FogType || (FogType = {}));
|
|
13877
13899
|
|
|
13878
13900
|
var Fog = /*#__PURE__*/function (_DisplayObject) {
|
|
13879
|
-
_inheritsLoose$
|
|
13901
|
+
_inheritsLoose$2(Fog, _DisplayObject);
|
|
13880
13902
|
|
|
13881
13903
|
function Fog(_temp) {
|
|
13882
13904
|
var _ref = _temp === void 0 ? {} : _temp,
|
|
@@ -14104,6 +14126,9 @@
|
|
|
14104
14126
|
*/
|
|
14105
14127
|
|
|
14106
14128
|
renderingService.hooks.beginFrame.tap(RenderGraphPlugin_1.tag, function () {
|
|
14129
|
+
// if (this.renderingContext.renderListCurrentFrame.length === 0) {
|
|
14130
|
+
// return;
|
|
14131
|
+
// }
|
|
14107
14132
|
var canvas = _this.swapChain.getCanvas();
|
|
14108
14133
|
|
|
14109
14134
|
var renderInstManager = _this.renderHelper.renderInstManager;
|
|
@@ -14145,6 +14170,9 @@
|
|
|
14145
14170
|
_this.builder.resolveRenderTargetToExternalTexture(mainColorTargetID, _this.swapChain.getOnscreenTexture());
|
|
14146
14171
|
});
|
|
14147
14172
|
renderingService.hooks.endFrame.tap(RenderGraphPlugin_1.tag, function () {
|
|
14173
|
+
// if (this.renderingContext.renderListCurrentFrame.length === 0) {
|
|
14174
|
+
// return;
|
|
14175
|
+
// }
|
|
14148
14176
|
var renderInstManager = _this.renderHelper.renderInstManager; // TODO: time for GPU Animation
|
|
14149
14177
|
// const timeInMilliseconds = window.performance.now();
|
|
14150
14178
|
// Push our outer template, which contains the dynamic UBO bindings...
|
|
@@ -14648,7 +14676,7 @@
|
|
|
14648
14676
|
var frag$5 = "#define GLSLIFY 1\nuniform sampler2D u_Texture;\nin vec2 v_TexCoord;\n\nout vec4 outputColor;\n\nvoid main() {\n outputColor = texture(SAMPLER_2D(u_Texture), v_TexCoord);\n}"; // eslint-disable-line
|
|
14649
14677
|
|
|
14650
14678
|
var CopyProgram = /*#__PURE__*/function (_DeviceProgram) {
|
|
14651
|
-
_inheritsLoose$
|
|
14679
|
+
_inheritsLoose$2(CopyProgram, _DeviceProgram);
|
|
14652
14680
|
|
|
14653
14681
|
function CopyProgram() {
|
|
14654
14682
|
var _this;
|
|
@@ -14730,7 +14758,7 @@
|
|
|
14730
14758
|
var frag$6 = "#define GLSLIFY 1\nuniform sampler2D u_Texture;\nin vec2 v_TexCoord;\n\nout vec4 outputColor;\n\nfloat MonochromeNTSC(vec3 t_Color) {\n // NTSC primaries.\n return dot(t_Color.rgb, vec3(0.299, 0.587, 0.114));\n}\n\nvec4 FXAA(PD_SAMPLER_2D(t_Texture), in vec2 t_PixelCenter, in vec2 t_InvResolution) {\n // FXAA v2, based on implementations:\n // http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/\n // https://github.com/mitsuhiko/webgl-meincraft\n\n float lumaMM = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy).rgb);\n\n #if 1\n vec2 t_PixelTopLeft = t_PixelCenter.xy - t_InvResolution.xy * 0.5;\n float lumaNW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy) .rgb);\n float lumaNE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(1.0, 0.0)).rgb);\n float lumaSW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(0.0, 1.0)).rgb);\n float lumaSE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelTopLeft.xy + vec2(1.0, 1.0)).rgb);\n #else\n // We're at the pixel center -- pixel edges are 0.5 units away.\n // NOTE(jstpierre): mitsuhiko's port seems to get this wrong?\n vec2 t_PixelSize = t_InvResolution.xy * 0.5;\n\n float lumaNW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2(-1.0, -1.0)).rgb);\n float lumaNE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2( 1.0, -1.0)).rgb);\n float lumaSW = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2(-1.0, 1.0)).rgb);\n float lumaSE = MonochromeNTSC(texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + t_PixelSize * vec2( 1.0, 1.0)).rgb);\n #endif\n\n vec2 dir; \n dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));\n dir.y = ((lumaNW + lumaSW) - (lumaNE + lumaSE));\n\n const float FXAA_REDUCE_MIN = 1.0/128.0;\n const float FXAA_REDUCE_MUL = 1.0/8.0;\n const float FXAA_SPAN_MAX = 8.0;\n\n float dirReduce = max(\n (lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL),\n FXAA_REDUCE_MIN);\n\n float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce);\n dir = min(vec2( FXAA_SPAN_MAX, FXAA_SPAN_MAX), max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), dir * rcpDirMin)) * u_InvResolution.xy;\n\n float lumaMin = min(lumaMM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));\n float lumaMax = max(lumaMM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));\n\n vec4 rgbA = (1.0/2.0) * (\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (1.0/3.0 - 0.5)) +\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (2.0/3.0 - 0.5)));\n vec4 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (0.0/3.0 - 0.5)) +\n texture(PU_SAMPLER_2D(t_Texture), t_PixelCenter.xy + dir * (3.0/3.0 - 0.5)));\n float lumaB = MonochromeNTSC(rgbB.rgb);\n\n vec4 rgbOutput = ((lumaB < lumaMin) || (lumaB > lumaMax)) ? rgbA : rgbB;\n return rgbOutput;\n}\n\nvoid main() {\n outputColor = FXAA(PP_SAMPLER_2D(u_Texture), v_TexCoord.xy, u_InvResolution.xy);\n}"; // eslint-disable-line
|
|
14731
14759
|
|
|
14732
14760
|
var FXAAProgram = /*#__PURE__*/function (_DeviceProgram) {
|
|
14733
|
-
_inheritsLoose$
|
|
14761
|
+
_inheritsLoose$2(FXAAProgram, _DeviceProgram);
|
|
14734
14762
|
|
|
14735
14763
|
function FXAAProgram() {
|
|
14736
14764
|
var _this;
|
|
@@ -14870,29 +14898,37 @@
|
|
|
14870
14898
|
});
|
|
14871
14899
|
});
|
|
14872
14900
|
|
|
14873
|
-
var Plugin$1 = /*#__PURE__*/function () {
|
|
14901
|
+
var Plugin$1 = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
14902
|
+
_inheritsLoose$2(Plugin, _AbstractRendererPlug);
|
|
14903
|
+
|
|
14874
14904
|
function Plugin() {
|
|
14875
|
-
|
|
14876
|
-
|
|
14905
|
+
var _this;
|
|
14906
|
+
|
|
14907
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
14908
|
+
args[_key] = arguments[_key];
|
|
14909
|
+
}
|
|
14910
|
+
|
|
14911
|
+
_this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
|
|
14912
|
+
_this.name = 'device-renderer';
|
|
14913
|
+
return _this;
|
|
14877
14914
|
}
|
|
14878
14915
|
|
|
14879
14916
|
var _proto = Plugin.prototype;
|
|
14880
14917
|
|
|
14881
|
-
_proto.init = function init(
|
|
14918
|
+
_proto.init = function init() {
|
|
14882
14919
|
if (!g.GlobalContainer.isBound(MeshUpdater)) {
|
|
14883
14920
|
g.GlobalContainer.register(MeshUpdater);
|
|
14884
14921
|
}
|
|
14885
14922
|
|
|
14886
|
-
this.container
|
|
14887
|
-
container.load(containerModule$1, true);
|
|
14923
|
+
this.container.load(containerModule$1, true);
|
|
14888
14924
|
};
|
|
14889
14925
|
|
|
14890
|
-
_proto.destroy = function destroy(
|
|
14926
|
+
_proto.destroy = function destroy() {
|
|
14891
14927
|
if (g.GlobalContainer.isBound(MeshUpdater)) {
|
|
14892
14928
|
g.GlobalContainer.remove(MeshUpdater);
|
|
14893
14929
|
}
|
|
14894
14930
|
|
|
14895
|
-
container.unload(containerModule$1);
|
|
14931
|
+
this.container.unload(containerModule$1);
|
|
14896
14932
|
};
|
|
14897
14933
|
|
|
14898
14934
|
_proto.getDevice = function getDevice() {
|
|
@@ -14908,7 +14944,7 @@
|
|
|
14908
14944
|
};
|
|
14909
14945
|
|
|
14910
14946
|
return Plugin;
|
|
14911
|
-
}();
|
|
14947
|
+
}(g.AbstractRendererPlugin);
|
|
14912
14948
|
|
|
14913
14949
|
var index_esm = /*#__PURE__*/Object.freeze({
|
|
14914
14950
|
__proto__: null,
|
|
@@ -15494,6 +15530,21 @@
|
|
|
15494
15530
|
};
|
|
15495
15531
|
}
|
|
15496
15532
|
|
|
15533
|
+
function _inheritsLoose$3(subClass, superClass) {
|
|
15534
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
15535
|
+
subClass.prototype.constructor = subClass;
|
|
15536
|
+
|
|
15537
|
+
_setPrototypeOf$3(subClass, superClass);
|
|
15538
|
+
}
|
|
15539
|
+
|
|
15540
|
+
function _setPrototypeOf$3(o, p) {
|
|
15541
|
+
_setPrototypeOf$3 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
15542
|
+
o.__proto__ = p;
|
|
15543
|
+
return o;
|
|
15544
|
+
};
|
|
15545
|
+
return _setPrototypeOf$3(o, p);
|
|
15546
|
+
}
|
|
15547
|
+
|
|
15497
15548
|
var _class$2;
|
|
15498
15549
|
|
|
15499
15550
|
var DOMInteractionPlugin_1;
|
|
@@ -15660,23 +15711,33 @@
|
|
|
15660
15711
|
register(DOMInteractionPlugin);
|
|
15661
15712
|
});
|
|
15662
15713
|
|
|
15663
|
-
var Plugin$2 = /*#__PURE__*/function () {
|
|
15714
|
+
var Plugin$2 = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
15715
|
+
_inheritsLoose$3(Plugin, _AbstractRendererPlug);
|
|
15716
|
+
|
|
15664
15717
|
function Plugin() {
|
|
15665
|
-
|
|
15718
|
+
var _this;
|
|
15719
|
+
|
|
15720
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15721
|
+
args[_key] = arguments[_key];
|
|
15722
|
+
}
|
|
15723
|
+
|
|
15724
|
+
_this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
|
|
15725
|
+
_this.name = 'dom-interaction';
|
|
15726
|
+
return _this;
|
|
15666
15727
|
}
|
|
15667
15728
|
|
|
15668
15729
|
var _proto = Plugin.prototype;
|
|
15669
15730
|
|
|
15670
|
-
_proto.init = function init(
|
|
15671
|
-
container.load(containerModule$2, true);
|
|
15731
|
+
_proto.init = function init() {
|
|
15732
|
+
this.container.load(containerModule$2, true);
|
|
15672
15733
|
};
|
|
15673
15734
|
|
|
15674
|
-
_proto.destroy = function destroy(
|
|
15675
|
-
container.unload(containerModule$2);
|
|
15735
|
+
_proto.destroy = function destroy() {
|
|
15736
|
+
this.container.unload(containerModule$2);
|
|
15676
15737
|
};
|
|
15677
15738
|
|
|
15678
15739
|
return Plugin;
|
|
15679
|
-
}();
|
|
15740
|
+
}(g.AbstractRendererPlugin);
|
|
15680
15741
|
|
|
15681
15742
|
var index_esm$1 = /*#__PURE__*/Object.freeze({
|
|
15682
15743
|
__proto__: null,
|
|
@@ -16069,6 +16130,21 @@
|
|
|
16069
16130
|
};
|
|
16070
16131
|
}
|
|
16071
16132
|
|
|
16133
|
+
function _inheritsLoose$4(subClass, superClass) {
|
|
16134
|
+
subClass.prototype = Object.create(superClass.prototype);
|
|
16135
|
+
subClass.prototype.constructor = subClass;
|
|
16136
|
+
|
|
16137
|
+
_setPrototypeOf$4(subClass, superClass);
|
|
16138
|
+
}
|
|
16139
|
+
|
|
16140
|
+
function _setPrototypeOf$4(o, p) {
|
|
16141
|
+
_setPrototypeOf$4 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
16142
|
+
o.__proto__ = p;
|
|
16143
|
+
return o;
|
|
16144
|
+
};
|
|
16145
|
+
return _setPrototypeOf$4(o, p);
|
|
16146
|
+
}
|
|
16147
|
+
|
|
16072
16148
|
var _class$3;
|
|
16073
16149
|
|
|
16074
16150
|
var HTMLRenderingPlugin_1;
|
|
@@ -16337,23 +16413,33 @@
|
|
|
16337
16413
|
register(HTMLRenderingPlugin);
|
|
16338
16414
|
});
|
|
16339
16415
|
|
|
16340
|
-
var Plugin$3 = /*#__PURE__*/function () {
|
|
16416
|
+
var Plugin$3 = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
16417
|
+
_inheritsLoose$4(Plugin, _AbstractRendererPlug);
|
|
16418
|
+
|
|
16341
16419
|
function Plugin() {
|
|
16342
|
-
|
|
16420
|
+
var _this;
|
|
16421
|
+
|
|
16422
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16423
|
+
args[_key] = arguments[_key];
|
|
16424
|
+
}
|
|
16425
|
+
|
|
16426
|
+
_this = _AbstractRendererPlug.call.apply(_AbstractRendererPlug, [this].concat(args)) || this;
|
|
16427
|
+
_this.name = 'html-renderer';
|
|
16428
|
+
return _this;
|
|
16343
16429
|
}
|
|
16344
16430
|
|
|
16345
16431
|
var _proto = Plugin.prototype;
|
|
16346
16432
|
|
|
16347
|
-
_proto.init = function init(
|
|
16348
|
-
container.load(containerModule$3, true);
|
|
16433
|
+
_proto.init = function init() {
|
|
16434
|
+
this.container.load(containerModule$3, true);
|
|
16349
16435
|
};
|
|
16350
16436
|
|
|
16351
|
-
_proto.destroy = function destroy(
|
|
16352
|
-
container.unload(containerModule$3);
|
|
16437
|
+
_proto.destroy = function destroy() {
|
|
16438
|
+
this.container.unload(containerModule$3);
|
|
16353
16439
|
};
|
|
16354
16440
|
|
|
16355
16441
|
return Plugin;
|
|
16356
|
-
}();
|
|
16442
|
+
}(g.AbstractRendererPlugin);
|
|
16357
16443
|
|
|
16358
16444
|
var index_esm$2 = /*#__PURE__*/Object.freeze({
|
|
16359
16445
|
__proto__: null,
|
|
@@ -16763,19 +16849,19 @@
|
|
|
16763
16849
|
return _extends$1.apply(this, arguments);
|
|
16764
16850
|
}
|
|
16765
16851
|
|
|
16766
|
-
function _inheritsLoose$
|
|
16852
|
+
function _inheritsLoose$5(subClass, superClass) {
|
|
16767
16853
|
subClass.prototype = Object.create(superClass.prototype);
|
|
16768
16854
|
subClass.prototype.constructor = subClass;
|
|
16769
16855
|
|
|
16770
|
-
_setPrototypeOf$
|
|
16856
|
+
_setPrototypeOf$5(subClass, superClass);
|
|
16771
16857
|
}
|
|
16772
16858
|
|
|
16773
|
-
function _setPrototypeOf$
|
|
16774
|
-
_setPrototypeOf$
|
|
16859
|
+
function _setPrototypeOf$5(o, p) {
|
|
16860
|
+
_setPrototypeOf$5 = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
|
|
16775
16861
|
o.__proto__ = p;
|
|
16776
16862
|
return o;
|
|
16777
16863
|
};
|
|
16778
|
-
return _setPrototypeOf$
|
|
16864
|
+
return _setPrototypeOf$5(o, p);
|
|
16779
16865
|
}
|
|
16780
16866
|
|
|
16781
16867
|
function _assertThisInitialized$1(self) {
|
|
@@ -17436,7 +17522,7 @@
|
|
|
17436
17522
|
}
|
|
17437
17523
|
|
|
17438
17524
|
var ResourceBase_WebGPU = /*#__PURE__*/function (_EventEmitter) {
|
|
17439
|
-
_inheritsLoose$
|
|
17525
|
+
_inheritsLoose$5(ResourceBase_WebGPU, _EventEmitter);
|
|
17440
17526
|
|
|
17441
17527
|
function ResourceBase_WebGPU(_ref) {
|
|
17442
17528
|
var _this;
|
|
@@ -17461,7 +17547,7 @@
|
|
|
17461
17547
|
}(eventemitter3.EventEmitter);
|
|
17462
17548
|
|
|
17463
17549
|
var Bindings_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
17464
|
-
_inheritsLoose$
|
|
17550
|
+
_inheritsLoose$5(Bindings_WebGPU, _ResourceBase_WebGPU);
|
|
17465
17551
|
|
|
17466
17552
|
function Bindings_WebGPU(_ref) {
|
|
17467
17553
|
var _this;
|
|
@@ -17558,7 +17644,7 @@
|
|
|
17558
17644
|
}
|
|
17559
17645
|
|
|
17560
17646
|
var Buffer_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
17561
|
-
_inheritsLoose$
|
|
17647
|
+
_inheritsLoose$5(Buffer_WebGPU, _ResourceBase_WebGPU);
|
|
17562
17648
|
/**
|
|
17563
17649
|
* @see https://www.w3.org/TR/webgpu/#gpubuffer
|
|
17564
17650
|
*/
|
|
@@ -17715,7 +17801,7 @@
|
|
|
17715
17801
|
}();
|
|
17716
17802
|
|
|
17717
17803
|
var ComputePipeline_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
17718
|
-
_inheritsLoose$
|
|
17804
|
+
_inheritsLoose$5(ComputePipeline_WebGPU, _ResourceBase_WebGPU);
|
|
17719
17805
|
|
|
17720
17806
|
function ComputePipeline_WebGPU(_ref) {
|
|
17721
17807
|
var _this;
|
|
@@ -17758,7 +17844,7 @@
|
|
|
17758
17844
|
}(ResourceBase_WebGPU);
|
|
17759
17845
|
|
|
17760
17846
|
var InputLayout_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
17761
|
-
_inheritsLoose$
|
|
17847
|
+
_inheritsLoose$5(InputLayout_WebGPU, _ResourceBase_WebGPU);
|
|
17762
17848
|
|
|
17763
17849
|
function InputLayout_WebGPU(_ref) {
|
|
17764
17850
|
var _this;
|
|
@@ -17811,7 +17897,7 @@
|
|
|
17811
17897
|
}(ResourceBase_WebGPU);
|
|
17812
17898
|
|
|
17813
17899
|
var InputState_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
17814
|
-
_inheritsLoose$
|
|
17900
|
+
_inheritsLoose$5(InputState_WebGPU, _ResourceBase_WebGPU);
|
|
17815
17901
|
|
|
17816
17902
|
function InputState_WebGPU(_ref) {
|
|
17817
17903
|
var _this;
|
|
@@ -17839,7 +17925,7 @@
|
|
|
17839
17925
|
}(ResourceBase_WebGPU);
|
|
17840
17926
|
|
|
17841
17927
|
var Program_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
17842
|
-
_inheritsLoose$
|
|
17928
|
+
_inheritsLoose$5(Program_WebGPU, _ResourceBase_WebGPU);
|
|
17843
17929
|
|
|
17844
17930
|
function Program_WebGPU(_ref) {
|
|
17845
17931
|
var _this;
|
|
@@ -17919,7 +18005,7 @@
|
|
|
17919
18005
|
}(ResourceBase_WebGPU);
|
|
17920
18006
|
|
|
17921
18007
|
var QueryPool_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
17922
|
-
_inheritsLoose$
|
|
18008
|
+
_inheritsLoose$5(QueryPool_WebGPU, _ResourceBase_WebGPU);
|
|
17923
18009
|
|
|
17924
18010
|
function QueryPool_WebGPU(_ref) {
|
|
17925
18011
|
var _this;
|
|
@@ -17952,7 +18038,7 @@
|
|
|
17952
18038
|
}(ResourceBase_WebGPU);
|
|
17953
18039
|
|
|
17954
18040
|
var Readback_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
17955
|
-
_inheritsLoose$
|
|
18041
|
+
_inheritsLoose$5(Readback_WebGPU, _ResourceBase_WebGPU);
|
|
17956
18042
|
|
|
17957
18043
|
function Readback_WebGPU(_ref) {
|
|
17958
18044
|
var _this;
|
|
@@ -18553,7 +18639,7 @@
|
|
|
18553
18639
|
}();
|
|
18554
18640
|
|
|
18555
18641
|
var RenderPipeline_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
18556
|
-
_inheritsLoose$
|
|
18642
|
+
_inheritsLoose$5(RenderPipeline_WebGPU, _ResourceBase_WebGPU);
|
|
18557
18643
|
|
|
18558
18644
|
function RenderPipeline_WebGPU(_ref) {
|
|
18559
18645
|
var _this;
|
|
@@ -18587,7 +18673,7 @@
|
|
|
18587
18673
|
}(ResourceBase_WebGPU);
|
|
18588
18674
|
|
|
18589
18675
|
var Sampler_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
18590
|
-
_inheritsLoose$
|
|
18676
|
+
_inheritsLoose$5(Sampler_WebGPU, _ResourceBase_WebGPU); // @see https://www.w3.org/TR/webgpu/#gpusampler
|
|
18591
18677
|
|
|
18592
18678
|
|
|
18593
18679
|
function Sampler_WebGPU(_ref) {
|
|
@@ -18626,7 +18712,7 @@
|
|
|
18626
18712
|
}(ResourceBase_WebGPU);
|
|
18627
18713
|
|
|
18628
18714
|
var Texture_WebGPU = /*#__PURE__*/function (_ResourceBase_WebGPU) {
|
|
18629
|
-
_inheritsLoose$
|
|
18715
|
+
_inheritsLoose$5(Texture_WebGPU, _ResourceBase_WebGPU);
|
|
18630
18716
|
|
|
18631
18717
|
function Texture_WebGPU(_ref) {
|
|
18632
18718
|
var _this;
|
|
@@ -19391,33 +19477,39 @@
|
|
|
19391
19477
|
register(WebGPUDeviceContribution);
|
|
19392
19478
|
});
|
|
19393
19479
|
|
|
19394
|
-
var Plugin$4 = /*#__PURE__*/function () {
|
|
19480
|
+
var Plugin$4 = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
19481
|
+
_inheritsLoose$5(Plugin, _AbstractRendererPlug);
|
|
19482
|
+
|
|
19395
19483
|
function Plugin(options) {
|
|
19484
|
+
var _this;
|
|
19485
|
+
|
|
19396
19486
|
if (options === void 0) {
|
|
19397
19487
|
options = {};
|
|
19398
19488
|
}
|
|
19399
19489
|
|
|
19400
|
-
|
|
19401
|
-
|
|
19402
|
-
|
|
19490
|
+
_this = _AbstractRendererPlug.call(this) || this;
|
|
19491
|
+
_this.options = void 0;
|
|
19492
|
+
_this.name = 'webgpu-device';
|
|
19493
|
+
_this.options = options;
|
|
19494
|
+
return _this;
|
|
19403
19495
|
}
|
|
19404
19496
|
|
|
19405
19497
|
var _proto = Plugin.prototype;
|
|
19406
19498
|
|
|
19407
|
-
_proto.init = function init(
|
|
19408
|
-
container.register(WebGPUDeviceOptions, {
|
|
19499
|
+
_proto.init = function init() {
|
|
19500
|
+
this.container.register(WebGPUDeviceOptions, {
|
|
19409
19501
|
useValue: _extends$1({}, this.options)
|
|
19410
19502
|
});
|
|
19411
|
-
container.load(containerModule$4, true);
|
|
19503
|
+
this.container.load(containerModule$4, true);
|
|
19412
19504
|
};
|
|
19413
19505
|
|
|
19414
|
-
_proto.destroy = function destroy(
|
|
19415
|
-
container.remove(WebGPUDeviceOptions);
|
|
19416
|
-
container.unload(containerModule$4);
|
|
19506
|
+
_proto.destroy = function destroy() {
|
|
19507
|
+
this.container.remove(WebGPUDeviceOptions);
|
|
19508
|
+
this.container.unload(containerModule$4);
|
|
19417
19509
|
};
|
|
19418
19510
|
|
|
19419
19511
|
return Plugin;
|
|
19420
|
-
}();
|
|
19512
|
+
}(g.AbstractRendererPlugin);
|
|
19421
19513
|
|
|
19422
19514
|
var index_esm$3 = /*#__PURE__*/Object.freeze({
|
|
19423
19515
|
__proto__: null,
|
|
@@ -19577,29 +19669,35 @@
|
|
|
19577
19669
|
*/
|
|
19578
19670
|
register(WebGPUContextService);
|
|
19579
19671
|
});
|
|
19580
|
-
var ContextRegisterPlugin = /*#__PURE__*/function () {
|
|
19672
|
+
var ContextRegisterPlugin = /*#__PURE__*/function (_AbstractRendererPlug) {
|
|
19673
|
+
_inheritsLoose(ContextRegisterPlugin, _AbstractRendererPlug);
|
|
19674
|
+
|
|
19581
19675
|
function ContextRegisterPlugin(rendererPlugin) {
|
|
19582
|
-
|
|
19583
|
-
|
|
19584
|
-
|
|
19676
|
+
var _this;
|
|
19677
|
+
|
|
19678
|
+
_this = _AbstractRendererPlug.call(this) || this;
|
|
19679
|
+
_this.rendererPlugin = void 0;
|
|
19680
|
+
_this.name = 'webgpu-context-register';
|
|
19681
|
+
_this.rendererPlugin = rendererPlugin;
|
|
19682
|
+
return _this;
|
|
19585
19683
|
}
|
|
19586
19684
|
|
|
19587
19685
|
var _proto = ContextRegisterPlugin.prototype;
|
|
19588
19686
|
|
|
19589
|
-
_proto.init = function init(
|
|
19590
|
-
container.register(DeviceRendererPlugin, {
|
|
19687
|
+
_proto.init = function init() {
|
|
19688
|
+
this.container.register(DeviceRendererPlugin, {
|
|
19591
19689
|
useValue: this.rendererPlugin
|
|
19592
19690
|
});
|
|
19593
|
-
container.load(containerModule$5, true);
|
|
19691
|
+
this.container.load(containerModule$5, true);
|
|
19594
19692
|
};
|
|
19595
19693
|
|
|
19596
|
-
_proto.destroy = function destroy(
|
|
19597
|
-
container.unload(containerModule$5);
|
|
19598
|
-
container.remove(DeviceRendererPlugin);
|
|
19694
|
+
_proto.destroy = function destroy() {
|
|
19695
|
+
this.container.unload(containerModule$5);
|
|
19696
|
+
this.container.remove(DeviceRendererPlugin);
|
|
19599
19697
|
};
|
|
19600
19698
|
|
|
19601
19699
|
return ContextRegisterPlugin;
|
|
19602
|
-
}();
|
|
19700
|
+
}(g.AbstractRendererPlugin);
|
|
19603
19701
|
|
|
19604
19702
|
var Renderer = /*#__PURE__*/function (_AbstractRenderer) {
|
|
19605
19703
|
_inheritsLoose(Renderer, _AbstractRenderer);
|