D3D12.X: borderless fullscreen on Alt+Enter / F11, the image at its aspect #599

Closed
simnJS wants to merge 2 commits from upstream-pr/604 into main
simnJS commented 2026-11-24 02:24:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by simnJS on 2026-11-24T02:24:13Z.


Stacked on #555; only the top commit (a452faa) belongs here.

The XCL window was a fixed WS_OVERLAPPEDWINDOW and DXGI's Alt+Enter is off (DXGI_MWA_NO_ALT_ENTER), so a player could not fill the screen; and the area filter of #555 stretched the image over the whole client area whatever its shape. Alt+Enter or F11 now toggles borderless fullscreen on the window's monitor and back (previous style, size and position restored), fullscreen = true in xcl.toml starts in it, and when the client's shape differs from the image's the image keeps its aspect ratio, centred, with black bars. Not exclusive fullscreen; Alt+Enter does not press A.

What is in it

  • D3D12.X: borderless fullscreen on Alt+Enter / F11, the image at its aspect (one commit, +360 / -20):
    • crates/xcl/src/hle/d3d12x/window_mode.rs (new): the key decision (Alt+Enter, F11; auto-repeat and the Alt+Enter WM_SYSCHAR eaten), the toggle (WS_POPUP over the monitor's full rectangle, Get/SetWindowPlacement on the way back), letterbox (the largest centred rectangle of the image's aspect), the tests.
    • present/downscale.rs: Scaler::record draws into that rectangle (viewport, scissor, its origin in the shader's constants) after clearing the back buffer to opaque black. The Copy route is unchanged.
    • present.rs: the keys in wndproc, the start in fullscreen in window_thread, the rectangle on the Filter route.
    • kbm.rs: Enter held with Alt is not A until Enter is released; config.rs: fullscreen (default false); README.md (Controls).

Tested

  • NVIDIA GeForce RTX 4080 SUPER (driver 621.01, 32-lane waves), AMD Ryzen 9 7950X3D, 63 GB; Windows 11 Pro build 26300; Rust 1.99.1 (stable-x86_64-pc-windows-msvc); DXC 1.8.2502.11 (Windows SDK 10.0.26100.0).
  • scripts/test.ps1 (debug) on a452faa: 687 passed, 0 failed, 41 ignored.
  • SKIPPED on this adapter (no wave64): gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware.
  • New tests: window_mode (rectangle for 16:10, 21:9, 32:9, 4:3, same-ratio and odd clients; monitor rectangle and style; key decision; a real hidden window toggled and restored; a GPU draw into two other-shaped clients: bars opaque black – fails without the clear –, the image area equal to the CPU area filter into the rectangle), kbm (alt_enter_is_not_a), config (the new key).
  • Retail title 1.0.2.1 (release build of 2aa5b70, the same change on #555's previous base): a script posted F11 / Alt+Enter to the window and reshaped it during a 60 s run. F11: client 2560x1440 at 0,0, style WS_POPUP; Alt+Enter: back to 1280x720 at its place with its frame; a 1280x1000 client (letterboxed); 1280x720; F11 twice. Each change logged present: swap chain WxH, no ResizeBuffers refusal, no device removal, 1526 of 1526 PresentX shown.

Regression run

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: NVIDIA GeForce RTX 4080 SUPER
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1568 (PresentX 1568)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14799 MB
xcl-smoke v1
commit: a452faa3c541ea61c753ba8d49dfc9ef3fb5d99c
gpu: NVIDIA GeForce RTX 4080 SUPER
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1576 (PresentX 1576)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15204 MB

Same title for 60 s, XCL_NETWORK=0, a 1280x720 window (windowed: the fullscreen code path is not taken in this run), the title's save folder emptied before each run.

Not tested

  • The black bars by eye on the retail title (checked by the GPU test), a monitor that is not 16:9, several monitors, DPI changes.
  • Exclusive fullscreen (not offered), HDR.
  • AMD and Intel GPUs, Windows 10.

AI use

  • Claude Code with Claude Opus 5.5: wrote the code and the tests (a Claude Code worker session, Claude Opus 5.5), ran the test suite, the fullscreen script and the regression runs, and wrote this description.
<!-- greyfinch-sync:ivall/xcl:issue:6573193647 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/604). Originally posted by [simnJS](https://github.com/simnJS) on 2026-11-24T02:24:13Z. --- Stacked on #555; only the top commit (a452faa) belongs here. The XCL window was a fixed `WS_OVERLAPPEDWINDOW` and DXGI's Alt+Enter is off (`DXGI_MWA_NO_ALT_ENTER`), so a player could not fill the screen; and the area filter of #555 stretched the image over the whole client area whatever its shape. Alt+Enter or F11 now toggles borderless fullscreen on the window's monitor and back (previous style, size and position restored), `fullscreen = true` in `xcl.toml` starts in it, and when the client's shape differs from the image's the image keeps its aspect ratio, centred, with black bars. Not exclusive fullscreen; Alt+Enter does not press A. **What is in it** - `D3D12.X: borderless fullscreen on Alt+Enter / F11, the image at its aspect` (one commit, +360 / -20): - `crates/xcl/src/hle/d3d12x/window_mode.rs` (new): the key decision (Alt+Enter, F11; auto-repeat and the Alt+Enter `WM_SYSCHAR` eaten), the toggle (`WS_POPUP` over the monitor's full rectangle, `Get/SetWindowPlacement` on the way back), `letterbox` (the largest centred rectangle of the image's aspect), the tests. - `present/downscale.rs`: `Scaler::record` draws into that rectangle (viewport, scissor, its origin in the shader's constants) after clearing the back buffer to opaque black. The Copy route is unchanged. - `present.rs`: the keys in `wndproc`, the start in fullscreen in `window_thread`, the rectangle on the Filter route. - `kbm.rs`: Enter held with Alt is not A until Enter is released; `config.rs`: `fullscreen` (default false); `README.md` (Controls). **Tested** - NVIDIA GeForce RTX 4080 SUPER (driver 621.01, 32-lane waves), AMD Ryzen 9 7950X3D, 63 GB; Windows 11 Pro build 26300; Rust 1.99.1 (stable-x86_64-pc-windows-msvc); DXC 1.8.2502.11 (Windows SDK 10.0.26100.0). - `scripts/test.ps1` (debug) on a452faa: 687 passed, 0 failed, 41 ignored. - SKIPPED on this adapter (no wave64): `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`. - New tests: window_mode (rectangle for 16:10, 21:9, 32:9, 4:3, same-ratio and odd clients; monitor rectangle and style; key decision; a real hidden window toggled and restored; a GPU draw into two other-shaped clients: bars opaque black – fails without the clear –, the image area equal to the CPU area filter into the rectangle), kbm (`alt_enter_is_not_a`), config (the new key). - Retail title 1.0.2.1 (release build of 2aa5b70, the same change on #555's previous base): a script posted F11 / Alt+Enter to the window and reshaped it during a 60 s run. F11: client 2560x1440 at 0,0, style `WS_POPUP`; Alt+Enter: back to 1280x720 at its place with its frame; a 1280x1000 client (letterboxed); 1280x720; F11 twice. Each change logged `present: swap chain WxH`, no `ResizeBuffers` refusal, no device removal, 1526 of 1526 PresentX shown. **Regression run** ``` xcl-smoke v1 commit: 9ce2070eccf436d7bd38601c90407da447df34f3 gpu: NVIDIA GeForce RTX 4080 SUPER title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1568 (PresentX 1568) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14799 MB ``` ``` xcl-smoke v1 commit: a452faa3c541ea61c753ba8d49dfc9ef3fb5d99c gpu: NVIDIA GeForce RTX 4080 SUPER title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1576 (PresentX 1576) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15204 MB ``` Same title for 60 s, `XCL_NETWORK=0`, a 1280x720 window (windowed: the fullscreen code path is not taken in this run), the title's save folder emptied before each run. **Not tested** - The black bars by eye on the retail title (checked by the GPU test), a monitor that is not 16:9, several monitors, DPI changes. - Exclusive fullscreen (not offered), HDR. - AMD and Intel GPUs, Windows 10. **AI use** - Claude Code with Claude Opus 5.5: wrote the code and the tests (a Claude Code worker session, Claude Opus 5.5), ran the test suite, the fullscreen script and the regression runs, and wrote this description.
futurepro62 commented 2026-11-24 07:06:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T03:59:18Z.


Tested exact head a452faa (on its base 9ce2070).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4, twice:
    • run 1 hung in the lib tests on the #344 deadlock (gpu_uma_import_check_at_init, gpu_typed_buffer_loads_and_stores, gpu_valu_16_and_64_bit, gpu_wave32_and_wave64_src_vccz_execz; main has it too, #443 fixes it); stopped after 900 s.
    • run 2: 650 passed, 3 failed, 21 ignored in the lib tests, all in files this PR does not change: title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels (cubemap extra_pages must be reused at same va, left 2359296, right 2555904), then title_textures::tests::transitions_apply_when_their_list_is_submitted and vram::tests::d32s8_targets_take_their_own_size_of_video_memory on the lock it poisoned (PoisonError).
  • XCL_REQUIRE_GPU=mesh cargo test -p xcl --lib -- --test-threads=4, 3 more runs: 1 passed (653 passed, 0 failed, 21 ignored), 2 hung on #344 as above.
  • The same three tests failed the same way in the same batch on #606 and #608 (also on 9ce2070), but in none of 15 later lib runs (5 each on main 9ce2070, #606 and #608). So I read the failure as intermittent in the title-texture test on main, not caused by this PR.

Not tested

  • Alt+Enter / F11 and the downscale (no interactive run), the whole workspace suite to the end on this head (lib tests only, above), a retail title or scripts/smoke.ps1 (no title on this machine), AMD, a release build.

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7121602784 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/604#issuecomment-7121602784). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T03:59:18Z. --- Tested exact head `a452faa` (on its base `9ce2070`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`, twice: - run 1 hung in the lib tests on the #344 deadlock (`gpu_uma_import_check_at_init`, `gpu_typed_buffer_loads_and_stores`, `gpu_valu_16_and_64_bit`, `gpu_wave32_and_wave64_src_vccz_execz`; `main` has it too, #443 fixes it); stopped after 900 s. - run 2: 650 passed, **3 failed**, 21 ignored in the lib tests, all in files this PR does not change: `title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels` (`cubemap extra_pages must be reused at same va`, left 2359296, right 2555904), then `title_textures::tests::transitions_apply_when_their_list_is_submitted` and `vram::tests::d32s8_targets_take_their_own_size_of_video_memory` on the lock it poisoned (`PoisonError`). - `XCL_REQUIRE_GPU=mesh cargo test -p xcl --lib -- --test-threads=4`, 3 more runs: 1 passed (653 passed, 0 failed, 21 ignored), 2 hung on #344 as above. - The same three tests failed the same way in the same batch on #606 and #608 (also on `9ce2070`), but in none of 15 later lib runs (5 each on `main` `9ce2070`, #606 and #608). So I read the failure as intermittent in the title-texture test on `main`, not caused by this PR. **Not tested** - Alt+Enter / F11 and the downscale (no interactive run), the whole workspace suite to the end on this head (lib tests only, above), a retail title or `scripts/smoke.ps1` (no title on this machine), AMD, a release build. **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
MesshM commented 2026-11-24 07:06:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by MesshM on 2026-11-24T05:00:44Z.


Test run of a452faa3c541ea61c753ba8d49dfc9ef3fb5d99c on AMD RDNA4. I merged it onto current main 64b3f35 locally (clean merge), so the tree tested includes the stack under it (#555).

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 710 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 669 passed, 0 failed, 21 ignored
  • 0 SKIPPED; alt_enter_and_f11_toggle_plain_enter_does_not and fullscreen_covers_the_monitor_without_a_frame pass.

Review: It overlaps #734 in purpose (borderless fullscreen and the image at its aspect on top of #555), so the maintainer will want one of the two; I did not compare them line by line.

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 onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

<!-- greyfinch-sync:ivall/xcl:comment:7122540992 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/604#issuecomment-7122540992). Originally posted by [MesshM](https://github.com/MesshM) on 2026-11-24T05:00:44Z. --- Test run of `a452faa3c541ea61c753ba8d49dfc9ef3fb5d99c` on AMD RDNA4. I merged it onto current `main` `64b3f35` locally (clean merge), so the tree tested includes the stack under it (#555). **Tested** - AMD Radeon RX 9060 XT 16 GB (RDNA4), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 `stable-x86_64-pc-windows-msvc`, debug - `cargo build --workspace` + `cargo test --workspace -- --test-threads=4` on the merge: **710 passed, 0 failed, 41 ignored**, exit code 0; `xcl` lib tests 669 passed, 0 failed, 21 ignored - **0 `SKIPPED`**; `alt_enter_and_f11_toggle_plain_enter_does_not` and `fullscreen_covers_the_monitor_without_a_frame` pass. **Review:** It overlaps #734 in purpose (borderless fullscreen and the image at its aspect on top of #555), so the maintainer will want one of the two; I did not compare them line by line. **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 onto `main`. Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.
upstream-sync closed this pull request 2026-11-24 19:04:44 +00:00

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!599
No description provided.