Skip to content

Commit

Permalink
Make WgpuSettings::default() obevy WGPU_POWER_PREF
Browse files Browse the repository at this point in the history
This is useful when testing, and makes the behaviour consistent
with the already present check for WGPU_BACKEND.
  • Loading branch information
fornwall committed Aug 18, 2023
1 parent 8a8d43d commit 3720ffa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/bevy_render/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ impl Default for WgpuSettings {

let backends = Some(wgpu::util::backend_bits_from_env().unwrap_or(default_backends));

let power_preference =
wgpu::util::power_preference_from_env().unwrap_or(PowerPreference::HighPerformance);

let priority = settings_priority_from_env().unwrap_or(WgpuSettingsPriority::Functionality);

let limits = if cfg!(all(feature = "webgl", target_arch = "wasm32"))
Expand All @@ -79,7 +82,7 @@ impl Default for WgpuSettings {
Self {
device_label: Default::default(),
backends,
power_preference: PowerPreference::HighPerformance,
power_preference,
priority,
features: wgpu::Features::TEXTURE_ADAPTER_SPECIFIC_FORMAT_FEATURES,
disabled_features: None,
Expand Down

0 comments on commit 3720ffa

Please sign in to comment.