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

Add WGPU_BACKEND_VALIDATION environment variable #2881

Closed
wants to merge 2 commits into from

Conversation

cwfitzgerald
Copy link
Member

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

Part of #2316

Description

This adds an env var which turns on backend validation no matter if we're in debug or release. This is useful for both forcing it on in release and forcing it off in debug.

Testing
None

@cwfitzgerald cwfitzgerald requested a review from jimblandy July 13, 2022 17:48
Copy link
Member

@jimblandy jimblandy left a comment

Choose a reason for hiding this comment

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

Is an environment variable really how people want to work around this?

Would it make more sense to check the environment variable from something analogous to initialize_adapter_from_env, so that the app gets to opt into sensitivity to the environment? Usually we haven't hacked this kind of thing directly into Instance::new. It almost seems like this should be some sort of blocklist in the back end, rather than a magic var users need to know about to make things work for them.

Wearing my Mozilla hat, Firefox doesn't object, but we do have a general preference for less environmental sensitivity, because it makes problems that much harder to reproduce.

For all the above reasons, something more targeted would be better, like this one, which applies only to a specific back end, to address a specific bug:

let enable_dx11 = match std::env::var("WGPU_UNSTABLE_DX11_BACKEND") {

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