Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

desktop: Do not warn about GameMode on non-Linux unless explicitly enabled #18242

Merged
merged 1 commit into from
Oct 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions desktop/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,18 +264,20 @@ impl ActivePlayer {
}
}

#[cfg_attr(not(target_os = "linux"), allow(unused))]
let gamemode_enable = match preferences.gamemode_preference() {
GameModePreference::Default => {
preferences.graphics_power_preference() == PowerPreference::High
}
GameModePreference::On => true,
GameModePreference::On => {
if cfg!(not(target_os = "linux")) {
tracing::warn!("Cannot enable GameMode, as it is supported only on Linux");
}
true
}
GameModePreference::Off => false,
};

if cfg!(not(target_os = "linux")) && gamemode_enable {
tracing::warn!("Cannot enable GameMode, as it is supported only on Linux");
}

let renderer = WgpuRenderBackend::new(descriptors, movie_view)
.map_err(|e| anyhow!(e.to_string()))
.expect("Couldn't create wgpu rendering backend");
Expand Down