mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-12 13:08:50 +01:00
[util] Move sleep granularity getting to own function
This commit is contained in:
parent
b885883e06
commit
05a5b82f59
@ -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…
Reference in New Issue
Block a user