Skip to content

Commit

Permalink
Make power_preference_from_env() respect WGPU_POWER_PREF=none (#4076)
Browse files Browse the repository at this point in the history
Also update wgpu/README.md now that default() is None.
  • Loading branch information
fornwall authored Aug 18, 2023
1 parent 6accf32 commit bf324fb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ By @Valaphee in [#3402](https://github.com/gfx-rs/wgpu/pull/3402)
- Omit texture store bound checks since they are no-ops if out of bounds on all APIs. By @teoxoy in [#3975](https://github.com/gfx-rs/wgpu/pull/3975)
- Validate `DownlevelFlags::READ_ONLY_DEPTH_STENCIL`. By @teoxoy in [#4031](https://github.com/gfx-rs/wgpu/pull/4031)
- Add validation in accordance with WebGPU `setViewport` valid usage for `x`, `y` and `this.[[attachment_size]]`. By @James2022-rgb in [#4058](https://github.com/gfx-rs/wgpu/pull/4058)
- Make `WGPU_POWER_PREF=none` a valid value. By @fornwall in [4076](https://github.com/gfx-rs/wgpu/pull/4076)

#### Vulkan

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ All testing and example infrastructure shares the same set of environment variab

- `WGPU_ADAPTER_NAME` with a substring of the name of the adapter you want to use (ex. `1080` will match `NVIDIA GeForce 1080ti`).
- `WGPU_BACKEND` with a comma separated list of the backends you want to use (`vulkan`, `metal`, `dx12`, `dx11`, or `gl`).
- `WGPU_POWER_PREF` with the power preference to choose when a specific adapter name isn't specified (`high` or `low`)
- `WGPU_POWER_PREF` with the power preference to choose when a specific adapter name isn't specified (`high`, `low` or `none`)
- `WGPU_DX12_COMPILER` with the DX12 shader compiler you wish to use (`dxc` or `fxc`, note that `dxc` requires `dxil.dll` and `dxcompiler.dll` to be in the working directory otherwise it will fall back to `fxc`)
- `WGPU_GLES_MINOR_VERSION` with the minor OpenGL ES 3 version number to request (`0`, `1`, `2` or `automatic`).

Expand Down
4 changes: 2 additions & 2 deletions wgpu/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ The following environment variables can be used to configure how the framework e

- `WGPU_POWER_PREF`

Options: `low`, `high`
Options: `low`, `high`, `none`

If unset a low power adapter is preferred.
If unset power usage is not considered when choosing an adapter.

- `WGPU_ADAPTER_NAME`

Expand Down
1 change: 1 addition & 0 deletions wgpu/src/util/init.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pub fn power_preference_from_env() -> Option<PowerPreference> {
{
Ok("low") => PowerPreference::LowPower,
Ok("high") => PowerPreference::HighPerformance,
Ok("none") => PowerPreference::None,
_ => return None,
},
)
Expand Down

0 comments on commit bf324fb

Please sign in to comment.