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

Cache MAX_SAMPLES on gles backend #5346

Merged
merged 1 commit into from
Mar 9, 2024
Merged

Conversation

Dinnerbone
Copy link
Contributor

@Dinnerbone Dinnerbone commented Mar 5, 2024

Connections
Link to the issues addressed by this PR, or dependent PRs in other repositories

Description
Believe it or not, this actually showed a little hot for us when measuring on Firefox webgl. Every call to get_texture_format_features ended up with an IPC to fetch the max sample count, which is a static immutable value.

Let's cache it on creation and keep things cheap. Also helps avoid a lock, which is always nice.

Testing
All existing tests pass? :D

Checklist

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown
    • --target wasm32-unknown-emscripten
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

@Dinnerbone Dinnerbone requested a review from a team as a code owner March 5, 2024 20:49
Copy link
Member

@Wumpf Wumpf left a comment

Choose a reason for hiding this comment

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

nice catch, thanks for getting fix improvement in 👍
Just a small change request on doc & naming to make future-me not confused about this

wgpu-hal/src/gles/mod.rs Outdated Show resolved Hide resolved
@Wumpf Wumpf merged commit 2234fd6 into gfx-rs:trunk Mar 9, 2024
27 checks passed
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