D3D12.X: the game's image keeps its aspect ratio in the window #733
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!733
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-733"
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:15 UTC · original
MrCheese5:uw-b1-aspect→main· +884 −31 · 4 files · 3 commits · openStacked on #555 and #732; only the top commit belongs here.
A 16:9 image in a window of another shape (a 21:9 or 16:10 screen) was stretched to fit it. The swap chain is now the size of the client area, and the image is placed in it according to
scaling(xcl.toml,XCL_SCALING):An image that lands 1:1 (3840x2160 in a 5120x2160 client area) is copied texel for texel into its place (
Route::Place) after the bars are cleared. Other sizes go through #555's area filter, which now draws into a rectangle (a viewport plus an origin root constant), with the bars cleared to black. Without DXC, the old stretched copy stays.This changes behaviour for everyone: a 16:9 image in a window of another shape now gets black bars instead of being stretched.
What is in it
crates/xcl/src/hle/d3d12x/present/downscale.rs:Scaling,place(), the new routes, the filter drawing into a rectangle; tests ofplace()for each scaling, the routes, and a GPU test that places a 1280x720 image 1:1 in 1680x720 (exact texels, black bars) and filters it into 1032x432 (against a CPU area filter)crates/xcl/src/hle/d3d12x/present.rs:present_frameplaces the image;draw()crates/xcl/src/config.rs,README.md:scalingTested
cargo test -p xcl --lib downscale: covered by the suite run belowcargo test --workspace -- --test-threads=1: 697 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
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
8244a72a195d85dff35a5308c0e47535eff8c5ba(pr-733, 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: 697 passed, 0 failed, 41 ignored, exit0;2 (no wave64)skipped (gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware)Regression run (
scripts/smoke.ps1, 60 s,XCL_NETWORK=0, title folder name redacted)main (
64b3f35):PR #733 (
8244a72):Not tested: Non-16:9 / ultrawide monitor scaling (
"integer"/"stretch"), 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
8244a72a195d85dff35a5308c0e47535eff8c5baon AMD RDNA4. I merged it onto currentmain64b3f35locally (clean merge), so the tree tested includes the stack under it (#555, #732).Tested
stable-x86_64-pc-windows-msvc, debugcargo build --workspace+cargo test --workspace -- --test-threads=4on the merge: 706 passed, 0 failed, 41 ignored, exit code 0;xcllib tests 665 passed, 0 failed, 21 ignoredSKIPPED;place_keeps_the_aspect_ratio,placed_image_between_black_barsandswap_chain_follows_the_windowpass.Review: The swap chain follows the client area and the image is placed by
scaling(fit by default), with black bars outside it. 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:10 UTC · original
Empirical test report (
8244a72a)Hardware / environment
8244a72a195d85dff35a5308c0e47535eff8c5baon STOR-WINLAB, Windows x64 build 26200, Session 0, AMD64 Family 23 Model 113. Cargo used the unoptimized test profile with debug info and incremental compilation disabled.1.100.0 (0ef1bc386 2026-11-09)and DXC1.9.2609.5 (01b62ad47). The D3D12 run held the Arc A770 test lock and setXCL_ADAPTER=A770. These fixtures request the default D3D12 device with WARP fallback, so the actual adapter and driver were unverified.Commands and results
cargo test --workspace --no-runbuilt all workspace test targets outside the Arc lock (exit 0). In the commands below,$xclTestsis the xcl library test executable from that build. Both runs setRUST_TEST_NOCAPTURE=1.XCL_ADAPTER=NONE_CPU_ONLYoutside the lock, ran& $xclTests --test-threads=1 place_keeps_the_aspect_ratio route_filters_only_when_the_window_is_smaller(exit 0).XCL_ADAPTER=A770insideInvoke-ArcTest.ps1, ran& $xclTests --test-threads=1 downscale_matches_a_cpu_area_filter placed_image_between_black_bars swap_chain_follows_the_window(exit 101).SKIPPEDmarkers. Both CPU fixtures passed. Two D3D12 fixtures passed and one failed.Observed behavior
swap_chain_follows_the_windowfailed at the first 1280×720 frame in Session 0.CreateSwapChainForHwndreturned0x887A0022(DXGI_ERROR_NOT_CURRENTLY_AVAILABLE) before any resize checks were reached.Not tested
AI use
Verified with T3 Code / Codex (gpt-6.2-sol, reasoningEffort: high). Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified counts against pr733-focused.log and published.
@DavidM1911 on GitHub · 2026-11-25 11:40 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 5 real failures, deterministic (also fail--test-threads=1, 1098/5):The GPU device is being removed mid-test — a real GPU-side crash/regression, not the parallel flake. Needs investigation before merge.
— Devin
@upipibi on GitHub · 2026-11-25 13:10 UTC · original
@DavidM1911 On your 5 failures: they don't reproduce on Ampere, on either tree I could test here. RTX 3070 8 GB, driver 616.56, Windows 11, debug, single-threaded.
--exact, 3 runscargo test -p xcl --lib -- --test-threads=1main1a0bbe3a(no #733)8244a72as-is (its old base)passthrough_mesh_stream_accepts_a_triangle_driver_blobdoesn't exist at #733's base yet, which is why only 4 of your 5 ran there.xaudio2::tests::opus_source_voice_decodes_and_manages_lifetime, the same one onmain, so it isn't #733's.nvlddmkm153 events, and no device removal.What I couldn't test: your tree. #733 conflicts with
mainind3d12x/present.rs(this PR's presenter fields againstmain's present ring), and I didn't resolve it, so I can't rule out the merge or the 3060 Ti.None of your 5 tests goes through
present.rs. So the quickest split is to run them on plainmainon the 3060 Ti. If they fail there too, it isn't this PR.AI-assisted (Claude Code). Synthetic tests only.
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.