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 unsetting vertex attributes in gles backend #3706

Merged
merged 4 commits into from
Apr 19, 2023

Conversation

Azorlogh
Copy link
Contributor

@Azorlogh Azorlogh commented Apr 19, 2023

Checklist

  • Run cargo clippy.
  • Run RUSTFLAGS=--cfg=web_sys_unstable_apis cargo clippy --target wasm32-unknown-unknown if applicable.
  • Add change to CHANGELOG.md. See simple instructions inside file.

Connections
bevyengine/bevy#5732 (and all linked issues)

Description
Currently, the code responsible for un-setting vertex attributes uses the attribute's index in the state's array.
Instead we need to use the location of the vertex attribute.
This was causing issues with apps running in wasm on the webgl backend, such as bevy apps.

Testing
I tweaked the test from issue #3457 to use non-consecutive vertex attribute locations. This covers the code path that unsets attribs at the end of a render pass, but does not cover the code path that unsets them upon switching to a new pipeline.
Unfortunately I didn't manage to test that one (unsetting upon pipeline switching), because the webgl context fails silently in that case.

Copy link
Member

@cwfitzgerald cwfitzgerald left a comment

Choose a reason for hiding this comment

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

Great!

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.

2 participants