Commit Graph

8 Commits

Author SHA1 Message Date
89b6201ebb present: console frame-pacing uncap via LEONIDA_PRESENT_UNCAP
Any non-empty value other than "0" lifts the frame-event cap: a
WaitFrameEventX hands its token out at once (no vblank grid, no latency
throttle) and PresentX presents unsynced, so the frame rate is whatever
the title renders. Registration and suspension keep their errors, an
uncapped frame's statistics report its present time, and the flag
survives suspend/resume. frame_pacer_test covers the grid's removal and
restoration.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-11-23 13:46:59 -07:00
112368dc22 frame_pacer: the new test case cannot hang on a blocked waiter; the comment states the unpaced condition
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 05:18:02 +03:00
cf0671b488 frame_pacer: a present before the origin event is armed is not a frame in flight
PresentX presents with sync interval 0 until SetFrameIntervalX and
ScheduleFrameEventX are both done, but the pacer queued each of those
presents for its own vblank as soon as the interval was set. Blank
presents of a loading screen made the first WaitFrameEventX wait one
period for each of them (1000 presents: 1000 periods).

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
2026-11-23 04:19:12 +03:00
725f99e428 fix(runtime): retain the PresentX deadline on issued frame tokens
Rescheduling an origin event can make an existing frame look late before its original vblank. Keep the original deadline for both the tear decision and its display statistic.
2026-11-22 17:00:01 +01:00
c03b573a16 PresentX tear: review fixes
- find_tear_mode rejects a mode whose surface caps lack the swapchain's image usage or extent.
- present_timing: a repeated or stale token is never late.
- percent_scanned is measured at commit, so it agrees with the display time.
- The "no effect" log distinguishes the kill switch from a missing extension or mode.
- LEONIDA_PRESENT_NO_TEAR is read with _dupenv_s: any non-empty value but "0" disables.
- xbox_present_test: the real-time comment is back where it belongs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 13:00:38 +01:00
6728a00c2a PresentX: implement ImmediateThresholdPercent with VK_KHR/EXT_swapchain_maintenance1
A frame presented after the vblank it was due at is flipped at once (IMMEDIATE, else
FIFO_RELAXED) when the scan would be within the threshold percentage of the screen,
instead of waiting a whole interval. The decision is the pure
leonida::decide_present_sync(late_us, interval_us, threshold); FramePacer reports the
lateness against the vblank after the token's origin and records the tear in
GetFrameStatisticsX (PercentScanned) and immediate_presents().

VulkanPresenter creates a vsync swapchain with FIFO plus the tear mode when the surface
lists it as compatible (VkSurfacePresentModeCompatibilityKHR) and chains
VkSwapchainPresentModeInfoKHR on a tearing present. The device enables the KHR (else EXT)
extension, its feature and the matching instance extensions only where present; without
them the threshold is ignored and logged once, as before. LEONIDA_PRESENT_NO_TEAR=1 turns
it off.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 12:54:49 +01:00
5241cf2cfe FramePacer: lenient tokens, SetFrameIntervalX keeps the origin armed, schedule keeps this period's origin
Only a token that was never handed out is refused; null, stale and repeated
tokens are reported through TokenIssue and presented. SetFrameIntervalX re-bases
the grid and leaves the origin event armed. ScheduleFrameEventX takes the origin
whose offset has not passed yet. ManualFrameClock calls its wake under the lock.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:28:21 +01:00
5ccbd36f39 runtime: FramePacer for the Xbox frame events (interval, origin event, latency, tokens, statistics, suspend/resume)
Header-only, injectable clock, tested on a fake clock (frame_pacer_test).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-22 05:26:41 +01:00