@luma.gl/core 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
 
@@ -24021,6 +24021,10 @@ const PROP_CHECKS_SET_PROPS = {
24021
24021
  };
24022
24022
 
24023
24023
  class Buffer extends _resource__WEBPACK_IMPORTED_MODULE_1__["default"] {
24024
+ // eslint-disable-next-line accessor-pairs
24025
+ get [Symbol.toStringTag]() {
24026
+ return 'Buffer';
24027
+ }
24024
24028
  constructor(gl, props = {}) {
24025
24029
  super(gl, props);
24026
24030
 
@@ -24943,6 +24947,10 @@ __webpack_require__.r(__webpack_exports__);
24943
24947
  const ERR_MULTIPLE_RENDERTARGETS = 'Multiple render targets not supported';
24944
24948
 
24945
24949
  class Framebuffer extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
24950
+ // eslint-disable-next-line accessor-pairs
24951
+ get [Symbol.toStringTag]() {
24952
+ return 'Framebuffer';
24953
+ }
24946
24954
  static isSupported(gl, options = {}) {
24947
24955
  const {
24948
24956
  colorBufferFloat, // Whether floating point textures can be rendered and read
@@ -25838,6 +25846,10 @@ const V6_DEPRECATED_METHODS = [
25838
25846
  ];
25839
25847
 
25840
25848
  class Program extends _resource__WEBPACK_IMPORTED_MODULE_1__["default"] {
25849
+ // eslint-disable-next-line accessor-pairs
25850
+ get [Symbol.toStringTag]() {
25851
+ return 'Program';
25852
+ }
25841
25853
  constructor(gl, props = {}) {
25842
25854
  super(gl, props);
25843
25855
 
@@ -26229,6 +26241,10 @@ const GL_ANY_SAMPLES_PASSED = 0x8c2f; // Occlusion query (if drawing passed dept
26229
26241
  const GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8d6a; // Occlusion query less accurate/faster version
26230
26242
 
26231
26243
  class Query extends _resource__WEBPACK_IMPORTED_MODULE_0__["default"] {
26244
+ // eslint-disable-next-line accessor-pairs
26245
+ get [Symbol.toStringTag]() {
26246
+ return 'Query';
26247
+ }
26232
26248
  // Returns true if Query is supported by the WebGL implementation
26233
26249
  // Can also check whether timestamp queries are available.
26234
26250
  static isSupported(gl, opts = []) {
@@ -26494,6 +26510,10 @@ function isFormatSupported(gl, format, formats) {
26494
26510
  }
26495
26511
 
26496
26512
  class Renderbuffer extends _resource__WEBPACK_IMPORTED_MODULE_1__["default"] {
26513
+ // eslint-disable-next-line accessor-pairs
26514
+ get [Symbol.toStringTag]() {
26515
+ return 'Renderbuffer';
26516
+ }
26497
26517
  static isSupported(gl, {format} = {format: null}) {
26498
26518
  return !format || isFormatSupported(gl, format, _renderbuffer_formats__WEBPACK_IMPORTED_MODULE_2__["default"]);
26499
26519
  }
@@ -26614,6 +26634,10 @@ const ERR_RESOURCE_METHOD_UNDEFINED = 'Resource subclass must define virtual met
26614
26634
  // }
26615
26635
 
26616
26636
  class Resource {
26637
+ // eslint-disable-next-line accessor-pairs
26638
+ get [Symbol.toStringTag]() {
26639
+ return 'Resource';
26640
+ }
26617
26641
  constructor(gl, opts = {}) {
26618
26642
  Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_0__["assertWebGLContext"])(gl);
26619
26643
 
@@ -26622,7 +26646,7 @@ class Resource {
26622
26646
  // @ts-ignore
26623
26647
  this.gl2 = gl;
26624
26648
  // this.ext = polyfillContext(gl);
26625
- this.id = id || Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["uid"])(this.constructor.name);
26649
+ this.id = id || Object(_utils_utils__WEBPACK_IMPORTED_MODULE_4__["uid"])(this[Symbol.toStringTag]);
26626
26650
  this.userData = userData;
26627
26651
  this._bound = false;
26628
26652
 
@@ -26645,7 +26669,7 @@ class Resource {
26645
26669
  }
26646
26670
 
26647
26671
  toString() {
26648
- return `${this.constructor.name}(${this.id})`;
26672
+ return `${this[Symbol.toStringTag] || this.constructor.name}(${this.id})`;
26649
26673
  }
26650
26674
 
26651
26675
  get handle() {
@@ -26876,7 +26900,7 @@ class Resource {
26876
26900
  }
26877
26901
 
26878
26902
  _addStats() {
26879
- const name = this.constructor.name;
26903
+ const name = this[Symbol.toStringTag];
26880
26904
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Resource Counts');
26881
26905
 
26882
26906
  stats.get('Resources Created').incrementCount();
@@ -26885,13 +26909,13 @@ class Resource {
26885
26909
  }
26886
26910
 
26887
26911
  _removeStats() {
26888
- const name = this.constructor.name;
26912
+ const name = this[Symbol.toStringTag];
26889
26913
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Resource Counts');
26890
26914
 
26891
26915
  stats.get(`${name}s Active`).decrementCount();
26892
26916
  }
26893
26917
 
26894
- _trackAllocatedMemory(bytes, name = this.constructor.name) {
26918
+ _trackAllocatedMemory(bytes, name = this[Symbol.toStringTag]) {
26895
26919
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Memory Usage');
26896
26920
 
26897
26921
  stats.get('GPU Memory').addCount(bytes);
@@ -26899,7 +26923,7 @@ class Resource {
26899
26923
  this.byteLength = bytes;
26900
26924
  }
26901
26925
 
26902
- _trackDeallocatedMemory(name = this.constructor.name) {
26926
+ _trackDeallocatedMemory(name = this[Symbol.toStringTag]) {
26903
26927
  const stats = _init__WEBPACK_IMPORTED_MODULE_1__["lumaStats"].get('Memory Usage');
26904
26928
 
26905
26929
  stats.get('GPU Memory').subtractCount(this.byteLength);
@@ -26940,6 +26964,11 @@ const ERR_SOURCE = 'Shader: GLSL source code must be a JavaScript string';
26940
26964
 
26941
26965
  // For now this is an internal class
26942
26966
  class Shader extends _resource__WEBPACK_IMPORTED_MODULE_5__["default"] {
26967
+ // eslint-disable-next-line accessor-pairs
26968
+ get [Symbol.toStringTag]() {
26969
+ return 'Shader';
26970
+ }
26971
+
26943
26972
  static getTypeName(shaderType) {
26944
26973
  switch (shaderType) {
26945
26974
  case _luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["default"].VERTEX_SHADER:
@@ -27047,6 +27076,11 @@ class Shader extends _resource__WEBPACK_IMPORTED_MODULE_5__["default"] {
27047
27076
  }
27048
27077
 
27049
27078
  class VertexShader extends Shader {
27079
+ // eslint-disable-next-line accessor-pairs
27080
+ get [Symbol.toStringTag]() {
27081
+ return 'VertexShader';
27082
+ }
27083
+
27050
27084
  constructor(gl, props) {
27051
27085
  // Signature: new VertexShader(gl, source)
27052
27086
  if (typeof props === 'string') {
@@ -27062,6 +27096,10 @@ class VertexShader extends Shader {
27062
27096
  }
27063
27097
 
27064
27098
  class FragmentShader extends Shader {
27099
+ // eslint-disable-next-line accessor-pairs
27100
+ get [Symbol.toStringTag]() {
27101
+ return 'FragmentShader';
27102
+ }
27065
27103
  constructor(gl, props) {
27066
27104
  // Signature: new FragmentShader(gl, source)
27067
27105
  if (typeof props === 'string') {
@@ -27100,6 +27138,11 @@ __webpack_require__.r(__webpack_exports__);
27100
27138
 
27101
27139
 
27102
27140
  class Texture2D extends _texture__WEBPACK_IMPORTED_MODULE_2__["default"] {
27141
+ // eslint-disable-next-line accessor-pairs
27142
+ get [Symbol.toStringTag]() {
27143
+ return 'Texture2D';
27144
+ }
27145
+
27103
27146
  static isSupported(gl, opts) {
27104
27147
  return _texture__WEBPACK_IMPORTED_MODULE_2__["default"].isSupported(gl, opts);
27105
27148
  }
@@ -27150,6 +27193,11 @@ __webpack_require__.r(__webpack_exports__);
27150
27193
 
27151
27194
 
27152
27195
  class Texture3D extends _texture__WEBPACK_IMPORTED_MODULE_2__["default"] {
27196
+ // eslint-disable-next-line accessor-pairs
27197
+ get [Symbol.toStringTag]() {
27198
+ return 'Texture3D';
27199
+ }
27200
+
27153
27201
  static isSupported(gl) {
27154
27202
  return Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_1__["isWebGL2"])(gl);
27155
27203
  }
@@ -27267,6 +27315,11 @@ const FACES = [
27267
27315
  ];
27268
27316
 
27269
27317
  class TextureCube extends _texture__WEBPACK_IMPORTED_MODULE_2__["default"] {
27318
+ // eslint-disable-next-line accessor-pairs
27319
+ get [Symbol.toStringTag]() {
27320
+ return 'TextureCube';
27321
+ }
27322
+
27270
27323
  constructor(gl, props = {}) {
27271
27324
  Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_1__["assertWebGLContext"])(gl);
27272
27325
 
@@ -27618,6 +27671,10 @@ const NPOT_MIN_FILTERS = [_luma_gl_constants__WEBPACK_IMPORTED_MODULE_0__["defau
27618
27671
  const WebGLBuffer = globalThis.WebGLBuffer || function WebGLBuffer() {};
27619
27672
 
27620
27673
  class Texture extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
27674
+ // eslint-disable-next-line accessor-pairs
27675
+ get [Symbol.toStringTag]() {
27676
+ return 'Texture';
27677
+ }
27621
27678
  static isSupported(gl, opts = {}) {
27622
27679
  const {format, linearFiltering} = opts;
27623
27680
  let supported = true;
@@ -27906,6 +27963,8 @@ class Texture extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
27906
27963
 
27907
27964
  let gl2;
27908
27965
 
27966
+ let compressedTextureSize = 0;
27967
+
27909
27968
  Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_1__["withParameters"])(this.gl, parameters, () => {
27910
27969
  switch (dataType) {
27911
27970
  case 'null':
@@ -27954,15 +28013,17 @@ class Texture extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
27954
28013
  border,
27955
28014
  levelData.data
27956
28015
  );
28016
+ compressedTextureSize += levelData.levelSize;
27957
28017
  }
27958
-
27959
28018
  break;
27960
28019
  default:
27961
28020
  Object(_utils_assert__WEBPACK_IMPORTED_MODULE_5__["assert"])(false, 'Unknown image data type');
27962
28021
  }
27963
28022
  });
27964
28023
 
27965
- if (data && data.byteLength) {
28024
+ if (dataType === 'compressed') {
28025
+ this._trackAllocatedMemory(compressedTextureSize, 'Texture');
28026
+ } else if (data && data.byteLength) {
27966
28027
  this._trackAllocatedMemory(data.byteLength, 'Texture');
27967
28028
  } else {
27968
28029
  // NOTE(Tarek): Default to RGBA bytes
@@ -28422,6 +28483,10 @@ __webpack_require__.r(__webpack_exports__);
28422
28483
  // See https://github.com/KhronosGroup/WebGL/issues/2346
28423
28484
 
28424
28485
  class TransformFeedback extends _resource__WEBPACK_IMPORTED_MODULE_2__["default"] {
28486
+ // eslint-disable-next-line accessor-pairs
28487
+ get [Symbol.toStringTag]() {
28488
+ return 'TransformFeedback';
28489
+ }
28425
28490
  static isSupported(gl) {
28426
28491
  return Object(_luma_gl_gltools__WEBPACK_IMPORTED_MODULE_1__["isWebGL2"])(gl);
28427
28492
  }
@@ -29122,6 +29187,10 @@ __webpack_require__.r(__webpack_exports__);
29122
29187
  const ERR_ELEMENTS = 'elements must be GL.ELEMENT_ARRAY_BUFFER';
29123
29188
 
29124
29189
  class VertexArrayObject extends _resource__WEBPACK_IMPORTED_MODULE_1__["default"] {
29190
+ // eslint-disable-next-line accessor-pairs
29191
+ get [Symbol.toStringTag]() {
29192
+ return 'VertexArrayObject';
29193
+ }
29125
29194
  static isSupported(gl, options = {}) {
29126
29195
  // Attribute 0 can not be disable on most desktop OpenGL based browsers
29127
29196
  // and on iOS Safari browser.
@@ -31153,7 +31222,7 @@ __webpack_require__.r(__webpack_exports__);
31153
31222
  // Version detection using babel plugin
31154
31223
  /* global __VERSION__ */
31155
31224
  // @ts-ignore
31156
- const VERSION = true ? "8.5.10" : undefined;
31225
+ const VERSION = true ? "8.5.13" : undefined;
31157
31226
 
31158
31227
  const STARTUP_MESSAGE = 'set luma.log.level=1 (or higher) to trace rendering';
31159
31228
  // Assign luma.log.level in console to control logging: \