Skip to content

Win32: Add d3dkmt + Scanline Sync#18974

Merged
LibretroAdmin merged 3 commits intolibretro:masterfrom
sonninnos:d3dkmt-scanline
Apr 24, 2026
Merged

Win32: Add d3dkmt + Scanline Sync#18974
LibretroAdmin merged 3 commits intolibretro:masterfrom
sonninnos:d3dkmt-scanline

Conversation

@sonninnos
Copy link
Copy Markdown
Collaborator

Description

  • Add Scanline Sync aka lagless vsync
  • Reorder video synchronization settings
  • Show core time in video stats always

Getting the current scanline requires adding d3dkmt headers to the repo, which are copied from MSVC. Here makefile enables it also when enabling D3D12. Perhaps there is a better place for it, since it should be possible for Vista and up, for good enough for now.

Should be simple enough to add more platforms that are able to receive the same scanline data.

Scanline Sync is basically Auto Frame Delay at 99%, but more accurate and stable. Unlike normal rigid vsync which will stutter and drop frames this will try to dynamically keep the eventual tearlines hidden inside vertical blanking. It also tries to sleep as much as possible without drawbacks while waiting for the costly scanline, which keeps CPU temperatures down a lot. And it disables itself for a while if the core frame takes too long to generate or if they have too much deviation.

Comment thread gfx/common/win32_common.h Outdated
Comment thread gfx/common/win32_common.h Outdated
@LibretroAdmin LibretroAdmin merged commit 1119982 into libretro:master Apr 24, 2026
38 checks passed
@sonninnos sonninnos deleted the d3dkmt-scanline branch April 25, 2026 01:39
@jayare5
Copy link
Copy Markdown

jayare5 commented Apr 26, 2026

I've never seen such low latency using an emulator on a Windows PC!!
This will be huge moving forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants