@ -1,3 +1,6 @@
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
// SPDX-License-Identifier: GPL-3.0-or-later
// SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
@ -62,13 +65,15 @@ TimerResolution GetTimerResolution() {
void SetHighQoS ( ) {
// https://learn.microsoft.com/en-us/windows/win32/procthread/quality-of-service
PROCESS_POWER_THROTTLING_STATE PowerThrottling {
. Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION ,
. ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED | PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION ,
. StateMask = 0 ,
} ;
if ( auto pf = ( decltype ( & SetProcessInformation ) ) ( void * ) GetProcAddress ( GetModuleHandle ( TEXT ( " Kernel32.dll " ) ) , " SetProcessInformation " ) ; pf )
static auto auto pf = ( decltype ( & SetProcessInformation ) ) ( void * ) GetProcAddress ( GetModuleHandle ( TEXT ( " Kernel32.dll " ) ) , " SetProcessInformation " ) ;
if ( pf ) {
PROCESS_POWER_THROTTLING_STATE PowerThrottling {
. Version = PROCESS_POWER_THROTTLING_CURRENT_VERSION ,
. ControlMask = PROCESS_POWER_THROTTLING_EXECUTION_SPEED | PROCESS_POWER_THROTTLING_IGNORE_TIMER_RESOLUTION ,
. StateMask = 0 ,
} ;
pf ( GetCurrentProcess ( ) , ProcessPowerThrottling , & PowerThrottling , sizeof ( PROCESS_POWER_THROTTLING_STATE ) ) ; // Windows 7+
}
}
} // Anonymous namespace