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): constant attributes #1802

Merged
merged 1 commit into from
Aug 28, 2023
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ export class WEBGLRenderPipeline extends RenderPipeline {
continue; // eslint-disable-line no-continue
}
this.vertexArrayObject.setConstant(attributeInfo.location, value);
this.vertexArrayObject.enable(attributeInfo.location, false);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this go into VertexArrayObject.setConstant? enable is called in VertexArrayObject.setBuffer

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I was considering it. One small hesitation was that in principle, the vertexArray does not have to be updated every draw, as each model could have its own vertexArray and just bind it, even when they share programs.

If we did that, it would mean that the location disable state could also be saved, however the constant values must still be updated on every draw as they are stored on the shared context and might have been clobbered by the constant values of other draw calls.

So there is perhaps a small case for keeping these separate. Will give it some more thought.

}
}

Expand Down
Loading