mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[util] Move sleep granularity getting to own function
This commit is contained in:
parent
b885883e06
commit
05a5b82f59
2 changed files with 10 additions and 4 deletions
|
@ -137,6 +137,14 @@ namespace dxvk {
|
|||
|
||||
|
||||
void FpsLimiter::initialize() {
|
||||
updateSleepGranularity();
|
||||
m_sleepThreshold = 4 * m_sleepGranularity;
|
||||
m_lastFrame = dxvk::high_resolution_clock::now();
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
|
||||
void FpsLimiter::updateSleepGranularity() {
|
||||
HMODULE ntdll = ::GetModuleHandleW(L"ntdll.dll");
|
||||
|
||||
if (ntdll) {
|
||||
|
@ -163,10 +171,6 @@ namespace dxvk {
|
|||
// Assume 1ms sleep granularity by default
|
||||
m_sleepGranularity = TimerDuration(10000);
|
||||
}
|
||||
|
||||
m_sleepThreshold = 4 * m_sleepGranularity;
|
||||
m_lastFrame = dxvk::high_resolution_clock::now();
|
||||
m_initialized = true;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -84,6 +84,8 @@ namespace dxvk {
|
|||
|
||||
void initialize();
|
||||
|
||||
void updateSleepGranularity();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue