Skip to content

Commit

Permalink
Optimize LatentSync resync for VRR displays
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Nov 4, 2024
1 parent 57b0010 commit 060a998
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/framerate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2060,13 +2060,18 @@ SK::Framerate::Limiter::wait (void)

bool bSync = false;

static int iTry = 0; // First time signals resync
if ( iTry == 0 || (rb.gsync_state.active == false && (
config.render.framerate.latent_sync.scanline_resync != 0 &&
(iTry++ %
config.render.framerate.latent_sync.scanline_resync) == 0
))
) bSync = true;
static int iSkips = 0;
static int iTry = 0; // First time signals resync
if ( iTry == 0 || (rb.gsync_state.active == false || (++iSkips % 50) == 0) && (
config.render.framerate.latent_sync.scanline_resync != 0 &&
(iTry++ %
config.render.framerate.latent_sync.scanline_resync) == 0 )
)
{
bSync = true;
iSkips = 0;
}

if (D3DKMTGetScanLine != nullptr && bSync)
{
__scanline.lock.requestResync ();
Expand Down

0 comments on commit 060a998

Please sign in to comment.