Skip to content

Commit

Permalink
Fix disableWarnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Pessimistress committed Mar 22, 2024
1 parent 79fd850 commit 6789c1c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions modules/engine/src/model/model.ts
Expand Up @@ -287,9 +287,7 @@ export class Model {
this.setIndexBuffer(props.indexBuffer);
}
if (props.attributes) {
this.setAttributes(props.attributes, {
disableWarnings: props.disableWarnings
});
this.setAttributes(props.attributes);
}
if (props.constantAttributes) {
this.setConstantAttributes(props.constantAttributes);
Expand Down Expand Up @@ -565,7 +563,7 @@ export class Model {
set = true;
}
}
if (!set && !(options?.disableWarnings || this.props.disableWarnings)) {
if (!set && !(options?.disableWarnings ?? this.props.disableWarnings)) {
log.warn(
`Model(${this.id}): Ignoring buffer "${buffer.id}" for unknown attribute "${bufferName}"`
)();
Expand All @@ -590,7 +588,7 @@ export class Model {
const attributeInfo = this._attributeInfos[attributeName];
if (attributeInfo) {
this.vertexArray.setConstantWebGL(attributeInfo.location, value);
} else if (!(options?.disableWarnings || this.props.disableWarnings)) {
} else if (!(options?.disableWarnings ?? this.props.disableWarnings)) {
log.warn(
`Model "${this.id}: Ignoring constant supplied for unknown attribute "${attributeName}"`
)();
Expand Down
Expand Up @@ -110,7 +110,7 @@ export class WEBGLRenderPipeline extends RenderPipeline {
const validBindings = this.shaderLayout.bindings
.map(binding => `"${binding.name}"`)
.join(', ');
if (options?.disableWarnings) {
if (!options?.disableWarnings) {
log.warn(
`Unknown binding "${name}" in render pipeline "${this.id}", expected one of ${validBindings}`
)();
Expand Down

0 comments on commit 6789c1c

Please sign in to comment.