Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(webgl): disableWarnings option #2048

Merged
merged 1 commit into from
Mar 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions modules/engine/src/model/model.ts
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Loading