Repository navigation
dxgi: wait for vertical blank on the requested monitor - #8530
LukeOsland1 wants to merge 3 commits into
Conversation
|
Independent build + test: PASS (single 60 Hz monitor, so the multi-monitor case isn't exercised) AI-assisted (Claude Code). Windows 11 x64, MSVC 19.44.35220, Ninja RelWithDebInfo, NVIDIA GeForce RTX 3080 driver 621.24 / 32.0.16.2124, one 60 Hz monitor attached. Head
With one output, the new per-source Note: |
|
Tested
|
tupacfan04
left a comment
There was a problem hiding this comment.
The monitor selection is correct (WaitForVBlank(info_), with_display_source, shim/native outputs matched by HMONITOR), but the new cadence regression does not pin the requested monitor:
same_vblank_cadenceoverwrites the shim'sstablewith the host sample (runtime/test/dxgi_swapchain_test.cpp:89-90); the shim'sstableis never consulted. An intermittent wrong-monitor wait (e.g. a failed per-monitor wait falling back toDwmFlushon some samples) can still pass the 30% median, and a same-rate secondary monitor is invisible.- When the first native sample fails/is unstable/under 1 ms, or the second is unstable or the median changes >10%, the test returns
trueand skips the shim comparison entirely; a busy desktop can mask a shim regression. D3DKMTWaitForVerticalBlankEvent(runtime/shims/dxgi_com.cpp:942-951) has no timeout; a stopped/off/disabled source can block forever, since theDwmFlushfallback is reached only on an error return. The fallback is the compositor cadence, not the requested monitor, andhEventis zero (:947).
Fix: check the shim's stable, add a same-rate/wrong-monitor and a stopped-source case, bound the wait with a timeout/watchdog, and test the fallback path. Synthetic/static only; no game files. AI-assisted (OpenCode).
|
Tested
Code read (
One non-blocking note: each No game files. AI-assisted (Claude Code). |
|
Tested
Synthetic fixtures only, no game files. AI-assisted. |
Depends on: #8482
Coordination claim.
A client waiting on the 120 Hz secondary monitor woke twice per refresh. The shim used a compositor-wide DwmFlush for every output. Resolve the monitor's WDDM display source and call D3DKMTWaitForVerticalBlankEvent on that source. Keep the existing fallback if the monitor or driver wait is unavailable. This follow-up shares the adapter-handle lifetime and monitor resolution introduced in #8482.
The regression compares median intervals over 17 consecutive waits on each attached output against native DXGI. Two native samples bracket the shim run to detect unstable host timings.
Parent runtime b7e39dc and fixed runtime c7a5615, same test. The validation-enabled Windows swapchain suite passed on the RTX (driver 32.0.16.1088) and integrated AMD Radeon (32.0.21042.62) with zero validation errors. The Radeon has no attached monitor on this PC, so only the RTX exercised the physical timing comparison.
AI-assisted with Codex. Synthetic runtime test. No display settings changed.