@luma.gl/engine 9.0.0-alpha.51 → 9.0.0-alpha.53

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.
@@ -0,0 +1,9 @@
1
+ import type { ShaderLayout } from '@luma.gl/core';
2
+ /**
3
+ * Extracts a table suitable for `console.table()` from a shader layout to assist in debugging.
4
+ * @param layout shader layout
5
+ * @param name app should provide the most meaningful name, usually the model or pipeline name / id.
6
+ * @returns
7
+ */
8
+ export declare function getDebugTableForShaderLayout(layout: ShaderLayout, name?: string): Record<string, Record<string, string>>;
9
+ //# sourceMappingURL=debug-shader-layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-shader-layout.d.ts","sourceRoot":"","sources":["../../src/debug/debug-shader-layout.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,eAAe,CAAC;AAEhD;;;;;GAKG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,YAAY,EACpB,IAAI,GAAE,MAAW,GAChB,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAkBxC"}
@@ -0,0 +1,21 @@
1
+ export function getDebugTableForShaderLayout(layout) {
2
+ let name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
3
+ const table = {};
4
+ const header = `Shader Layout for ${name}`;
5
+ for (const attributeDeclaration of layout.attributes) {
6
+ if (attributeDeclaration) {
7
+ const glslDeclaration = `${attributeDeclaration.location} ${attributeDeclaration.name}: ${attributeDeclaration.type}`;
8
+ table[`in ${glslDeclaration}`] = {
9
+ [header]: attributeDeclaration.stepMode || 'vertex'
10
+ };
11
+ }
12
+ }
13
+ for (const varyingDeclaration of layout.varyings || []) {
14
+ const glslDeclaration = `${varyingDeclaration.location} ${varyingDeclaration.name}`;
15
+ table[`out ${glslDeclaration}`] = {
16
+ [header]: JSON.stringify(varyingDeclaration.accessor)
17
+ };
18
+ }
19
+ return table;
20
+ }
21
+ //# sourceMappingURL=debug-shader-layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-shader-layout.js","names":["getDebugTableForShaderLayout","layout","name","arguments","length","undefined","table","header","attributeDeclaration","attributes","glslDeclaration","location","type","stepMode","varyingDeclaration","varyings","JSON","stringify","accessor"],"sources":["../../src/debug/debug-shader-layout.ts"],"sourcesContent":["// luma.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\n\nimport type {ShaderLayout} from '@luma.gl/core';\n\n/**\n * Extracts a table suitable for `console.table()` from a shader layout to assist in debugging.\n * @param layout shader layout\n * @param name app should provide the most meaningful name, usually the model or pipeline name / id.\n * @returns \n */\nexport function getDebugTableForShaderLayout(\n layout: ShaderLayout,\n name: string = ''\n): Record<string, Record<string, string>> {\n const table: Record<string, Record<string, string>> = {};\n\n const header = `Shader Layout for ${name}`;\n\n for (const attributeDeclaration of layout.attributes) {\n if (attributeDeclaration) {\n const glslDeclaration = `${attributeDeclaration.location} ${attributeDeclaration.name}: ${attributeDeclaration.type}`;\n table[`in ${glslDeclaration}`] = {[header]: attributeDeclaration.stepMode || 'vertex'};\n }\n }\n\n for (const varyingDeclaration of layout.varyings || []) {\n const glslDeclaration = `${varyingDeclaration.location} ${varyingDeclaration.name}`;\n table[`out ${glslDeclaration}`] = {[header]: JSON.stringify(varyingDeclaration.accessor)};\n }\n\n return table;\n}\n"],"mappings":"AAYA,OAAO,SAASA,4BAA4BA,CAC1CC,MAAoB,EAEoB;EAAA,IADxCC,IAAY,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,EAAE;EAEjB,MAAMG,KAA6C,GAAG,CAAC,CAAC;EAExD,MAAMC,MAAM,GAAI,qBAAoBL,IAAK,EAAC;EAE1C,KAAK,MAAMM,oBAAoB,IAAIP,MAAM,CAACQ,UAAU,EAAE;IACpD,IAAID,oBAAoB,EAAE;MACxB,MAAME,eAAe,GAAI,GAAEF,oBAAoB,CAACG,QAAS,IAAGH,oBAAoB,CAACN,IAAK,KAAIM,oBAAoB,CAACI,IAAK,EAAC;MACrHN,KAAK,CAAE,MAAKI,eAAgB,EAAC,CAAC,GAAG;QAAC,CAACH,MAAM,GAAGC,oBAAoB,CAACK,QAAQ,IAAI;MAAQ,CAAC;IACxF;EACF;EAEA,KAAK,MAAMC,kBAAkB,IAAIb,MAAM,CAACc,QAAQ,IAAI,EAAE,EAAE;IACtD,MAAML,eAAe,GAAI,GAAEI,kBAAkB,CAACH,QAAS,IAAGG,kBAAkB,CAACZ,IAAK,EAAC;IACnFI,KAAK,CAAE,OAAMI,eAAgB,EAAC,CAAC,GAAG;MAAC,CAACH,MAAM,GAAGS,IAAI,CAACC,SAAS,CAACH,kBAAkB,CAACI,QAAQ;IAAC,CAAC;EAC3F;EAEA,OAAOZ,KAAK;AACd"}
package/dist/dist.dev.js CHANGED
@@ -764,7 +764,7 @@ var __exports__ = (() => {
764
764
  id: "@probe.gl/log"
765
765
  });
766
766
 
767
- // ../core/src/lib/utils/log.ts
767
+ // ../core/src/utils/log.ts
768
768
  var log = new Log({
769
769
  id: "luma.gl"
770
770
  });
@@ -960,7 +960,7 @@ var __exports__ = (() => {
960
960
  }
961
961
  };
962
962
 
