Skip to content

Commit 590438f

Browse files
committed
Reduced the amount of time SK's framerate limiter spends busy-waiting for common FPS targets.
1 parent 17e27d5 commit 590438f

3 files changed

Lines changed: 11 additions & 16 deletions

File tree

CHANGELOG.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
26.4.17.1
1+
26.4.17.2
2+
=========
3+
+ Reduced the amount of time SK's framerate limiter spends busy-waiting for
4+
common FPS targets (very high framerates always require busy-wait).
5+
6+
26.4.17.1
27
=========
38
+ Fixed Reflex Low Latency mode not working to limit VRR
49
framerate in Unity games.

include/SpecialK/DLL_VERSION.H

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
#define SK_YEAR 26
44
#define SK_MONTH 4
55
#define SK_DATE 17
6-
#define SK_REV_N 1
7-
#define SK_REV 1
6+
#define SK_REV_N 2
7+
#define SK_REV 2
88

99
#ifndef _A2
1010
#define _A2(a) #a

src/framerate.cpp

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ enum class SK_LimitApplicationSite {
8282
EndOfFrame // = 4 (Default)
8383
};
8484

85-
float fSwapWaitRatio = 3.33f;
85+
float fSwapWaitRatio = 1.125f;
8686
float fSwapWaitFract = 0.66f;
8787

8888
float
@@ -2545,14 +2545,9 @@ SK::Framerate::Limiter::wait (void)
25452545
LARGE_INTEGER
25462546
liDelay
25472547
{ .QuadPart =
2548-
std::min (
25492548
static_cast <LONGLONG> (
25502549
to_next_in_secs * 1000.0 - timer_res_ms * fSwapWaitRatio
2551-
),
2552-
static_cast <LONGLONG> (
2553-
to_next_in_secs * 1000.0 * fSwapWaitFract
25542550
)
2555-
)
25562551
};
25572552

25582553
liDelay.QuadPart =
@@ -2597,7 +2592,7 @@ SK::Framerate::Limiter::wait (void)
25972592
to_next_in_secs =
25982593
std::max (0.0, SK_RecalcTimeToNextFrame ());
25992594

2600-
if (static_cast <double> (-liDelay.QuadPart) / 10000.0 > timer_res_ms * 2.0)
2595+
if (static_cast <double> (-liDelay.QuadPart) / 10000.0 > timer_res_ms * 1.333)
26012596
hWaitObjs [iWaitObjs++] = timer_wait.m_h;
26022597

26032598
if (iWaitObjs == 0)
@@ -4923,14 +4918,9 @@ SK_Framerate_WaitUntilQPC (LONGLONG llQPC, HANDLE& hTimer)
49234918
LARGE_INTEGER
49244919
liDelay
49254920
{ .QuadPart =
4926-
std::min (
49274921
static_cast <LONGLONG> (
49284922
to_next_in_secs * 1000.0 - SK::Framerate::Limiter::timer_res_ms * fSwapWaitRatio
4929-
),
4930-
static_cast <LONGLONG> (
4931-
to_next_in_secs * 1000.0 * fSwapWaitFract
49324923
)
4933-
)
49344924
};
49354925

49364926
liDelay.QuadPart =
@@ -4946,7 +4936,7 @@ SK_Framerate_WaitUntilQPC (LONGLONG llQPC, HANDLE& hTimer)
49464936
0, nullptr, nullptr,
49474937
FALSE ) )
49484938
{
4949-
if (static_cast <double> (-liDelay.QuadPart) / 10000.0 > SK::Framerate::Limiter::timer_res_ms * 2.0)
4939+
if (static_cast <double> (-liDelay.QuadPart) / 10000.0 > SK::Framerate::Limiter::timer_res_ms * 1.333)
49504940
{
49514941
to_next_in_secs =
49524942
static_cast <double> (llQPC - SK_QueryPerf ().QuadPart) /

0 commit comments

Comments
 (0)