-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allow wgpu backend to be configured from the environment #1042
Conversation
hello 👋 Currently configuration is mostly done through then in your app you could do App::build().add_resource(WgpuOptions {
backend: "gl", // this is not yet implemented, and could be an enum rather than a string
..Default::default()
}) |
Because its up to the user to choose in which backend to run, we do not want it a compile time option. |
Some random assorted thoughts:
For the enum, I'm thinking it should be something like: struct WgpuOptions {
backend: WgpuBackend,
}
enum WgpuBackend {
Default, // BackendBit::Primary | BackendBit::Secondary
Vulkan, // BackendBit::Vulkan
Gl, // BackendBit::Gl
...
} |
Yep totally agreed. I'm making some PRs on gfx-rs/gfx-backend-gl and I think we are gonna be able to run the basic examples from bevy with OpenGL backend pretty soon |
8de1f56
to
18a454a
Compare
Made the changes. Did not set the secondary flag to the backend bit, as these indicate in-progress backends from the wgpu-rs/gfx team. |
18a454a
to
d16240e
Compare
Looks good to me! |
Multiple backends for wgpu can be available in a system.
Allow force changing the default pick through an environment variable.
This should be useful for setting the backend BackendBit::GL that will allow us to access gfx-backend-gl backend of gfx.