@luma.gl/engine 8.5.11 → 8.5.14

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
@@ -3585,7 +3585,7 @@ __webpack_require__.r(__webpack_exports__);
3585
3585
 
3586
3586
 
3587
3587
 
3588
- const VERSION = true ? "8.5.10" : undefined;
3588
+ const VERSION = true ? "8.5.13" : undefined;
3589
3589
  const isBrowser = Object(_lib_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"])();
3590
3590
  //# sourceMappingURL=globals.js.map
3591
3591
 
@@ -10580,7 +10580,7 @@ __webpack_require__.r(__webpack_exports__);
10580
10580
 
10581
10581
 
10582
10582
 
10583
- const VERSION = true ? "8.5.10" : undefined;
10583
+ const VERSION = true ? "8.5.13" : undefined;
10584
10584
  const isBrowser = Object(_env_is_browser__WEBPACK_IMPORTED_MODULE_0__["default"])();
10585
10585
  //# sourceMappingURL=globals.js.map
10586
10586
 
@@ -20331,6 +20331,10 @@ const PROP_CHECKS_SET_PROPS = {
20331
20331
  };
20332
20332
 
20333
20333
  class Buffer extends _resource__WEBPACK_IMPORTED_MODULE_1__["default"] {
20334
+ // eslint-disable-next-line accessor-pairs
20335
+ get [Symbol.toStringTag]() {
20336
+ return 'Buffer';
20337
+ }
20334
20338
  constructor(gl, props = {}) {
20335
20339
  super(gl, props);
20336
20340
 
@@ -21253,6 +21257,10 @@ __webpack_require__.r(__webpack_exports__);
21253
21257
  const ERR_MULTIPLE_RENDERTARGETS = 'Multiple render targets not supported';
21254
21258
 
21255
21259
  class Framebuffer extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
21260
+ // eslint-disable-next-line accessor-pairs
21261
+ get [Symbol.toStringTag]() {
21262
+ return 'Framebuffer';
21263
+ }
21256
21264
  static isSupported(gl, options = {}) {
21257
21265
  const {
21258
21266
  colorBufferFloat, // Whether floating point textures can be rendered and read
@@ -22148,6 +22156,10 @@ const V6_DEPRECATED_METHODS = [
22148
22156
  ];
22149
22157
 
22150
22158
  class Program extends _resource__WEBPACK_IMPORTED_MODULE_1__["default"] {
22159
+ // eslint-disable-next-line accessor-pairs
22160
+ get [Symbol.toStringTag]() {
22161
+ return 'Program';
22162
+ }
22151
22163
  constructor(gl, props = {}) {
22152
22164
  super(gl, props);
22153
22165
 
@@ -22539,6 +22551,10 @@ const GL_ANY_SAMPLES_PASSED = 0x8c2f; // Occlusion query (if drawing passed dept
22539
22551
  const GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8d6a; // Occlusion query less accurate/faster version
22540
22552
 
22541
22553
  class Query extends _resource__WEBPACK_IMPORTED_MODULE_0__["default"] {
22554
+ // eslint-disable-next-line accessor-pairs
22555
+ get [Symbol.toStringTag]() {
22556
+ return 'Query';
22557
+ }
22542
22558
  // Returns true if Query is supported by the WebGL implementation
22543
22559
  // Can also check whether timestamp queries are available.
22544
22560
  static isSupported(gl, opts = []) {
@@ -22804,6 +22820,10 @@ function isFormatSupported(gl, format, formats) {
22804
22820
  }
22805
22821
 
22806
22822
  class Renderbuffer extends _resource__WEBPACK_IMPORTED_MODULE_1__["default"] {
22823
+ // eslint-disable-next-line accessor-pairs
22824
+ get [Symbol.toStringTag]() {
22825
+ return 'Renderbuffer';
22826
+ }
22807
22827
  static isSupported(gl, {format} = {format: null}) {
22808
22828
  return !format || isFormatSupported(gl, format, _renderbuffer_formats__WEBPACK_IMPORTED_MODULE_2__["default"]);
22809
22829
  }
@@ -22924,6 +22944,10 @@ const ERR_RESOURCE_METHOD_UNDEFINED = 'Resource subclass must define virtual met
22924
22944
  // }
22925
22945
 
22926
22946
  class Resource {
22947
+ // eslint-disable-next-line accessor-pairs
22948
+ get [Symbol.toStringTag]() {
22949
+ return 'Resource';
22950
+ }
22927
22951
  constructor(gl, opts = {}) {
22928
22952
  Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__["assertWebGLContext"])(gl);
22929
22953
 
@@ -22932,7 +22956,7 @@ class Resource {
22932
22956
  // @ts-ignore
22933
22957
  this.gl2 = gl;
22934
22958
  // this.ext = polyfillContext(gl);
22935
- this.id = id || Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["uid"])(this.constructor.name);
22959
+ this.id = id || Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["uid"])(this[Symbol.toStringTag]);
22936
22960
  this.userData = userData;
22937
22961
  this._bound = false;
22938
22962
 
@@ -22955,7 +22979,7 @@ class Resource {
22955
22979
  }
22956
22980
 
22957
22981
  toString() {
22958
- return `${this.constructor.name}(${this.id})`;
22982
+ return `${this[Symbol.toStringTag] || this.constructor.name}(${this.id})`;
22959
22983
  }
22960
22984
 
22961
22985
  get handle() {
@@ -23186,7 +23210,7 @@ class Resource {
23186
23210
  }
23187
23211
 
23188
23212
  _addStats() {
23189
- const name = this.constructor.name;
23213
+ const name = this[Symbol.toStringTag];
23190
23214
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Resource Counts');
23191
23215
 
23192
23216
  stats.get('Resources Created').incrementCount();
@@ -23195,13 +23219,13 @@ class Resource {
23195
23219
  }
23196
23220
 
23197
23221
  _removeStats() {
23198
- const name = this.constructor.name;
23222
+ const name = this[Symbol.toStringTag];
23199
23223
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Resource Counts');
23200
23224
 
23201
23225
  stats.get(`${name}s Active`).decrementCount();
23202
23226
  }
23203
23227
 
23204
- _trackAllocatedMemory(bytes, name = this.constructor.name) {
23228
+ _trackAllocatedMemory(bytes, name = this[Symbol.toStringTag]) {
23205
23229
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Memory Usage');
23206
23230
 
23207
23231
  stats.get('GPU Memory').addCount(bytes);
@@ -23209,7 +23233,7 @@ class Resource {
23209
23233
  this.byteLength = bytes;
23210
23234
  }
23211
23235
 
23212
- _trackDeallocatedMemory(name = this.constructor.name) {
23236
+ _trackDeallocatedMemory(name = this[Symbol.toStringTag]) {
23213
23237
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Memory Usage');
23214
23238
 
23215
23239
  stats.get('GPU Memory').subtractCount(this.byteLength);
@@ -23250,6 +23274,11 @@ const ERR_SOURCE = 'Shader: GLSL source code must be a JavaScript string';
23250
23274
 
23251
23275
  // For now this is an internal class
23252
23276
  class Shader extends _resource__WEBPACK_IMPORTED_MODULE_5__["default"] {
23277
+ // eslint-disable-next-line accessor-pairs
23278
+ get [Symbol.toStringTag]() {
23279
+ return 'Shader';
23280
+ }
23281
+
23253
23282
  static getTypeName(shaderType) {
23254
23283
  switch (shaderType) {
23255
23284
  case _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["default"].VERTEX_SHADER:
@@ -23357,6 +23386,11 @@ class Shader extends _resource__WEBPACK_IMPORTED_MODULE_5__["default"] {
23357
23386
  }
23358
23387
 
23359
23388
  class VertexShader extends Shader {
23389
+ // eslint-disable-next-line accessor-pairs
23390
+ get [Symbol.toStringTag]() {
23391
+ return 'VertexShader';
23392
+ }
23393
+
23360
23394
  constructor(gl, props) {
23361
23395
  // Signature: new VertexShader(gl, source)
23362
23396
  if (typeof props === 'string') {
@@ -23372,6 +23406,10 @@ class VertexShader extends Shader {
23372
23406
  }
23373
23407
 
23374
23408
  class FragmentShader extends Shader {
23409
+ // eslint-disable-next-line accessor-pairs
23410
+ get [Symbol.toStringTag]() {
23411
+ return 'FragmentShader';
23412
+ }
23375
23413
  constructor(gl, props) {
23376
23414
  // Signature: new FragmentShader(gl, source)
23377
23415
  if (typeof props === 'string') {
@@ -23410,6 +23448,11 @@ __webpack_require__.r(__webpack_exports__);
23410
23448
 
23411
23449
 
23412
23450
  class Texture2D extends _texture__WEBPACK_IMPORTED_MODULE_2__["default"] {
23451
+ // eslint-disable-next-line accessor-pairs
23452
+ get [Symbol.toStringTag]() {
23453
+ return 'Texture2D';
23454
+ }
23455
+
23413
23456
  static isSupported(gl, opts) {
23414
23457
  return _texture__WEBPACK_IMPORTED_MODULE_2__["default"].isSupported(gl, opts);
23415
23458
  }
@@ -23460,6 +23503,11 @@ __webpack_require__.r(__webpack_exports__);
23460
23503
 
23461
23504
 
23462
23505
  class Texture3D extends _texture__WEBPACK_IMPORTED_MODULE_2__["default"] {
23506
+ // eslint-disable-next-line accessor-pairs
23507
+ get [Symbol.toStringTag]() {
23508
+ return 'Texture3D';
23509
+ }
23510
+
23463
23511
  static isSupported(gl) {
23464
23512
  return Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_1__["isWebGL2"])(gl);
23465
23513
  }
@@ -23577,6 +23625,11 @@ const FACES = [
23577
23625
  ];
23578
23626
 
23579
23627
  class TextureCube extends _texture__WEBPACK_IMPORTED_MODULE_2__["default"] {
23628
+ // eslint-disable-next-line accessor-pairs
23629
+ get [Symbol.toStringTag]() {
23630
+ return 'TextureCube';
23631
+ }
23632
+
23580
23633
  constructor(gl, props = {}) {
23581
23634
  Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_1__["assertWebGLContext"])(gl);
23582
23635
 
@@ -23928,6 +23981,10 @@ const NPOT_MIN_FILTERS = [_luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["defau
23928
23981
  const WebGLBuffer = globalThis.WebGLBuffer || function WebGLBuffer() {};
23929
23982
 
23930
23983
  class Texture extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
23984
+ // eslint-disable-next-line accessor-pairs
23985
+ get [Symbol.toStringTag]() {
23986
+ return 'Texture';
23987
+ }
23931
23988
  static isSupported(gl, opts = {}) {
23932
23989
  const {format, linearFiltering} = opts;
23933
23990
  let supported = true;
@@ -24216,6 +24273,8 @@ class Texture extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
24216
24273
 
24217
24274
  let gl2;
24218
24275
 
24276
+ let compressedTextureSize = 0;
24277
+
24219
24278
  Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_1__["withParameters"])(this.gl, parameters, () => {
24220
24279
  switch (dataType) {
24221
24280
  case 'null':
@@ -24264,15 +24323,17 @@ class Texture extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
24264
24323
  border,
24265
24324
  levelData.data
24266
24325
  );
24326
+ compressedTextureSize += levelData.levelSize;
24267
24327
  }
24268
-
24269
24328
  break;
24270
24329
  default:
24271
24330
  Object(_utils_assert__WEBPACK_IMPORTED_MODULE_5__["assert"])(false, 'Unknown image data type');
24272
24331
  }
24273
24332
  });
24274
24333
 
24275
- if (data && data.byteLength) {
24334
+ if (dataType === 'compressed') {
24335
+ this._trackAllocatedMemory(compressedTextureSize, 'Texture');
24336
+ } else if (data && data.byteLength) {
24276
24337
  this._trackAllocatedMemory(data.byteLength, 'Texture');
24277
24338
  } else {
24278
24339
  // NOTE(Tarek): Default to RGBA bytes
@@ -24732,6 +24793,10 @@ __webpack_require__.r(__webpack_exports__);
24732
24793
  // See https://github.com/KhronosGroup/WebGL/issues/2346
24733
24794
 
24734
24795
  class TransformFeedback extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
24796
+ // eslint-disable-next-line accessor-pairs
24797
+ get [Symbol.toStringTag]() {
24798
+ return 'TransformFeedback';
24799
+ }
24735
24800
  static isSupported(gl) {
24736
24801
  return Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_1__["isWebGL2"])(gl);
24737
24802
  }
@@ -25432,6 +25497,10 @@ __webpack_require__.r(__webpack_exports__);
25432
25497
  const ERR_ELEMENTS = 'elements must be GL.ELEMENT_ARRAY_BUFFER';
25433
25498
 
25434
25499
  class VertexArrayObject extends _resource__WEBPACK_IMPORTED_MODULE_1__["default"] {
25500
+ // eslint-disable-next-line accessor-pairs
25501
+ get [Symbol.toStringTag]() {
25502
+ return 'VertexArrayObject';
25503
+ }
25435
25504
  static isSupported(gl, options = {}) {
25436
25505
  // Attribute 0 can not be disable on most desktop OpenGL based browsers
25437
25506
  // and on iOS Safari browser.
@@ -27463,7 +27532,7 @@ __webpack_require__.r(__webpack_exports__);
27463
27532
  // Version detection using babel plugin
27464
27533
  /* global __VERSION__ */
27465
27534
  // @ts-ignore
27466
- const VERSION = true ? "8.5.10" : undefined;
27535
+ const VERSION = true ? "8.5.13" : undefined;
27467
27536
 
27468
27537
  const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
27469
27538
  // Assign luma.log.level in console to control logging: \