D3D12.X: the game's image keeps its aspect ratio in the window #728
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from ivall/xcl. Originally posted by MrCheese5 on 2026-11-24T04:15:58Z.
Stacked 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
Imported from ivall/xcl. Originally posted by LocranKing on 2026-11-24T04:46:53Z.
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.Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T04:47:39Z.
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.
Imported from ivall/xcl. Originally posted by JJAutoCompare on 2026-11-25T06:10:32Z.
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.
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T11:40:49Z.
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
Imported from ivall/xcl. Originally posted by upipibi on 2026-11-25T13:10:34Z.
@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.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:43:20Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T04:01:13Z.
Triage (#1607) – head
8244a72Stacked on
f462cf64(the area filter from #555, which its author closed unmerged) andb7900d00(#732, closed because main has that change in587d77be). Only8244a72ais this PR's own commit, and the area-filter commit now has no open PR of its own. #734 and #735 are stacked on this one.No open or merged PR keeps the image's aspect ratio (#604, which also did, is closed). Main's presenter has changed a lot since (ring, compositor), so this conflicts and needs a rebase.
No problems found in
present.rs:draw/downscale::place.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.