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): Pair calls to bind/unbind VAO #2032

Merged
merged 2 commits into from Mar 13, 2024

Conversation

donmccurdy
Copy link
Collaborator

@donmccurdy donmccurdy commented Mar 13, 2024

Fixes:

It's not obvious to me that we should be able to bind the index buffer only once... if not, we need to bind on every frame.

Related:

@donmccurdy
Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @donmccurdy and the rest of your teammates on Graphite Graphite

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

If the index buffer is not stored in the underlying VertexArray, then one could question whether it should be managed by the VertexArray class.

@donmccurdy
Copy link
Collaborator Author

On closer look at the spec, I think I see the issue – will try to bump this to avoid rebinding on each frame.

@donmccurdy
Copy link
Collaborator Author

Done! I think the trick here will be to pair every call to bindVertexArray(vao) with a later call to bindVertexArray(null), to make sure nothing modifies our VAO unintentionally. With that, we can do the index buffer binding once up front, as you'd intended.

Copy link
Collaborator

@ibgreen ibgreen left a comment

Choose a reason for hiding this comment

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

Ok Let's land it and keep an eye on it. It will be great if this binding/unbinding can be remove.

@donmccurdy donmccurdy changed the title fix(webgl): Bind index buffer before render fix(webgl): Pair calls to bind/unbind VAO Mar 13, 2024
@donmccurdy donmccurdy merged commit f4af7b6 into master Mar 13, 2024
1 of 2 checks passed
@donmccurdy donmccurdy deleted the donmccurdy/fix-bind-index-buffer branch March 13, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants