D3D12.X: DPI-aware XCL window, borderless fullscreen and a monitor choice #734
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!734
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-734"
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?
@MrCheese5 on GitHub · 2026-11-24 04:16 UTC · original
MrCheese5:uw-b2-window→main· +1089 −37 · 6 files · 4 commits · openStacked 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 (bdab194and91f9a5e;bdab194had passed with 4 threads earlier the same night, and the driver logs GPU errors). Single-threaded,main91f9a5epasses (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
@LocranKing on GitHub · 2026-11-24 04:46 UTC · original
Tested on Windows 11 + NVIDIA GeForce RTX 3060 Ti (8 GB, wave32).
Tested
d8dfa6f2d54bf5fe89bf10869598aab7a3c7357d(pr-734, clean tree)8024 MiB VRAM, driver32.0.16.2101),rustc 1.100.0(x86_64-pc-windows-msvc, MSVC14.44.35207), DXC1.9.2602.17(SDK10.0.26100.0),--releasecargo test --workspace --release --no-fail-fast -- --test-threads=4:xcllib: 657 passed, 1 failed, 21 ignored (hle::d3d12x::real::readback_routing_tests::coherent_buffer_sanitizes_console_flags_and_statepanicked atcrates\xcl\src\hle\d3d12x\real.rs:5355:17onassert_ne!(VirtualFree(...), 0)).2 (no wave64)skipped (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware).cargo test --release -p xcl --lib coherent_buffer_sanitizes_console_flags_and_state): 1 passed, 0 failed (appears to be a--test-threads=4concurrency flake, not a regression from #734).Regression run (
scripts/smoke.ps1, 60 s,XCL_NETWORK=0, title folder name redacted)main (
64b3f35):PR #734 (
d8dfa6f):Not tested: Multi-monitor / borderless fullscreen / DPI-scaled interactive checks, debug build,
XCL_SAMPLE_*tests on this branch, AMD / wave64 hardware.AI use: Antigravity (
Gemini 4 Hydrogen) ran the build, tests, and smoke runs and drafted this report from the command outputs.@MesshM on GitHub · 2026-11-24 04:47 UTC · original
Test run of
d8dfa6f2d54bf5fe89bf10869598aab7a3c7357don AMD RDNA4. I merged it onto currentmain64b3f35locally (clean merge), so the tree tested includes the stack under it (#555, #732, #733).Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 707 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 666 passed, 0 failed, 21 ignoredSKIPPED;pick_monitor_by_settingand the otherpresenttests pass.Review: Per-monitor DPI awareness (V2) is set in
host_mainbefore any window exists, which is the order Windows requires. The window and fullscreen behaviour itself needs a desktop session and was not exercised by the tests; I reviewed the top commit only.Not tested: no retail title or regression run (I have no unpacked game), no
XCL_SAMPLE_*tests, release build; the PR's head on its old base was not run, only its merge ontomain.Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
@JJAutoCompare on GitHub · 2026-11-25 06:18 UTC · original
Empirical test report (
d8dfa6f2)Hardware / environment
Commit
d8dfa6f2d54bf5fe89bf10869598aab7a3c7357don STOR-WINLAB, Windows 10.0.26200.9974, non-interactive Session 0. AMD Ryzen 7 3800X (8 cores). Rust and Cargo 1.100.0, targetx86_64-pc-windows-msvc, unoptimized test profile with debug info and incremental compilation disabled. DXC 1.9.2609.5. The focused D3D12 run held the Intel Arc A770 test lock withXCL_ADAPTER=A770. The test helper uses the default D3D12 adapter with a WARP fallback and reports neither selection, so the actual adapter is unconfirmed.Commands and results
cargo test --workspace --no-runexited 0 outside the Arc launcher. It compiled the workspace test binaries.XCL_ADAPTER=NONE_CPU_ONLY,xcl-605328e7431afb17.exe pick_monitor_by_setting window_position_modes route_filters_only_when_the_window_is_smaller place_keeps_the_aspect_ratio --test-threads=1exited 0. 4 passed, 0 failed, 0 ignored, 0 skipped.Invoke-ArcTest.ps1withXCL_ADAPTER=A770,xcl-605328e7431afb17.exe downscale_matches_a_cpu_area_filter placed_image_between_black_bars swap_chain_follows_the_window --test-threads=1exited 101. 2 passed, 1 failed, 0 ignored, 0 skipped.RUST_TEST_NOCAPTURE=1. Total: 6 passed, 1 failed, 0 ignored, and 0 case-sensitiveSKIPPEDlines.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.
swap_chain_follows_the_windowfailed on the first 1280×720 frame afterCreateSwapChainForHwndreturned0x887A0022(DXGI_ERROR_NOT_CURRENTLY_AVAILABLE), the expected Session 0 restriction.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.
@DavidM1911 on GitHub · 2026-11-25 11:38 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@ozimchuk on GitHub · 2026-11-25 18:48 UTC · original
A Linux test of the exact head
d8dfa6f(on its basemain91f9a5e): entering fullscreen works under Wine, with and without a window manager; on GNOME (Mutter) the way back to a window misplaces it, and one Alt+Enter was not acted on.Tested
VKD3D_CONFIG=ignore_shared_fence), release build forx86_64-pc-windows-gnu; a 1920x1080 monitor at 100 %.monitor 1: \\.\DISPLAY1 1920x1080 at 0,0, 100 % scale, primary,XCL window created (1600x900 pixels, 100 % scale).Under Xvfb, no window manager
XCL window: fullscreen 1920x1080 at 0,0, the window covers the screen; F11 again:XCL window: windowed 1608x934, back to the window. Both as expected.XCL_FULLSCREEN=1: starts asfullscreen 1920x1080 at 0,0(fullscreen – Alt+Enter or F11 for a window), swap chain 1920x1080.On GNOME (Mutter), X11
created (1600x900 …)fullscreen 1920x1080 at 0,0windowed 1608x934fullscreen 1920x1080 at 0,0So entering fullscreen is fine here; restoring the window does not come back to its old frame and position under this window manager, and the second Alt+Enter did not toggle.
Not caused by this PR, for context
msvcrt.dll(read access violation); the base without it ended the same way at 81 s; the desktop run with the PR went on for about 4 minutes until I closed it. So I would not read those crashes as this PR's.main(present.rs,host.rs), so these runs are on its own base.Not tested: Windows; Wayland; a scaled display (only 100 %); a second monitor; the
monitorsetting.AI-assisted. Claude Code, Claude Opus 5.5 made the runs and wrote this comment.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.