mirror of
https://github.com/gfx-rs/wgpu.git
synced 2026-04-22 03:02:01 -04:00
Merge #973
973: remove PowerPreference::Default r=kvark a=frbimo **Connections** Issue: #971 **Description** remove `PowerPreference::Default` and change related value to use `PowerPreference::LowPower` . `PowerPreference::default()` is remain. **Testing** `cargo test` and `cargo build` passed Co-authored-by: frbimo <fr.bimo@gmail.com>
This commit is contained in:
@@ -69,7 +69,7 @@ fn main() {
|
||||
let adapter = global
|
||||
.request_adapter(
|
||||
&wgc::instance::RequestAdapterOptions {
|
||||
power_preference: wgt::PowerPreference::Default,
|
||||
power_preference: wgt::PowerPreference::LowPower,
|
||||
#[cfg(feature = "winit")]
|
||||
compatible_surface: Some(surface),
|
||||
#[cfg(not(feature = "winit"))]
|
||||
|
||||
@@ -174,7 +174,7 @@ impl Corpus {
|
||||
}
|
||||
let adapter = match global.request_adapter(
|
||||
&wgc::instance::RequestAdapterOptions {
|
||||
power_preference: wgt::PowerPreference::Default,
|
||||
power_preference: wgt::PowerPreference::LowPower,
|
||||
compatible_surface: None,
|
||||
},
|
||||
wgc::instance::AdapterInputs::IdSet(
|
||||
|
||||
@@ -501,9 +501,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
|
||||
}
|
||||
|
||||
let preferred_gpu = match desc.power_preference {
|
||||
PowerPreference::Default | PowerPreference::LowPower => {
|
||||
integrated.or(other).or(discrete).or(virt)
|
||||
}
|
||||
PowerPreference::LowPower => integrated.or(other).or(discrete).or(virt),
|
||||
PowerPreference::HighPerformance => discrete.or(other).or(integrated).or(virt),
|
||||
};
|
||||
|
||||
|
||||
@@ -57,17 +57,15 @@ pub enum Backend {
|
||||
#[cfg_attr(feature = "trace", derive(Serialize))]
|
||||
#[cfg_attr(feature = "replay", derive(Deserialize))]
|
||||
pub enum PowerPreference {
|
||||
/// Prefer low power when on battery, high performance when on mains.
|
||||
Default = 0,
|
||||
/// Adapter that uses the least possible power. This is often an integerated GPU.
|
||||
LowPower = 1,
|
||||
LowPower = 0,
|
||||
/// Adapter that has the highest performance. This is often a discrete GPU.
|
||||
HighPerformance = 2,
|
||||
HighPerformance = 1,
|
||||
}
|
||||
|
||||
impl Default for PowerPreference {
|
||||
fn default() -> Self {
|
||||
Self::Default
|
||||
Self::LowPower
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user