mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-06 20:58:37 +01:00
[dxvk] Allow for fps limit < 50 fps in low-latency mode
This commit is contained in:
parent
0f3cbd6f66
commit
a13b821f95
4 changed files with 8 additions and 5 deletions
|
@ -39,7 +39,7 @@
|
||||||
#
|
#
|
||||||
# Supported values: "max-frame-latency", "low-latency", "min-latency"
|
# Supported values: "max-frame-latency", "low-latency", "min-latency"
|
||||||
|
|
||||||
# dxvk.framePacing = ""
|
# dxvk.framePace = ""
|
||||||
|
|
||||||
|
|
||||||
# Allows fine-tuning the low-latency frame pacing mode.
|
# Allows fine-tuning the low-latency frame pacing mode.
|
||||||
|
@ -149,7 +149,7 @@
|
||||||
# The implementation will either use VK_NV_low_latency2 if supported
|
# The implementation will either use VK_NV_low_latency2 if supported
|
||||||
# by the driver, or a custom algorithm.
|
# by the driver, or a custom algorithm.
|
||||||
# - False: Disable Reflex support as well as built-in latency reduction.
|
# - False: Disable Reflex support as well as built-in latency reduction.
|
||||||
# This build defaults to False to enable dxvk.framePacing. You need to
|
# This build defaults to False to enable dxvk.framePace. You need to
|
||||||
# enable Reflex manually (Auto) until we support switching back and
|
# enable Reflex manually (Auto) until we support switching back and
|
||||||
# forth between Reflex and the low-latency frame pacing - for example
|
# forth between Reflex and the low-latency frame pacing - for example
|
||||||
# via the ingame options - and more critically we want to enable
|
# via the ingame options - and more critically we want to enable
|
||||||
|
|
|
@ -164,7 +164,8 @@ namespace dxvk {
|
||||||
int32_t frametime = std::chrono::duration_cast<microseconds>( t - m_lastStart ).count();
|
int32_t frametime = std::chrono::duration_cast<microseconds>( t - m_lastStart ).count();
|
||||||
int32_t frametimeDiff = std::max( 0, m_fpsLimitFrametime.load() - frametime );
|
int32_t frametimeDiff = std::max( 0, m_fpsLimitFrametime.load() - frametime );
|
||||||
delay = std::max( delay, frametimeDiff );
|
delay = std::max( delay, frametimeDiff );
|
||||||
delay = std::max( 0, std::min( delay, 20000 ) );
|
int32_t maxDelay = std::max( m_fpsLimitFrametime.load(), 20000 );
|
||||||
|
delay = std::max( 0, std::min( delay, maxDelay ) );
|
||||||
|
|
||||||
Sleep::TimePoint nextStart = t + microseconds(delay);
|
Sleep::TimePoint nextStart = t + microseconds(delay);
|
||||||
Sleep::sleepUntil( t, nextStart );
|
Sleep::sleepUntil( t, nextStart );
|
||||||
|
|
|
@ -28,7 +28,8 @@ namespace dxvk {
|
||||||
now - m_lastStart ).count();
|
now - m_lastStart ).count();
|
||||||
int32_t frametimeDiff = std::max( 0, m_fpsLimitFrametime.load() - frametime );
|
int32_t frametimeDiff = std::max( 0, m_fpsLimitFrametime.load() - frametime );
|
||||||
int32_t delay = std::max( 0, frametimeDiff );
|
int32_t delay = std::max( 0, frametimeDiff );
|
||||||
delay = std::min( delay, 20000 );
|
int32_t maxDelay = std::max( m_fpsLimitFrametime.load(), 20000 );
|
||||||
|
delay = std::min( delay, maxDelay );
|
||||||
|
|
||||||
Sleep::TimePoint nextStart = now + std::chrono::microseconds(delay);
|
Sleep::TimePoint nextStart = now + std::chrono::microseconds(delay);
|
||||||
Sleep::sleepUntil( now, nextStart );
|
Sleep::sleepUntil( now, nextStart );
|
||||||
|
|
|
@ -57,6 +57,8 @@ namespace dxvk {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_isActive.store(false);
|
||||||
|
|
||||||
std::unique_lock<dxvk::mutex> lock(m_mutex);
|
std::unique_lock<dxvk::mutex> lock(m_mutex);
|
||||||
auto interval = m_targetInterval;
|
auto interval = m_targetInterval;
|
||||||
auto latency = m_maxLatency;
|
auto latency = m_maxLatency;
|
||||||
|
@ -79,7 +81,6 @@ namespace dxvk {
|
||||||
// that can be written by setTargetFrameRate
|
// that can be written by setTargetFrameRate
|
||||||
lock.unlock();
|
lock.unlock();
|
||||||
|
|
||||||
m_isActive.store(false);
|
|
||||||
if (t1 < m_nextFrame) {
|
if (t1 < m_nextFrame) {
|
||||||
m_isActive.store(true);
|
m_isActive.store(true);
|
||||||
Sleep::sleepUntil(t1, m_nextFrame);
|
Sleep::sleepUntil(t1, m_nextFrame);
|
||||||
|
|
Loading…
Add table
Reference in a new issue