@luma.gl/engine 9.4.1 → 9.4.2

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.dev.js CHANGED
@@ -5336,7 +5336,7 @@ var __exports__ = (() => {
5336
5336
  instanceCount = 0;
5337
5337
  /** Vertex count */
5338
5338
  vertexCount;
5339
- /** Indexed draw count override. Undefined draws the full bound index buffer. */
5339
+ /** Indexed draw count override. Undefined uses vertexCount, then the full bound index buffer. */
5340
5340
  indexCount;
5341
5341
  /** First vertex byte offset for WebGL indexed draws or first vertex for non-indexed draws. */
5342
5342
  firstVertex;
@@ -5377,6 +5377,7 @@ var __exports__ = (() => {
5377
5377
  _needsRedraw = "initializing";
5378
5378
  _drawBlockedReason = false;
5379
5379
  _destroyed = false;
5380
+ _vertexCountSet = false;
5380
5381
  /** "Time" of last draw. Monotonically increasing timestamp */
5381
5382
  _lastDrawTimestamp = -1;
5382
5383
  _bindingTable = [];
@@ -5388,11 +5389,13 @@ var __exports__ = (() => {
5388
5389
  }
5389
5390
  constructor(device, props) {
5390
5391
  const defaultShaderAssembler = _Model.defaultProps.shaderAssembler;
5392
+ const vertexCountSet = props.vertexCount !== void 0;
5391
5393
  this.props = {
5392
5394
  ..._Model.defaultProps,
5393
5395
  ...props,
5394
5396
  shaderAssembler: props.shaderAssembler ?? (isShaderAssemblerForLanguage(defaultShaderAssembler, device.info.shadingLanguage) ? defaultShaderAssembler : import_shadertools3.ShaderAssembler.getDefaultShaderAssembler(device.info.shadingLanguage))
5395
5397
  };
5398
+ this._vertexCountSet = vertexCountSet;
5396
5399
  props = this.props;
5397
5400
  this.id = props.id || uid("model");
5398
5401
  this.device = device;
@@ -5610,7 +5613,7 @@ var __exports__ = (() => {
5610
5613
  const syncBindings = this._getBindings(shaderLayout);
5611
5614
  const syncBindGroups = this._getBindGroups(shaderLayout, syncBindings);
5612
5615
  const { indexBuffer } = this.vertexArray;
5613
- const indexCount = indexBuffer ? this.indexCount ?? indexBuffer.byteLength / (indexBuffer.indexType === "uint32" ? 4 : 2) : void 0;
5616
+ const indexCount = indexBuffer ? this.indexCount ?? (this._vertexCountSet ? this.vertexCount : indexBuffer.byteLength / (indexBuffer.indexType === "uint32" ? 4 : 2)) : void 0;
5614
5617
  renderPass.setPipeline(this.pipeline);
5615
5618
  renderPass.setBindings(syncBindGroups, {
5616
5619
  _bindGroupCacheKeys: this._getBindGroupCacheKeys()
@@ -5733,6 +5736,7 @@ var __exports__ = (() => {
5733
5736
  */
5734
5737
  setVertexCount(vertexCount) {
5735
5738
  this.vertexCount = vertexCount;
5739
+ this._vertexCountSet = true;
5736
5740
  this.setNeedsRedraw("vertexCount");
5737
5741
  }
5738
5742
  /** Updates the indexed draw count override. */
@@ -5978,6 +5982,7 @@ var __exports__ = (() => {
5978
5982
  }
5979
5983
  }
5980
5984
  this.vertexCount = gpuGeometry.vertexCount;
5985
+ this._vertexCountSet = true;
5981
5986
  this.setIndexBuffer(gpuGeometry.indices || null);
5982
5987
  this.setAttributes(gpuGeometry.attributes, { disableWarnings: true });
5983
5988
  this.setAttributes(attributes, { disableWarnings: this.props.disableWarnings });