d3d12_xs: add multi-event FramePacer TOKEN_ON_TIMEOUT and wire XboxPresentation to device/queue slots (RT-XS-FRAME-PACING-PRESENTX) #402
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
missing claim
needs rebase
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ubiquitarianism--leonida!402
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/402/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Andretuta on GitHub · 2026-11-24 04:43 UTC · original
ubiquitarianism:feat/xs-frame-pacing-presentx→main· +468 −72 · 8 files · 4 commits · merged 2026-11-24 13:44 UTCClaimed in the coordination issue as:
RT-XS-FRAME-PACING-PRESENTX(#14)What and why
Extends
FramePacerand adds the seam that will connect the Xbox device/queue proxies toXboxPresentation:runtime/src/frame_pacer.h: vblank (1) and flip (2) frame events next to origin (0), each with its own offset, and a token-on-timeout wait flag (bit 2) that issues a consecutive token and returnsS_FALSEwhen a finite origin wait times out. These values are provisional definitions of ours; the console constants are unmeasured.runtime/shims/d3d12_xs_device.{h,cpp}:PresentationHandler+set_presentation_handler(device, handler)keep the device proxy free of Vulkan headers. With a handler attached, device slots 78-81 (SetFrameIntervalX,ScheduleFrameEventX,WaitFrameEventX,GetFrameStatisticsX) and the queue'sPresentXgo to it; the handler is called with its lock held shared, so a detach cannot destroy the presenter mid-call.PresentXdefaults to queue slot 30 (XCL's older layout; 32 is the newer one,LEONIDA_XS_PRESENT_X_SLOT).SuspendX/ResumeXslots are unmeasured, so they are routed only whenLEONIDA_XS_SUSPEND_X_SLOT/LEONIDA_XS_RESUME_X_SLOTare set; two routes on one slot are refused with a log.GetFrameStatisticsXis a route like 78-80 (LEONIDA_XS_FRAME_STATISTICS_SLOT, default 81). Without a presenter it answersS_FALSEwith a zero count instead of reaching PC slot 81 (ID3D12Device13::OpenExistingHeapFromAddress1).env_slot()parser serves device and queue slots.runtime/shims/xbox_present.{h,cpp}:attach_xbox_presentation/detach_xbox_presentation. Not called bygta6rtyet: the runtime creates noXboxPresentation(onlyd3d12_boot_movie_testandxbox_present_testdo); this is the seam the presenter will use.docs/d3d12_vulkan.md: documents slot 81, the queue routes and their variables.No longer depends on #359 or #360: it merges with current
mainand with both on its own.Tested
xs_proxy_mock_test(all checks but the pre-existingkLongallocation-injection ones, which also fail onmainunder mingw),--env-slots,--env-slots-invalid,frame_pacer_test; docs tests includingtest_docs_env_vars.GPUs tested: n/a (CPU-only mock clock and synthetic COM proxy tests)
AI-assisted: yes
Checklist
mainand merges cleanly (a conflicting pull request is labeledneeds rebase).docs/design.md, with how it was confirmed. (n/a)🤖 Generated with Claude Code
- Support origin (0), vblank (1), and flip (2) frame events and frame_wait_flag_token_on_timeout (flag 2, returning S_FALSE with a fresh consecutive token on timeout) in runtime/src/frame_pacer.h. - Add a decoupled PresentationHandler interface to d3d12_xs_device.{h,cpp} routing device slots 78-81 and queue PresentX/SuspendX/ResumeX slots (default 30/31/32, env-overridable via LEONIDA_XS_*_SLOT). - Add attach_xbox_presentation / detach_xbox_presentation in runtime/shims/xbox_present.{h,cpp}.latencyframes in flight while armed (mailbox replace) #671