bevy icon indicating copy to clipboard operation
bevy copied to clipboard

add support for `WGPU_ADAPTER_NAME` environment variable

Open ickk opened this issue 1 year ago • 1 comments

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.

ickk avatar Feb 07 '24 11:02 ickk

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

Elabajaba avatar Feb 10 '24 21:02 Elabajaba