@luma.gl/webgl 8.5.12 → 8.5.15

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/dist.js CHANGED
@@ -345,7 +345,7 @@ __webpack_require__.r(__webpack_exports__);
345
345
 
346
346
 
347
347
 
348
- const VERSION = true ? "8.5.11" : undefined;
348
+ const VERSION = true ? "8.5.14" : undefined;
349
349
  const isBrowser = Object(_lib_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"])();
350
350
  //# sourceMappingURL=globals.js.map
351
351
 
@@ -1563,7 +1563,7 @@ __webpack_require__.r(__webpack_exports__);
1563
1563
 
1564
1564
 
1565
1565
 
1566
- const VERSION = true ? "8.5.11" : undefined;
1566
+ const VERSION = true ? "8.5.14" : undefined;
1567
1567
  const isBrowser = Object(_env_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"])();
1568
1568
  //# sourceMappingURL=globals.js.map
1569
1569
 
@@ -7989,6 +7989,7 @@ class Resource {
7989
7989
  // Only meaningful for resources that allocate GPU memory
7990
7990
  this.byteLength = 0;
7991
7991
 
7992
+ this._initStats();
7992
7993
  this._addStats();
7993
7994
  }
7994
7995
 
@@ -8223,6 +8224,10 @@ class Resource {
8223
8224
  return this.gl.luma;
8224
8225
  }
8225
8226
 
8227
+ _initStats() {
8228
+ this.gl.stats = this.gl.stats || new _init__WEBPACK_IMPORTED_MODULE_1__["StatsManager"]();
8229
+ }
8230
+
8226
8231
  _addStats() {
8227
8232
  const name = this[Symbol.toStringTag];
8228
8233
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Resource Counts');
@@ -8240,16 +8245,29 @@ class Resource {
8240
8245
  }
8241
8246
 
8242
8247
  _trackAllocatedMemory(bytes, name = this[Symbol.toStringTag]) {
8243
- const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Memory Usage');
8248
+ this._doTrackAllocatedMemory(bytes, name);
8249
+ this._doTrackAllocatedMemory(bytes, name, this.gl.stats.get(`Memory Usage`));
8250
+ }
8244
8251
 
8252
+ _doTrackAllocatedMemory(
8253
+ bytes,
8254
+ name = this[Symbol.toStringTag],
8255
+ stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get(`Memory Usage`)
8256
+ ) {
8245
8257
  stats.get('GPU Memory').addCount(bytes);
8246
8258
  stats.get(`${name} Memory`).addCount(bytes);
8247
8259
  this.byteLength = bytes;
8248
8260
  }
8249
8261
 
8250
8262
  _trackDeallocatedMemory(name = this[Symbol.toStringTag]) {
8251
- const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Memory Usage');
8263
+ this._doTrackDeallocatedMemory(name);
8264
+ this._doTrackDeallocatedMemory(name, this.gl.stats.get(`Memory Usage`));
8265
+ }
8252
8266
 
8267
+ _doTrackDeallocatedMemory(
8268
+ name = this[Symbol.toStringTag],
8269
+ stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get(`Memory Usage`)
8270
+ ) {
8253
8271
  stats.get('GPU Memory').subtractCount(this.byteLength);
8254
8272
  stats.get(`${name} Memory`).subtractCount(this.byteLength);
8255
8273
  this.byteLength = 0;
@@ -12530,11 +12548,12 @@ __webpack_require__.r(__webpack_exports__);
12530
12548
  /*!*********************!*\
12531
12549
  !*** ./src/init.js ***!
12532
12550
  \*********************/
12533
- /*! exports provided: lumaStats, default */
12551
+ /*! exports provided: StatsManager, lumaStats, default */
12534
12552
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
12535
12553
 
12536
12554
  "use strict";
12537
12555
  __webpack_require__.r(__webpack_exports__);
12556
+ /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "StatsManager", function() { return StatsManager; });
12538
12557
  /* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "lumaStats", function() { return lumaStats; });
12539
12558
  /* harmony import */ var _luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @luma.gl/gltools */ "../gltools/src/index.js");
12540
12559
  /* harmony import */ var probe_gl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! probe.gl */ "../../node_modules/probe.gl/dist/esm/index.js");
@@ -12546,7 +12565,7 @@ __webpack_require__.r(__webpack_exports__);
12546
12565
  // Version detection using babel plugin
12547
12566
  /* global __VERSION__ */
12548
12567
  // @ts-ignore
12549
- const VERSION = true ? "8.5.11" : undefined;
12568
+ const VERSION = true ? "8.5.14" : undefined;
12550
12569
 
12551
12570
  const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
12552
12571
  // Assign luma.log.level in console to control logging: \