Skip to content

Commit

Permalink
Remove power module
Browse files Browse the repository at this point in the history
  • Loading branch information
GabrielMajeri committed Aug 5, 2020
1 parent 78546f4 commit 021251a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 80 deletions.
17 changes: 4 additions & 13 deletions wgpu-core/src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::{
device::Device,
hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Input, Token},
id::{AdapterId, DeviceId, SurfaceId, Valid},
power, span, LifeGuard, PrivateFeatures, Stored, MAX_BIND_GROUPS,
span, LifeGuard, PrivateFeatures, Stored, MAX_BIND_GROUPS,
};

use wgt::{Backend, BackendBit, DeviceDescriptor, PowerPreference, BIND_BUFFER_ALIGNMENT};
Expand Down Expand Up @@ -500,18 +500,9 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
}

let preferred_gpu = match desc.power_preference {
PowerPreference::Default => match power::is_battery_discharging() {
Ok(false) => discrete.or(integrated).or(other).or(virt),
Ok(true) => integrated.or(discrete).or(other).or(virt),
Err(err) => {
tracing::debug!(
"Power info unavailable, preferring integrated gpu ({})",
err
);
integrated.or(discrete).or(other).or(virt)
}
},
PowerPreference::LowPower => integrated.or(other).or(discrete).or(virt),
PowerPreference::Default | PowerPreference::LowPower => {
integrated.or(other).or(discrete).or(virt)
}
PowerPreference::HighPerformance => discrete.or(other).or(integrated).or(virt),
};

Expand Down
1 change: 0 additions & 1 deletion wgpu-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ pub mod id;
pub mod instance;
pub mod logging;
pub mod pipeline;
pub mod power;
pub mod resource;
pub mod swap_chain;
mod track;
Expand Down
66 changes: 0 additions & 66 deletions wgpu-core/src/power.rs

This file was deleted.

0 comments on commit 021251a

Please sign in to comment.