1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-12-12 13:08:50 +01:00
Commit Graph

10 Commits

Author SHA1 Message Date
Philip Rebohle
c1ab09a048 [util] Move platform-specific sleep code to dedicated helper class 2022-09-16 12:49:42 +02:00
Philip Rebohle
61025c0079
[dxvk] Don't disable frame rate limiter if vsync is enabled
This only works if we know the actual refresh rate of the display.
However, in a wine virtual desktop or with proton's fshack, this
is often not the case, so we'd see a 60 Hz mode on a high-refresh
rate display and never actually enable the limiter.
2022-08-17 01:53:24 +02:00
Joshua Ashton
cf9e217e7b [util] Support for fps limiter on non-Windows platforms
Defaults to a sleep granularity of 0.5ms, which is slightly on the cautious side.

Calls through to std::this_thread::sleep_for directly, which calls through to nanosleep.
2022-08-16 14:32:07 +02:00
Joshua Ashton
d1e2b89282 [util] Use chrono literal for ms in fps limiter 2022-08-16 14:32:07 +02:00
Joshua Ashton
5fcc9a1bd1 [util] Move platform specific sleep to own function in fps limiter 2022-08-16 14:32:07 +02:00
Joshua Ashton
05a5b82f59 [util] Move sleep granularity getting to own function 2022-08-16 14:32:07 +02:00
Joshua Ashton
b885883e06 [util] Rename NtTimerDuration to TimerDuration 2022-08-16 14:32:07 +02:00
Philip Rebohle
cd8a2bcfcd [dxvk] Use custom sync primitives 2021-06-29 00:51:20 +02:00
Philip Rebohle
30a1a29aa6 [util] Add DXVK_FRAME_RATE environment variable to limit frame rate 2021-06-12 13:50:08 +02:00
Philip Rebohle
a16c861358 [util] Implement frame rate limiter
This tries to be sophisticated and disables itself when it notices
that the frame rate is going to be limited by presentation anyway.
2021-06-12 13:50:08 +02:00