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)
…spect 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 stretched the image over the whole client area whatever its shape. - hle/d3d12x/window_mode.rs (new): Alt+Enter / F11 toggle borderless fullscreen – WS_POPUP over the whole rectangle of the window's monitor (not its work area), the previous style and placement restored on the way back (Get/SetWindowPlacement). Still no exclusive fullscreen. Auto-repeat and the Alt+Enter WM_SYSCHAR (DefWindowProc beeps) are eaten. `letterbox`: the largest centred rectangle of the image's aspect in the client area (a side within a pixel of the client's fills it, so rounding leaves no 1-pixel bar). - 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 (client as large as the image on both sides) is unchanged. - present.rs: integration lines only – the keys in wndproc, the start in fullscreen in window_thread, the rectangle passed on the Filter route. - kbm.rs: Enter held with Alt is not A (gameinput::keyboard reads Enter as A), until Enter is released; Space still is. - config.rs: `fullscreen = false` in xcl.toml, true starts in it. 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 – the test 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). Assisted-by: Claude Code (Claude Opus 5.5)
|
Tested exact head Tested
Not tested
AI use
|
This was referenced Nov 24, 2026
|
Test run of Tested
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 Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #555; only the top commit (a452faa) belongs here.
The XCL window was a fixed
WS_OVERLAPPEDWINDOWand 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 = trueinxcl.tomlstarts 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+EnterWM_SYSCHAReaten), the toggle (WS_POPUPover the monitor's full rectangle,Get/SetWindowPlacementon the way back),letterbox(the largest centred rectangle of the image's aspect), the tests.present/downscale.rs:Scaler::recorddraws 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 inwndproc, the start in fullscreen inwindow_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
scripts/test.ps1(debug) on a452faa: 687 passed, 0 failed, 41 ignored.gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask,gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware.alt_enter_is_not_a), config (the new key).WS_POPUP; Alt+Enter: back to 1280x720 at its place with its frame; a 1280x1000 client (letterboxed); 1280x720; F11 twice. Each change loggedpresent: swap chain WxH, noResizeBuffersrefusal, no device removal, 1526 of 1526 PresentX shown.Regression run
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
AI use