Repository navigation
Conversation
Text and thin lines of a retail title looked jagged in the XCL window. Root cause: the title presents 3840x2160, present.rs copied it into a swap chain of the same size (DXGI_SCALING_STRETCH) and DWM shrank it to the window (1280x720 by default) with a single bilinear tap per pixel: at 3x or 1.5x it skips texels, so strokes get uneven and edges stair-step. A full-size frame dump of the same frame is clean. When the window's client area is smaller than the image on either side, the swap chain now takes the client size (ResizeBuffers on resize) and a full-screen triangle draws the image into it: its pixel shader averages the whole footprint of each window pixel (area filter, exact partial texel weights), in linear light - 8/10-bit UNORM decoded and encoded with the sRGB curve (the swap chain's default colour space), an _SRGB source through its view, FP16 (scRGB) as is. A window as large as the image keeps the copy; a minimized one (0x0) shows nothing and keeps its swap chain. Without DXC (or a pipeline the device refuses) the copy stays, with one log line. Frame dumps still read the title's own image. One "present:" line names the route and the sizes. Resizes: the presenter draws on the title's adopted device, whose CreateRenderTargetView hook (note_rtv) keeps a reference to every view's resource; the filter's view of a back buffer would hold one swap chain buffer and make every ResizeBuffers fail (DXGI_ERROR_INVALID_CALL), so Scaler::record forgets its own view at once. A refused ResizeBuffers is logged once per size and asked for again twice a second; the frame is still shown, drawn at the swap chain's current size. present_now's per-frame work is present_frame, so a test can drive it. Tests: the route decision; a GPU test drawing 1-pixel lines and a checker from 3840x2160 and 1920x1080 into 1280x720 against a CPU area filter (within 1.5 of 255); a GPU test on an adopted device with a hidden window: frames at 1280x720, 1920x1080, 800x450 (each new back buffer matches the CPU filter), minimized, 1280x720 again, and a refused resize that still shows the frame. Assisted-by: Claude Code (Claude Opus 5.5)
Dropping a Presenter released the swap chain, the scaler's descriptor heaps and the title's image while its last present's command list could still be running on the GPU. swap_chain_follows_the_window drops its presenter right after the last present_frame; when the list was still running, the device was suspended (0x887A0005) and the GPU tests that ran after it failed. That happens intermittently and depends on timing. The drop now waits for the presenter's fence (2 s at most; not after a failed Signal, when the presenter is disabled). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Test run and review of Tested
Review
Not tested
AI use
|
|
Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32). Tested
Regression run ( main ( PR #732 ( Not tested: Debug build, AI use: Antigravity ( |
|
Test run of Tested
Review: Waiting for the last present's fence before the presenter's swap chain, scaler heaps and image are released closes the lifetime gap described. Since it fixes #555's own presenter, folding it into #555 (as the description offers) would keep #555 from landing with the gap. Not tested: no retail title or regression run (I have no unpacked game), no Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
Empirical test report (b7900d0)PR #732 head Hardware / environment
Commands and results
Observed behavior The fixture initialized D3D12 and the area filter. Its first 1280×720 frame failed at Not tested Interactive desktop presentation, teardown with a present in flight, the full GPU workspace suite, and game smoke runs were omitted. AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Stacked on #555; only the top commit belongs here. It fixes a lifetime issue in #555's presenter, so it could also be folded into #555.
Dropping a
Presenterreleased the swap chain, the scaler's descriptor heaps and the title's image while the command list of its last present could still be running on the GPU. #555'sswap_chain_follows_the_windowdrops its presenter right after the lastpresent_frame. When that list is still running, the device is suspended (0x887A0005) and the GPU tests that run after it in the same process fail. That depends on timing, so it happens intermittently.Dropnow waits for the presenter's fence: 2 s at most, and not after a failedSignal, when the presenter is already disabled.On
mainwithout #555, a presenter is dropped only when the present queue changes, and that path already waits for the fence. So the fix belongs on top of #555.What is in it
crates/xcl/src/hle/d3d12x/present.rs:Drop for Presenterwaits for the last presentTested
swap_chain_follows_the_windowalready reproduces the failure, intermittentlycargo test --workspace -- --test-threads=1: 695 passed, 0 failed, 41 ignored; SKIPPED:gpu_geometry_wave32_prefix_count_over_a_mask(no wave64),gpu_wave32_program_in_wave64_hardware(no wave64)--test-threads=4, GPU tests on this machine hang or lose the device tonight onmaintoo (bdab194 and 91f9a5e; bdab194 had passed with 4 threads earlier the same night, and the driver logs GPU errors). Single-threaded,main91f9a5e passes (cargo test -p xcl --lib -- --test-threads=1: 647 passed, 0 failed).Regression run
Both runs use a fresh data root of their own and the default settings (a 1280x720 window, nothing new turned on), so this shows that nothing else changes.
Not tested
AI use
🤖 Generated with Claude Code