963
- // ../core/src/lib/utils/stats-manager.ts
963
+ // ../core/src/utils/stats-manager.ts
964
964
  var StatsManager = class {
965
965
  stats = /* @__PURE__ */ new Map();
966
966
  getStats(name2) {
@@ -979,14 +979,14 @@ var __exports__ = (() => {
979
979
 
980
980
  // ../core/src/init.ts
981
981
  function initializeLuma() {
982
- const VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "untranspiled source";
982
+ const VERSION3 = typeof __VERSION__ !== "undefined" ? __VERSION__ : "running from source";
983
983
  const STARTUP_MESSAGE = "set luma.log.level=1 (or higher) to trace rendering";
984
984
  if (globalThis.luma && globalThis.luma.VERSION !== VERSION3) {
985
985
  throw new Error(`luma.gl - multiple VERSIONs detected: ${globalThis.luma.VERSION} vs ${VERSION3}`);
986
986
  }
987
987
  if (!globalThis.luma) {
988
988
  if (isBrowser()) {
989
- log.log(1, `luma.gl ${VERSION3} - ${STARTUP_MESSAGE}`)();
989
+ log.log(1, `${VERSION3} - ${STARTUP_MESSAGE}`)();
990
990
  }
991
991
  globalThis.luma = globalThis.luma || {
992
992
  VERSION: VERSION3,
@@ -999,7 +999,7 @@ var __exports__ = (() => {
999
999
  }
1000
1000
  var VERSION2 = initializeLuma();
1001
1001
 
1002
- // ../core/src/lib/utils/is-array.ts
1002
+ // ../core/src/utils/is-array.ts
1003
1003
  function isTypedArray(value) {
1004
1004
  return ArrayBuffer.isView(value) && !(value instanceof DataView) ? value : null;
1005
1005
  }
@@ -1010,7 +1010,7 @@ var __exports__ = (() => {
1010
1010
  return isTypedArray(value);
1011
1011
  }
1012
1012
 
1013
- // ../core/src/lib/utils/utils.ts
1013
+ // ../core/src/utils/utils.ts
1014
1014
  var uidCounters = {};
1015
1015
  function uid(id = "id") {
1016
1016
  uidCounters[id] = uidCounters[id] || 1;
@@ -1237,6 +1237,13 @@ var __exports__ = (() => {
1237
1237
  });
1238
1238
  __publicField(Device, "VERSION", VERSION2);
1239
1239
 
1240
+ // ../core/src/utils/assert.ts
1241
+ function assert2(condition, message) {
1242
+ if (!condition) {
1243
+ throw new Error(message || "luma.gl: assertion failed.");
1244
+ }
1245
+ }
1246
+
1240
1247
  // ../core/src/lib/luma.ts
1241
1248
  var deviceList = /* @__PURE__ */ new Map();
1242
1249
  var luma = class {
@@ -1280,6 +1287,10 @@ var __exports__ = (() => {
1280
1287
  }
1281
1288
  break;
1282
1289
  case "best-available":
1290
+ DeviceClass = deviceList.get("webgpu");
1291
+ if (DeviceClass && DeviceClass.isSupported()) {
1292
+ return await DeviceClass.create(props);
1293
+ }
1283
1294
  DeviceClass = deviceList.get("webgl");
1284
1295
  if (DeviceClass && DeviceClass.isSupported()) {
1285
1296
  return await DeviceClass.create(props);
@@ -1553,13 +1564,6 @@ var __exports__ = (() => {
1553
1564
  return null;
1554
1565
  }
1555
1566
 
1556
- // ../core/src/lib/utils/assert.ts
1557
- function assert2(condition, message) {
1558
- if (!condition) {
1559
- throw new Error(message || "luma.gl: assertion failed.");
1560
- }
1561
- }
1562
-
1563
1567
  // ../core/src/adapter/type-utils/decode-shader-types.ts
1564
1568
  var UNIFORM_FORMATS = {
1565
1569
  "f32": {
@@ -1663,7 +1667,7 @@ var __exports__ = (() => {
1663
1667
  }
1664
1668
  }
1665
1669
 
1666
- // ../core/src/lib/utils/array-utils-flat.ts
1670
+ // ../core/src/utils/array-utils-flat.ts
1667
1671
  var arrayBuffer;
1668
1672
  function getScratchArrayBuffer(byteLength) {
1669
1673
  if (!arrayBuffer || arrayBuffer.byteLength < byteLength) {
@@ -1744,7 +1748,7 @@ var __exports__ = (() => {
1744
1748
  }
1745
1749
  };
1746
1750
 
1747
- // ../core/src/lib/utils/array-equal.ts
1751
+ // ../core/src/utils/array-equal.ts
1748
1752
  function arrayEqual(a, b, limit = 16) {
1749
1753
  if (a !== b) {
1750
1754
  return false;
@@ -1956,7 +1960,7 @@ var __exports__ = (() => {
1956
1960
  return `${dataType}x${components}`;
1957
1961
  }
1958
1962
 
1959
- // ../core/src/lib/utils/uniform.ts
1963
+ // ../core/src/lib/uniforms/uniform.ts
1960
1964
  function isUniformValue(value) {
1961
1965
  return isNumberArray(value) !== null || typeof value === "number" || typeof value === "boolean";
1962
1966
  }
@@ -1976,7 +1980,7 @@ var __exports__ = (() => {
1976
1980
  return result;
1977
1981
  }
1978
1982
 
1979
- // ../core/src/lib/utils/deep-equal.ts
1983
+ // ../core/src/utils/deep-equal.ts
1980
1984
  function deepEqual(a, b, depth) {
1981
1985
  if (a === b) {
1982
1986
  return true;
@@ -2017,7 +2021,7 @@ var __exports__ = (() => {
2017
2021
  return false;
2018
2022
  }
2019
2023
 
2020
- // ../core/src/lib/request-animation-frame.ts
2024
+ // ../core/src/utils/request-animation-frame.ts
2021
2025
  function requestAnimationFrame(callback) {
2022
2026
  return typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame(callback) : setTimeout(callback, 1e3 / 60);
2023
2027
  }
@@ -5361,6 +5365,10 @@ void main() {
5361
5365
  const moduleName = name2;
5362
5366
  const moduleProps = props[moduleName];
5363
5367
  const module = this.modules[moduleName];
5368
+ if (!module) {
5369
+ log.warn(`Module ${name2} not found`)();
5370
+ continue;
5371
+ }
5364
5372
  const oldUniforms = this.moduleUniforms[moduleName];
5365
5373
  const uniforms = module.getUniforms?.(moduleProps, this.moduleUniforms[moduleName]) || moduleProps;
5366
5374
  this.moduleUniforms[moduleName] = {
@@ -5382,6 +5390,18 @@ void main() {
5382
5390
  }
5383
5391
  return bindings;
5384
5392
  }
5393
+ getDebugTable() {
5394
+ const table = {};
5395
+ for (const [moduleName, module] of Object.entries(this.moduleUniforms)) {
5396
+ for (const [key, value] of Object.entries(module)) {
5397
+ table[`${moduleName}.${key}`] = {
5398
+ type: this.modules[moduleName].uniformTypes?.[key],
5399
+ value: String(value)
5400
+ };
5401
+ }
5402
+ }
5403
+ return table;
5404
+ }
5385
5405
  };
5386
5406
 
5387
5407
  // src/geometry/gpu-geometry.ts
@@ -5462,6 +5482,9 @@ void main() {
5462
5482
  case "TEXCOORD_0":
5463
5483
  name2 = "texCoords";
5464
5484
  break;
5485
+ case "COLOR_0":
5486
+ name2 = "colors";
5487
+ break;
5465
5488
  }
5466
5489
  attributes[name2] = device.createBuffer({
5467
5490
  data: attribute.value,
@@ -5578,7 +5601,30 @@ void main() {
5578
5601
  fs: void 0
5579
5602
  });
5580
5603
 
5604
+ // src/debug/debug-shader-layout.ts
5605
+ function getDebugTableForShaderLayout(layout, name2 = "") {
5606
+ const table = {};
5607
+ const header = `Shader Layout for ${name2}`;
5608
+ for (const attributeDeclaration of layout.attributes) {
5609
+ if (attributeDeclaration) {
5610
+ const glslDeclaration = `${attributeDeclaration.location} ${attributeDeclaration.name}: ${attributeDeclaration.type}`;
5611
+ table[`in ${glslDeclaration}`] = {
5612
+ [header]: attributeDeclaration.stepMode || "vertex"
5613
+ };
5614
+ }
5615
+ }
5616
+ for (const varyingDeclaration of layout.varyings || []) {
5617
+ const glslDeclaration = `${varyingDeclaration.location} ${varyingDeclaration.name}`;
5618
+ table[`out ${glslDeclaration}`] = {
5619
+ [header]: JSON.stringify(varyingDeclaration.accessor)
5620
+ };
5621
+ }
5622
+ return table;
5623
+ }
5624
+
5581
5625
  // src/model/model.ts
5626
+ var LOG_DRAW_PRIORITY = 2;
5627
+ var LOG_DRAW_TIMEOUT = 1e4;
5582
5628
  var _Model = class {
5583
5629
  userData = {};
5584
5630
  instanceCount = 0;
@@ -5657,7 +5703,7 @@ void main() {
5657
5703
  this.setUniforms(props.uniforms);
5658
5704
  }
5659
5705
  if (props.moduleSettings) {
5660
- console.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()");
5706
+ log.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()")();
5661
5707
  this.updateModuleSettings(props.moduleSettings);
5662
5708
  }
5663
5709
  if (props.transformFeedback) {
@@ -5674,16 +5720,21 @@ void main() {
5674
5720
  }
5675
5721
  draw(renderPass) {
5676
5722
  this.predraw();
5677
- this.pipeline = this._updatePipeline();
5678
- this.pipeline.setBindings(this.bindings);
5679
- this.pipeline.setUniforms(this.uniforms);
5680
- this.pipeline.draw({
5681
- renderPass,
5682
- vertexArray: this.vertexArray,
5683
- vertexCount: this.vertexCount,
5684
- instanceCount: this.instanceCount,
5685
- transformFeedback: this.transformFeedback
5686
- });
5723
+ try {
5724
+ this._logDrawCallStart();
5725
+ this.pipeline = this._updatePipeline();
5726
+ this.pipeline.setBindings(this.bindings);
5727
+ this.pipeline.setUniforms(this.uniforms);
5728
+ this.pipeline.draw({
5729
+ renderPass,
5730
+ vertexArray: this.vertexArray,
5731
+ vertexCount: this.vertexCount,
5732
+ instanceCount: this.instanceCount,
5733
+ transformFeedback: this.transformFeedback
5734
+ });
5735
+ } finally {
5736
+ this._logDrawCallEnd();
5737
+ }
5687
5738
  }
5688
5739
  setGeometry(geometry) {
5689
5740
  const gpuGeometry = geometry && makeGPUGeometry(this.device, geometry);
@@ -5696,7 +5747,7 @@ void main() {
5696
5747
  }
5697
5748
  _setGeometryAttributes(gpuGeometry) {
5698
5749
  this.vertexCount = gpuGeometry.vertexCount;
5699
- this.setAttributes(gpuGeometry.attributes);
5750
+ this.setAttributes(gpuGeometry.attributes, "ignore-unknown");
5700
5751
  this.setIndexBuffer(gpuGeometry.indices);
5701
5752
  }
5702
5753
  setTopology(topology) {
@@ -5740,7 +5791,7 @@ void main() {
5740
5791
  this._uniformStore.setUniforms(this.shaderInputs.getUniformValues());
5741
5792
  }
5742
5793
  updateModuleSettings(props) {
5743
- console.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()");
5794
+ log.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()")();
5744
5795
  const {
5745
5796
  bindings,
5746
5797
  uniforms
@@ -5761,9 +5812,9 @@ void main() {
5761
5812
  setTransformFeedback(transformFeedback) {
5762
5813
  this.transformFeedback = transformFeedback;
5763
5814
  }
5764
- setAttributes(buffers) {
5815
+ setAttributes(buffers, _option) {
5765
5816
  if (buffers.indices) {
5766
- log.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`);
5817
+ log.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();
5767
5818
  }
5768
5819
  for (const [bufferName, buffer] of Object.entries(buffers)) {
5769
5820
  const bufferLayout = this.bufferLayout.find((layout) => layout.name === bufferName);
@@ -5780,7 +5831,7 @@ void main() {
5780
5831
  set = true;
5781
5832
  }
5782
5833
  }
5783
- if (!set) {
5834
+ if (!set && _option !== "ignore-unknown") {
5784
5835
  log.warn(`Model(${this.id}): Ignoring buffer "${buffer.id}" for unknown attribute "${bufferName}"`)();
5785
5836
  }
5786
5837
  }
@@ -5824,6 +5875,34 @@ void main() {
5824
5875
  }
5825
5876
  return this.pipeline;
5826
5877
  }
5878
+ _lastLogTime = 0;
5879
+ _logOpen = false;
5880
+ _logDrawCallStart() {
5881
+ const logDrawTimeout = log.level > 3 ? 0 : LOG_DRAW_TIMEOUT;
5882
+ if (Date.now() - this._lastLogTime < logDrawTimeout) {
5883
+ return void 0;
5884
+ }
5885
+ this._lastLogTime = Date.now();
5886
+ this._logOpen = true;
5887
+ log.group(LOG_DRAW_PRIORITY, `>>> DRAWING MODEL ${this.id}`, {
5888
+ collapsed: log.level <= 2
5889
+ })();
5890
+ }
5891
+ _logDrawCallEnd() {
5892
+ if (this._logOpen) {
5893
+ const shaderLayoutTable = getDebugTableForShaderLayout(this.pipeline.shaderLayout);
5894
+ log.table(LOG_DRAW_PRIORITY, shaderLayoutTable)();
5895
+ const uniformTable = this.shaderInputs.getDebugTable();
5896
+ for (const [name2, value] of Object.entries(this.uniforms)) {
5897
+ uniformTable[name2] = {
5898
+ value
5899
+ };
5900
+ }
5901
+ log.table(LOG_DRAW_PRIORITY, uniformTable)();
5902
+ log.groupEnd(LOG_DRAW_PRIORITY)();
5903
+ this._logOpen = false;
5904
+ }
5905
+ }
5827
5906
  };
5828
5907
  var Model = _Model;
5829
5908
  __publicField(Model, "defaultProps", {
@@ -1 +1 @@
1
- {"version":3,"file":"gpu-geometry.d.ts","sourceRoot":"","sources":["../../src/geometry/gpu-geometry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,iBAAiB,EAAE,YAAY,EAAC,MAAM,eAAe,CAAC;AACnE,OAAO,EAAC,MAAM,EAAE,MAAM,EAA4C,MAAM,eAAe,CAAC;AACxF,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,sBAAsB,CAAC;AAEnD,MAAM,MAAM,gBAAgB,GAAG;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,oEAAoE;IACpE,QAAQ,EACJ,YAAY,GACZ,WAAW,GACX,YAAY,GACZ,iBAAiB,GACjB,eAA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,cAAc,IAAI,MAAM;IAIxB,aAAa,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;IAIvC,UAAU,IAAI,MAAM,GAAG,IAAI;IAI3B,qBAAqB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM;CAKjD;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,WAAW,GAAG,WAAW,CAc7F;AAED,wBAAgB,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,MAAM,GAAG,SAAS,CAMjG;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GACjB;IAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,YAAY,EAAE,YAAY,EAAE,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAC,CAqBzF"}
@@ -82,6 +82,9 @@ export function getAttributeBuffersFromGeometry(device, geometry) {
82
82
  case 'TEXCOORD_0':
83
83
  name = 'texCoords';
84
84
  break;
85
+ case 'COLOR_0':
86
+ name = 'colors';
87
+ break;
85
88
  }
86
89
  attributes[name] = device.createBuffer({
87
90
  data: attribute.value,
@@ -1 +1 @@
1
- {"version":3,"file":"gpu-geometry.js","names":["Buffer","uid","assert","getVertexFormatFromAttribute","GPUGeometry","constructor","props","id","userData","topology","bufferLayout","vertexCount","indices","attributes","usage","INDEX","destroy","_this$attributes$colo","positions","normals","texCoords","colors","getVertexCount","getAttributes","getIndexes","_calculateVertexCount","byteLength","makeGPUGeometry","device","geometry","getIndexBufferFromGeometry","getAttributeBuffersFromGeometry","undefined","data","value","createBuffer","attributeName","attribute","Object","entries","name","size","normalized","push","format"],"sources":["../../src/geometry/gpu-geometry.ts"],"sourcesContent":["import type {PrimitiveTopology, BufferLayout} from '@luma.gl/core';\nimport {Device, Buffer, uid, assert, getVertexFormatFromAttribute} from '@luma.gl/core';\nimport type {Geometry} from '../geometry/geometry';\n\nexport type GPUGeometryProps = {\n id?: string;\n /** Determines how vertices are read from the 'vertex' attributes */\n topology:\n | 'point-list'\n | 'line-list'\n | 'line-strip'\n | 'line-loop-webgl'\n | 'triangle-list'\n | 'triangle-strip'\n | 'triangle-fan-webgl';\n /** Auto calculated from attributes if not provided */\n vertexCount: number;\n bufferLayout: BufferLayout[];\n indices?: Buffer | null;\n attributes: Record<string, Buffer>;\n};\n\nexport class GPUGeometry {\n readonly id: string;\n userData: Record<string, unknown> = {};\n\n /** Determines how vertices are read from the 'vertex' attributes */\n readonly topology?: PrimitiveTopology;\n readonly bufferLayout: BufferLayout[] = [];\n\n readonly vertexCount: number;\n readonly indices?: Buffer | null;\n readonly attributes: Record<string, Buffer>;\n\n constructor(props: GPUGeometryProps) {\n this.id = props.id || uid('geometry');\n this.topology = props.topology;\n this.indices = props.indices || null;\n this.attributes = props.attributes;\n\n this.vertexCount = props.vertexCount;\n\n this.bufferLayout = props.bufferLayout || [];\n\n if (this.indices) {\n assert(this.indices.usage === Buffer.INDEX);\n }\n }\n\n destroy(): void {\n this.indices.destroy();\n this.attributes.positions.destroy();\n this.attributes.normals.destroy();\n this.attributes.texCoords.destroy();\n this.attributes.colors?.destroy();\n }\n\n getVertexCount(): number {\n return this.vertexCount;\n }\n\n getAttributes(): Record<string, Buffer> {\n return this.attributes;\n }\n\n getIndexes(): Buffer | null {\n return this.indices;\n }\n\n _calculateVertexCount(positions: Buffer): number {\n // Assume that positions is a fully packed float32x3 buffer\n const vertexCount = positions.byteLength / 12;\n return vertexCount;\n }\n}\n\nexport function makeGPUGeometry(device: Device, geometry: Geometry | GPUGeometry): GPUGeometry {\n if (geometry instanceof GPUGeometry) {\n return geometry;\n }\n\n const indices = getIndexBufferFromGeometry(device, geometry);\n const {attributes, bufferLayout} = getAttributeBuffersFromGeometry(device, geometry);\n return new GPUGeometry({\n topology: geometry.topology || 'triangle-list',\n bufferLayout,\n vertexCount: geometry.vertexCount,\n indices,\n attributes\n });\n}\n\nexport function getIndexBufferFromGeometry(device: Device, geometry: Geometry): Buffer | undefined {\n if (!geometry.indices) {\n return undefined;\n }\n const data = geometry.indices.value;\n return device.createBuffer({usage: Buffer.INDEX, data});\n}\n\nexport function getAttributeBuffersFromGeometry(\n device: Device,\n geometry: Geometry\n): {attributes: Record<string, Buffer>, bufferLayout: BufferLayout[], vertexCount: number} {\n const bufferLayout: BufferLayout[] = [];\n\n const attributes: Record<string, Buffer> = {};\n for (const [attributeName, attribute] of Object.entries(geometry.attributes)) {\n let name: string = attributeName;\n // TODO Map some GLTF attribute names (is this still needed?)\n switch (attributeName) {\n case 'POSITION': name = 'positions'; break;\n case 'NORMAL': name = 'normals'; break;\n case 'TEXCOORD_0': name = 'texCoords'; break;\n }\n attributes[name] = device.createBuffer({data: attribute.value, id: `${attributeName}-buffer`});\n const {value, size, normalized} = attribute;\n bufferLayout.push({name, format: getVertexFormatFromAttribute(value, size, normalized)});\n }\n\n const vertexCount = geometry._calculateVertexCount(geometry.attributes, geometry.indices)\n\n return {attributes, bufferLayout, vertexCount};\n}\n"],"mappings":"AACA,SAAgBA,MAAM,EAAEC,GAAG,EAAEC,MAAM,EAAEC,4BAA4B,QAAO,eAAe;AAqBvF,OAAO,MAAMC,WAAW,CAAC;EAYvBC,WAAWA,CAACC,KAAuB,EAAE;IAAA,KAX5BC,EAAE;IAAA,KACXC,QAAQ,GAA4B,CAAC,CAAC;IAAA,KAG7BC,QAAQ;IAAA,KACRC,YAAY,GAAmB,EAAE;IAAA,KAEjCC,WAAW;IAAA,KACXC,OAAO;IAAA,KACPC,UAAU;IAGjB,IAAI,CAACN,EAAE,GAAGD,KAAK,CAACC,EAAE,IAAIN,GAAG,CAAC,UAAU,CAAC;IACrC,IAAI,CAACQ,QAAQ,GAAGH,KAAK,CAACG,QAAQ;IAC9B,IAAI,CAACG,OAAO,GAAGN,KAAK,CAACM,OAAO,IAAI,IAAI;IACpC,IAAI,CAACC,UAAU,GA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,CAACiC,IAAI,CAAC;MAACH,IAAI;MAAEI,MAAM,EAAEzC,4BAA4B,CAAC+B,KAAK,EAAEO,IAAI,EAAEC,UAAU;IAAC,CAAC,CAAC;EAC1F;EAEA,MAAM/B,WAAW,GAAGkB,QAAQ,CAACJ,qBAAqB,CAACI,QAAQ,CAAChB,UAAU,EAAEgB,QAAQ,CAACjB,OAAO,CAAC;EAEzF,OAAO;IAACC,UAAU;IAAEH,YAAY;IAAEC;EAAW,CAAC;AAChD"}
1
+ {"version":3,"file":"gpu-geometry.js","names":["Buffer","uid","assert","getVertexFormatFromAttribute","GPUGeometry","constructor","props","id","userData","topology","bufferLayout","vertexCount","indices","attributes","usage","INDEX","destroy","_this$attributes$colo","positions","normals","texCoords","colors","getVertexCount","getAttributes","getIndexes","_calculateVertexCount","byteLength","makeGPUGeometry","device","geometry","getIndexBufferFromGeometry","getAttributeBuffersFromGeometry","undefined","data","value","createBuffer","attributeName","attribute","Object","entries","name","size","normalized","push","format"],"sources":["../../src/geometry/gpu-geometry.ts"],"sourcesContent":["import type {PrimitiveTopology, BufferLayout} from '@luma.gl/core';\nimport {Device, Buffer, uid, assert, getVertexFormatFromAttribute} from '@luma.gl/core';\nimport type {Geometry} from '../geometry/geometry';\n\nexport type GPUGeometryProps = {\n id?: string;\n /** Determines how vertices are read from the 'vertex' attributes */\n topology:\n | 'point-list'\n | 'line-list'\n | 'line-strip'\n | 'line-loop-webgl'\n | 'triangle-list'\n | 'triangle-strip'\n | 'triangle-fan-webgl';\n /** Auto calculated from attributes if not provided */\n vertexCount: number;\n bufferLayout: BufferLayout[];\n indices?: Buffer | null;\n attributes: Record<string, Buffer>;\n};\n\nexport class GPUGeometry {\n readonly id: string;\n userData: Record<string, unknown> = {};\n\n /** Determines how vertices are read from the 'vertex' attributes */\n readonly topology?: PrimitiveTopology;\n readonly bufferLayout: BufferLayout[] = [];\n\n readonly vertexCount: number;\n readonly indices?: Buffer | null;\n readonly attributes: Record<string, Buffer>;\n\n constructor(props: GPUGeometryProps) {\n this.id = props.id || uid('geometry');\n this.topology = props.topology;\n this.indices = props.indices || null;\n this.attributes = props.attributes;\n\n this.vertexCount = props.vertexCount;\n\n this.bufferLayout = props.bufferLayout || [];\n\n if (this.indices) {\n assert(this.indices.usage === Buffer.INDEX);\n }\n }\n\n destroy(): void {\n this.indices.destroy();\n this.attributes.positions.destroy();\n this.attributes.normals.destroy();\n this.attributes.texCoords.destroy();\n this.attributes.colors?.destroy();\n }\n\n getVertexCount(): number {\n return this.vertexCount;\n }\n\n getAttributes(): Record<string, Buffer> {\n return this.attributes;\n }\n\n getIndexes(): Buffer | null {\n return this.indices;\n }\n\n _calculateVertexCount(positions: Buffer): number {\n // Assume that positions is a fully packed float32x3 buffer\n const vertexCount = positions.byteLength / 12;\n return vertexCount;\n }\n}\n\nexport function makeGPUGeometry(device: Device, geometry: Geometry | GPUGeometry): GPUGeometry {\n if (geometry instanceof GPUGeometry) {\n return geometry;\n }\n\n const indices = getIndexBufferFromGeometry(device, geometry);\n const {attributes, bufferLayout} = getAttributeBuffersFromGeometry(device, geometry);\n return new GPUGeometry({\n topology: geometry.topology || 'triangle-list',\n bufferLayout,\n vertexCount: geometry.vertexCount,\n indices,\n attributes\n });\n}\n\nexport function getIndexBufferFromGeometry(device: Device, geometry: Geometry): Buffer | undefined {\n if (!geometry.indices) {\n return undefined;\n }\n const data = geometry.indices.value;\n return device.createBuffer({usage: Buffer.INDEX, data});\n}\n\nexport function getAttributeBuffersFromGeometry(\n device: Device,\n geometry: Geometry\n): {attributes: Record<string, Buffer>, bufferLayout: BufferLayout[], vertexCount: number} {\n const bufferLayout: BufferLayout[] = [];\n\n const attributes: Record<string, Buffer> = {};\n for (const [attributeName, attribute] of Object.entries(geometry.attributes)) {\n let name: string = attributeName;\n // TODO Map some GLTF attribute names (is this still needed?)\n switch (attributeName) {\n case 'POSITION': name = 'positions'; break;\n case 'NORMAL': name = 'normals'; break;\n case 'TEXCOORD_0': name = 'texCoords'; break;\n case 'COLOR_0': name = 'colors'; break;\n }\n attributes[name] = device.createBuffer({data: attribute.value, id: `${attributeName}-buffer`});\n const {value, size, normalized} = attribute;\n bufferLayout.push({name, format: getVertexFormatFromAttribute(value, size, normalized)});\n }\n\n const vertexCount = geometry._calculateVertexCount(geometry.attributes, geometry.indices)\n\n return {attributes, bufferLayout, vertexCount};\n}\n"],"mappings":"AACA,SAAgBA,MAAM,EAAEC,GAAG,EAAEC,MAAM,EAAEC,4BAA4B,QAAO,eAAe;AAqBvF,OAAO,MAAMC,WAAW,CAAC;EAYvBC,WAAWA,CAACC,KAAuB,EAAE;IAAA,KAX5BC,EAAE;IAAA,KACXC,QAAQ,GAA4B,CAAC,CAAC;IAAA,KAG7BC,QAAQ;IAAA,KACRC,YAAY,GAAmB,EAAE;IAAA,KAEjCC,WAAW;IAAA,KACXC,OAAO;IAAA,KACPC,UAAU;IAGjB,IAAI,CAACN,EAAE,GAAGD,KAAK,CAACC,EAAE,IAAIN,GAAG,CAAC,UAAU,CAAC;IACrC,IAAI,CAACQ,QAAQ,GAAGH,KAAK,CAACG,QAAQ;IAC9B,IAAI,CAACG,OAAO,GAAGN,KAAK,CAACM,OAAO,IAAI,IAAI;IACpC,IAAI,CAACC,UAAU,GAAGP,KAAK,CAACO,UAAU;IAElC,IAAI,CAACF,WAAW,GAAGL,KAAK,CAACK,WAAW;IAEpC,IAAI,CAACD,YAAY,GAAGJ,KAAK,CAACI,YAAY,IAAI,EAAE;IAE5C,IAAI,IAAI,CAACE,OAAO,EAAE;MAChBV,MAAM,CAAC,IAAI,CAACU,OAAO,CAACE,KAAK,KAAKd,MAAM,CAACe,KAAK,CAAC;IAC7C;EACF;EAEAC,OAAOA,CAAA,EAAS;IAAA,IAAAC,qBAAA;IACd,IAAI,CAACL,OAAO,CAACI,OAAO,CAAC,CAAC;IACtB,IAAI,CAACH,UAAU,CAACK,SAAS,CAACF,OAAO,CAAC,CAAC;IACnC,IAAI,CAACH,UAAU,CAACM,OAAO,CAACH,OAAO,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,EAAEd,MAAM,CAACe,KAAK;IAAEkB;EAAI,CAAC,CAAC;AACzD;AAEA,OAAO,SAASF,+BAA+BA,CAC7CH,MAAc,EACdC,QAAkB,EACuE;EACzF,MAAMnB,YAA4B,GAAG,EAAE;EAEvC,MAAMG,UAAkC,GAAG,CAAC,CAAC;EAC7C,KAAK,MAAM,CAACuB,aAAa,EAAEC,SAAS,CAAC,IAAIC,MAAM,CAACC,OAAO,CAACV,QAAQ,CAAChB,UAAU,CAAC,EAAE;IAC5E,IAAI2B,IAAY,GAAGJ,aAAa;IAEhC,QAAQA,aAAa;MACnB,KAAK,UAAU;QAAEI,IAAI,GAAG,WAAW;QAAE;MACrC,KAAK,QAAQ;QAAEA,IAAI,GAAG,SAAS;QAAE;MACjC,KAAK,YAAY;QAAEA,IAAI,GAAG,WAAW;QAAE;MACvC,KAAK,SAAS;QAAEA,IAAI,GAAG,QAAQ;QAAE;IACnC;IACA3B,UAAU,CAAC2B,IAAI,CAAC,GAAGZ,MAAM,CAACO,YAAY,CAAC;MAACF,IAAI,EAAEI,SAAS,CAACH,KAAK;MAAE3B,EAAE,EAAG,GAAE6B,aAAc;IAAQ,CAAC,CAAC;IAC9F,MAAM;MAACF,KAAK;MAAEO,IAAI;MAAEC;IAAU,CAAC,GAAGL,SAAS;IAC3C3B,YAAY,CAACiC,IAAI,CAAC;MAACH,IAAI;MAAEI,MAAM,EAAEzC,4BAA4B,CAAC+B,KAAK,EAAEO,IAAI,EAAEC,UAAU;IAAC,CAAC,CAAC;EAC1F;EAEA,MAAM/B,WAAW,GAAGkB,QAAQ,CAACJ,qBAAqB,CAACI,QAAQ,CAAChB,UAAU,EAAEgB,QAAQ,CAACjB,OAAO,CAAC;EAEzF,OAAO;IAACC,UAAU;IAAEH,YAAY;IAAEC;EAAW,CAAC;AAChD"}
package/dist/index.cjs CHANGED
@@ -666,6 +666,10 @@ var ShaderInputs = class {
666
666
  const moduleName = name;
667
667
  const moduleProps = props[moduleName];
668
668
  const module2 = this.modules[moduleName];
669
+ if (!module2) {
670
+ import_core4.log.warn(`Module ${name} not found`)();
671
+ continue;
672
+ }
669
673
  const oldUniforms = this.moduleUniforms[moduleName];
670
674
  const uniforms = ((_a = module2.getUniforms) == null ? void 0 : _a.call(module2, moduleProps, this.moduleUniforms[moduleName])) || moduleProps;
671
675
  this.moduleUniforms[moduleName] = { ...oldUniforms, ...uniforms };
@@ -694,6 +698,19 @@ var ShaderInputs = class {
694
698
  }
695
699
  return bindings;
696
700
  }
701
+ getDebugTable() {
702
+ var _a;
703
+ const table = {};
704
+ for (const [moduleName, module2] of Object.entries(this.moduleUniforms)) {
705
+ for (const [key, value] of Object.entries(module2)) {
706
+ table[`${moduleName}.${key}`] = {
707
+ type: (_a = this.modules[moduleName].uniformTypes) == null ? void 0 : _a[key],
708
+ value: String(value)
709
+ };
710
+ }
711
+ }
712
+ return table;
713
+ }
697
714
  };
698
715
 
699
716
  // src/geometry/gpu-geometry.ts
@@ -776,6 +793,9 @@ function getAttributeBuffersFromGeometry(device, geometry) {
776
793
  case "TEXCOORD_0":
777
794
  name = "texCoords";
778
795
  break;
796
+ case "COLOR_0":
797
+ name = "colors";
798
+ break;
779
799
  }
780
800
  attributes[name] = device.createBuffer({ data: attribute.value, id: `${attributeName}-buffer` });
781
801
  const { value, size, normalized } = attribute;
@@ -865,7 +885,26 @@ __publicField(PipelineFactory, "defaultProps", {
865
885
  fs: void 0
866
886
  });
867
887
 
888
+ // src/debug/debug-shader-layout.ts
889
+ function getDebugTableForShaderLayout(layout, name = "") {
890
+ const table = {};
891
+ const header = `Shader Layout for ${name}`;
892
+ for (const attributeDeclaration of layout.attributes) {
893
+ if (attributeDeclaration) {
894
+ const glslDeclaration = `${attributeDeclaration.location} ${attributeDeclaration.name}: ${attributeDeclaration.type}`;
895
+ table[`in ${glslDeclaration}`] = { [header]: attributeDeclaration.stepMode || "vertex" };
896
+ }
897
+ }
898
+ for (const varyingDeclaration of layout.varyings || []) {
899
+ const glslDeclaration = `${varyingDeclaration.location} ${varyingDeclaration.name}`;
900
+ table[`out ${glslDeclaration}`] = { [header]: JSON.stringify(varyingDeclaration.accessor) };
901
+ }
902
+ return table;
903
+ }
904
+
868
905
  // src/model/model.ts
906
+ var LOG_DRAW_PRIORITY = 2;
907
+ var LOG_DRAW_TIMEOUT = 1e4;
869
908
  var _Model = class {
870
909
  device;
871
910
  id;
@@ -969,7 +1008,7 @@ var _Model = class {
969
1008
  this.setUniforms(props.uniforms);
970
1009
  }
971
1010
  if (props.moduleSettings) {
972
- console.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()");
1011
+ import_core8.log.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()")();
973
1012
  this.updateModuleSettings(props.moduleSettings);
974
1013
  }
975
1014
  if (props.transformFeedback) {
@@ -987,16 +1026,21 @@ var _Model = class {
987
1026
  }
988
1027
  draw(renderPass) {
989
1028
  this.predraw();
990
- this.pipeline = this._updatePipeline();
991
- this.pipeline.setBindings(this.bindings);
992
- this.pipeline.setUniforms(this.uniforms);
993
- this.pipeline.draw({
994
- renderPass,
995
- vertexArray: this.vertexArray,
996
- vertexCount: this.vertexCount,
997
- instanceCount: this.instanceCount,
998
- transformFeedback: this.transformFeedback
999
- });
1029
+ try {
1030
+ this._logDrawCallStart();
1031
+ this.pipeline = this._updatePipeline();
1032
+ this.pipeline.setBindings(this.bindings);
1033
+ this.pipeline.setUniforms(this.uniforms);
1034
+ this.pipeline.draw({
1035
+ renderPass,
1036
+ vertexArray: this.vertexArray,
1037
+ vertexCount: this.vertexCount,
1038
+ instanceCount: this.instanceCount,
1039
+ transformFeedback: this.transformFeedback
1040
+ });
1041
+ } finally {
1042
+ this._logDrawCallEnd();
1043
+ }
1000
1044
  }
1001
1045
  // Update fixed fields (can trigger pipeline rebuild)
1002
1046
  /**
@@ -1020,7 +1064,7 @@ var _Model = class {
1020
1064
  */
1021
1065
  _setGeometryAttributes(gpuGeometry) {
1022
1066
  this.vertexCount = gpuGeometry.vertexCount;
1023
- this.setAttributes(gpuGeometry.attributes);
1067
+ this.setAttributes(gpuGeometry.attributes, "ignore-unknown");
1024
1068
  this.setIndexBuffer(gpuGeometry.indices);
1025
1069
  }
1026
1070
  /**
@@ -1092,7 +1136,7 @@ var _Model = class {
1092
1136
  * @deprecated Updates shader module settings (which results in uniforms being set)
1093
1137
  */
1094
1138
  updateModuleSettings(props) {
1095
- console.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()");
1139
+ import_core8.log.warn("Model.updateModuleSettings is deprecated. Use Model.shaderInputs.setProps()")();
1096
1140
  const { bindings, uniforms } = (0, import_core8.splitUniformsAndBindings)(this._getModuleUniforms(props));
1097
1141
  Object.assign(this.bindings, bindings);
1098
1142
  Object.assign(this.uniforms, uniforms);
@@ -1130,12 +1174,12 @@ var _Model = class {
1130
1174
  * Sets attributes (buffers)
1131
1175
  * @note Overrides any attributes previously set with the same name
1132
1176
  */
1133
- setAttributes(buffers) {
1177
+ setAttributes(buffers, _option) {
1134
1178
  var _a;
1135
1179
  if (buffers.indices) {
1136
1180
  import_core8.log.warn(
1137
1181
  `Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`
1138
- );
1182
+ )();
1139
1183
  }
1140
1184
  for (const [bufferName, buffer] of Object.entries(buffers)) {
1141
1185
  const bufferLayout = this.bufferLayout.find((layout) => layout.name === bufferName);
@@ -1152,7 +1196,7 @@ var _Model = class {
1152
1196
  set = true;
1153
1197
  }
1154
1198
  }
1155
- if (!set) {
1199
+ if (!set && _option !== "ignore-unknown") {
1156
1200
  import_core8.log.warn(
1157
1201
  `Model(${this.id}): Ignoring buffer "${buffer.id}" for unknown attribute "${bufferName}"`
1158
1202
  )();
@@ -1210,6 +1254,31 @@ var _Model = class {
1210
1254
  }
1211
1255
  return this.pipeline;
1212
1256
  }
1257
+ /** Throttle draw call logging */
1258
+ _lastLogTime = 0;
1259
+ _logOpen = false;
1260
+ _logDrawCallStart() {
1261
+ const logDrawTimeout = import_core8.log.level > 3 ? 0 : LOG_DRAW_TIMEOUT;
1262
+ if (Date.now() - this._lastLogTime < logDrawTimeout) {
1263
+ return void 0;
1264
+ }
1265
+ this._lastLogTime = Date.now();
1266
+ this._logOpen = true;
1267
+ import_core8.log.group(LOG_DRAW_PRIORITY, `>>> DRAWING MODEL ${this.id}`, { collapsed: import_core8.log.level <= 2 })();
1268
+ }
1269
+ _logDrawCallEnd() {
1270
+ if (this._logOpen) {
1271
+ const shaderLayoutTable = getDebugTableForShaderLayout(this.pipeline.shaderLayout);
1272
+ import_core8.log.table(LOG_DRAW_PRIORITY, shaderLayoutTable)();
1273
+ const uniformTable = this.shaderInputs.getDebugTable();
1274
+ for (const [name, value] of Object.entries(this.uniforms)) {
1275
+ uniformTable[name] = { value };
1276
+ }
1277
+ import_core8.log.table(LOG_DRAW_PRIORITY, uniformTable)();
1278
+ import_core8.log.groupEnd(LOG_DRAW_PRIORITY)();
1279
+ this._logOpen = false;
1280
+ }
1281
+ }
1213
1282
  };
1214
1283
  var Model = _Model;
1215
1284
  __publicField(Model, "defaultProps", {
@@ -174,7 +174,7 @@ export declare class Model {
174
174
  * Sets attributes (buffers)
175
175
  * @note Overrides any attributes previously set with the same name
176
176
  */
177
- setAttributes(buffers: Record<string, Buffer>): void;
177
+ setAttributes(buffers: Record<string, Buffer>, _option?: 'ignore-unknown'): void;
178
178
  /**
179
179
  * Sets constant attributes
180
180
  * @note Overrides any attributes previously set with the same name
@@ -186,6 +186,11 @@ export declare class Model {
186
186
  setConstantAttributes(attributes: Record<string, TypedArray>): void;
187
187
  _setPipelineNeedsUpdate(reason: string): void;
188
188
  _updatePipeline(): RenderPipeline;
189
+ /** Throttle draw call logging */
190
+ _lastLogTime: number;
191
+ _logOpen: boolean;
192
+ _logDrawCallStart(): void;
193
+ _logDrawCallEnd(): void;
189
194
  }
190
195
  /** Create a shadertools platform info from the Device */
191
196
  export declare function getPlatformInfo(device: Device): PlatformInfo;
@@ -1 +1 @@
1
- {"version":3,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