bevy
bevy copied to clipboard
add support for `WGPU_ADAPTER_NAME` environment variable
Objective
fixes #11753
Solution
replicate the behaviour of wgpu's WGPU_ADAPTER_NAME
environment variable in bevy
https://docs.rs/wgpu/latest/wgpu/util/fn.initialize_adapter_from_env_or_default.html
Changelog
Added
Support overriding the GPU selected with the environment variable WGPU_ADAPTER_NAME
. This can be useful to test performance or debug with different GPUs.
I'd prefer to store the preferred adapter name in the WgpuSettings
struct (just add it as an Option<String>
or w/e) and do the environment variable parsing stuff there (this means you can also set it programmatically, so you could eg. implement a dropdown list to select which GPU to run on in your game's settings menu).
Also Backends::all()
is incorrect, you should be using the backend options from the WgpuSettings
struct