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)
7550904 to
57a13c1
Compare
|
Independent Present/downscale check of Tested: Not tested: full workspace concurrency with texture/VRAM tests, visual retail gameplay, or other adapters. AI use: OpenAI Codex (GPT-6) ran the local tests and drafted this report. Follow-up: parallel GPU test groups. Same RTX 3060 and toolchain. I ran
This shows an intermittent device hang with the combined test groups on this setup. The base comparison does not isolate the cause because it lacks the three added tests. No retail files or full workspace run. Codex ran the checks and summarized the logs. |
|
Test report for Setup: AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008, Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 Tests: By eye: I watched eight runs: Title runs:
On Regression run:
PR merged onto PR head: Not tested: a resized or minimized window; a window larger than the image; HDR; moving between monitors; no pixel-level comparison (by eye only). AI use: Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, and wrote this report. The visual comparison was done by me. |
A window smaller than the title's image showed jagged text and thin lines. The title presents 3840x2160;
present.rscopied that image into a swap chain of the same size (DXGI_SCALING_STRETCH) and DWM shrank it to the XCL window (1280x720 by default) with one bilinear tap per window pixel, which skips texels at 3x or 1.5x. Now, when the client area is smaller than the image, the swap chain takes the client size and XCL draws the image into it with an area filter (each texel weighted by the area it covers, in linear light). A window as large as the image keeps the copy; a minimized one shows nothing; without DXC the copy stays, with one log line.Fixes #554
Rebased on main 9ce2070 (merges cleanly with cb868b2 too). Since the first push:
swap_chain_follows_the_windowwaits for its last frame before dropping its presenter – dropping it with the filter's draw still on the GPU hung the device every GPU test of the process shares (DXGI_ERROR_DEVICE_HUNG), which failedtitle_textures/vramtests in most--test-threads=4runs; 6 of 6 green with the wait.What is in it
D3D12.X: shrink the game image to the window with an area filter(one commit):crates/xcl/src/hle/d3d12x/present/downscale.rs(new):route(Copy / Filter / Skip),Scaler(full-screen triangle, area-filter pixel shader with its root signature, compiled withdxc::compile_cached), the tests.crates/xcl/src/hle/d3d12x/present.rs:present_frame(the per-frame work ofpresent_now, so a test can drive it), the swap chain at the client size,client_size,scaler_ready, a logged and throttledResizeBuffersrefusal that still shows the frame at the current size, onepresent:line for the route.note_rtvat once: the adopted device'sCreateRenderTargetViewhook keeps a reference to every view's resource, and one held swap chain buffer made everyResizeBuffersfail (DXGI_ERROR_INVALID_CALL).Tested
scripts/test.ps1(cargo build --workspace+cargo test --workspace -- --test-threads=4, debug) on 57a13c1: 687 passed, 0 failed, 41 ignored.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware.route_filters_only_when_the_window_is_smaller;downscale_matches_a_cpu_area_filter(1-pixel lines and a checker, 3840x2160 and 1920x1080 into 1280x720, within 1.5 of 255; fails by 73 with the sRGB decode removed from the shader);swap_chain_follows_the_window(adopted device, hidden window: 1280x720, 1920x1080, 800x450, minimized, 1280x720, and a refused resize that still shows the frame; fails at 1920x1080 with 0x887A0001 without thenote_rtvline).present: 3840x2160 image in a 1280x720 client area – area filter into a swap chain of the client size; menu text is clean where main's is jagged (checked against a full-sizeXCL_FRAME_DUMP_FULL=1dump of the same screen).present: swap chain WxH, noResizeBuffersrefusal, no device removal; 1682 of 1802 PresentX were shown, the other 120 during the 4 s minimized. Without thenote_rtvline: 635 of 1156.Regression run
Same title for 60 s,
XCL_NETWORK=0, a 1280x720 window (the PR's run uses the filter), the title's save folder emptied before each run.Not tested
README.mdis not changed; D3D12.X: XCL_OVERLAY draws fps / stats into the shown frame #450 also changespresent.rs.AI use