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>
A 16:9 image in a window of another shape (a 21:9 or 16:10 screen) was stretched to it. The swap chain is now the client area's size and the image is placed in it by `scaling` (xcl.toml, XCL_SCALING): - "fit" (default): the aspect ratio is kept, with black bars - "integer": whole multiples only (falls back to fit in a smaller window) - "stretch": the old behaviour An image that lands 1:1 (3840x2160 in a 5120x2160 client area) is copied texel for texel at its place (Route::Place, after clearing the bars). Other sizes go through the area filter, which now draws into a rectangle (viewport + an origin root constant) with the bars cleared to black. Without DXC the old stretched copy stays. Tests: place() for each scaling, the routes, and on the GPU a 1280x720 image placed 1:1 in 1680x720 (exact texels, black bars) and filtered into 1032x432 (against a CPU area filter). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…oice At 125 % display scaling Windows enlarged the DPI-unaware XCL window, so the game's image was drawn smaller and blurred back up. - The process is per-monitor DPI aware (V2), set in host_main before the window exists. window_width / window_height are at 100 % and scaled by the monitor's DPI, and WM_DPICHANGED takes the size Windows suggests. - `fullscreen` (XCL_FULLSCREEN): a borderless window over the monitor at its native resolution. Alt+Enter or F11 switches while running. - `monitor` (XCL_MONITOR): "primary", a number from the list logged at start, or a device name. "auto" placement centres on a named monitor. Test: pick_monitor() for each kind of setting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32). Tested
Regression run ( main ( PR #734 ( Not tested: Multi-monitor / borderless fullscreen / DPI-scaled interactive checks, debug build, AI use: Antigravity ( |
|
Test run of Tested
Review: Per-monitor DPI awareness (V2) is set in 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 (d8dfa6f)Hardware / environment Commit Commands and results
Observed behavior Monitor selection, window-position modes, scaling route selection, and aspect-ratio placement passed. The D3D12 readbacks matched the CPU area filter and verified black bars. Not tested Full GPU workspace suite, interactive desktop presentation (Session 0), and game smoke runs. AI use Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr734-focused.log and published. |
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
Thanks! |
Stacked on #555, #732 and #733; only the top commit belongs here.
At 125 % display scaling, Windows enlarged the DPI-unaware XCL window, so the game's image was drawn smaller and then blurred back up.
host_mainbefore the window exists.window_widthandwindow_heightare at 100 % and get scaled by the monitor's DPI, andWM_DPICHANGEDtakes the size Windows suggests.fullscreen(XCL_FULLSCREEN, default false): a borderless window over the monitor at its native resolution. Alt+Enter or F11 switches while the game runs.monitor(XCL_MONITOR, default "primary"): "primary", a number from themonitor N:list logged at start, or a device name. Withwindow_pos = "auto", the window is centred on a named monitor.This changes behaviour for everyone on a scaled display: a 1280x720 window is 1600x900 pixels at 125 %, the same size on screen as before, but sharp.
What is in it
crates/xcl/src/hle/d3d12x/present.rs: DPI awareness, the monitor list and choice, fullscreen and its toggle, the window sized at the monitor's DPI; a test ofpick_monitor()crates/xcl/src/host.rs:dpi_aware()at startcrates/xcl/Cargo.toml: theWin32_UI_HiDpifeature of thewindowscrate (no new crate)crates/xcl/src/config.rs,README.md:fullscreen,monitorTested
cargo test -p xcl --lib pick_monitor: covered by the suite run belowcargo test --workspace -- --test-threads=1: 698 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
WM_DPICHANGEDwhen moving between monitors of different scales.AI use
🤖 Generated with Claude Code