@luma.gl/engine 9.0.5 → 9.0.7

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
@@ -6845,6 +6845,8 @@ void main() {
6845
6845
  const varyingHash = "-";
6846
6846
  const bufferLayoutHash = this._getHash(JSON.stringify(props.bufferLayout));
6847
6847
  switch (this.device.type) {
6848
+ case "webgl":
6849
+ return `${vsHash}/${fsHash}V${varyingHash}BL${bufferLayoutHash}`;
6848
6850
  default:
6849
6851
  const parameterHash = this._getHash(JSON.stringify(props.parameters));
6850
6852
  return `${vsHash}/${fsHash}V${varyingHash}T${props.topology}P${parameterHash}BL${bufferLayoutHash}`;
@@ -7085,9 +7087,7 @@ void main() {
7085
7087
  this.setIndexBuffer(props.indexBuffer);
7086
7088
  }
7087
7089
  if (props.attributes) {
7088
- this.setAttributes(props.attributes, {
7089
- disableWarnings: props.disableWarnings
7090
- });
7090
+ this.setAttributes(props.attributes);
7091
7091
  }
7092
7092
  if (props.constantAttributes) {
7093
7093
  this.setConstantAttributes(props.constantAttributes);
@@ -7099,7 +7099,6 @@ void main() {
7099
7099
  this.setUniforms(props.uniforms);
7100
7100
  }
7101
7101
  if (props.moduleSettings) {
7102
- import_core11.log.warn("Model.props.moduleSettings is deprecated. Use Model.shaderInputs.setProps()")();
7103
7102
  this.updateModuleSettings(props.moduleSettings);
7104
7103
  }
7105
7104
  if (props.transformFeedback) {
@@ -7155,7 +7154,12 @@ void main() {
7155
7154
  vertexCount: this.vertexCount,
7156
7155
  instanceCount: this.instanceCount,
7157
7156
  indexCount,
7158
- transformFeedback: this.transformFeedback
7157
+ transformFeedback: this.transformFeedback || void 0,
7158
+ // WebGL shares underlying cached pipelines even for models that have different parameters and topology,
7159
+ // so we must provide our unique parameters to each draw
7160
+ // (In WebGPU most parameters are encoded in the pipeline and cannot be changed per draw call)
7161
+ parameters: this.parameters,
7162
+ topology: this.topology
7159
7163
  });
7160
7164
  } finally {
7161
7165
  this._logDrawCallEnd();
@@ -7302,7 +7306,7 @@ void main() {
7302
7306
  set = true;
7303
7307
  }
7304
7308
  }
7305
- if (!set && !(options?.disableWarnings || this.props.disableWarnings)) {
7309
+ if (!set && !(options?.disableWarnings ?? this.props.disableWarnings)) {
7306
7310
  import_core11.log.warn(
7307
7311
  `Model(${this.id}): Ignoring buffer "${buffer.id}" for unknown attribute "${bufferName}"`
7308
7312
  )();
@@ -7323,7 +7327,7 @@ void main() {
7323
7327
  const attributeInfo = this._attributeInfos[attributeName];
7324
7328
  if (attributeInfo) {
7325
7329
  this.vertexArray.setConstantWebGL(attributeInfo.location, value);
7326
- } else if (!(options?.disableWarnings || this.props.disableWarnings)) {
7330
+ } else if (!(options?.disableWarnings ?? this.props.disableWarnings)) {
7327
7331
  import_core11.log.warn(
7328
7332
  `Model "${this.id}: Ignoring constant supplied for unknown attribute "${attributeName}"`
7329
7333
  )();