A texture is not copied onto itself; the process opts out of the efficiency mode (victory-fork a2537066)

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
localandClaude Opus 5.5 committed 2026-11-25 06:19:18 -06:00
1 parent 4b3bdf1f98
commit 0ca4cda3ea
2 files changed
+59 -5

No files matched your search

+12 -2
View File
@@ -239,13 +239,23 @@ pub fn title() -> Title {
pub fn use_console_timers() {
use windows_sys::Win32::Media::timeBeginPeriod;
use windows_sys::Win32::System::Threading::{
GetCurrentProcess, PROCESS_POWER_THROTTLING_CURRENT_VERSION,
GetCurrentProcess, PROCESS_POWER_THROTTLING_CURRENT_VERSION, PROCESS_POWER_THROTTLING_EXECUTION_SPEED,
PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION, PROCESS_POWER_THROTTLING_STATE,
ProcessPowerThrottling, SetProcessInformation,
};
// Also: the system does not run this process at reduced speed (its
// "efficiency mode": lower clock, the slow cores of a hybrid processor)
// when its window is not the one in front, as while its owner works in
// another window or streams. The console has eight cores alike and no
// such mode. `VICTORY_EFFICIENCY_MODE=1` leaves the system its choice.
let execution = if std::env::var_os("VICTORY_EFFICIENCY_MODE").is_some_and(|v| v == "1") {
0
} else {
PROCESS_POWER_THROTTLING_EXECUTION_SPEED
};
let keep = PROCESS_POWER_THROTTLING_STATE {
Version: PROCESS_POWER_THROTTLING_CURRENT_VERSION,
ControlMask: PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION,
ControlMask: PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION | execution,
StateMask: 0,
};
// SAFETY: plain process settings; `keep` outlives the call.