Skip to content

D3D12.X: composite multi-plane PresentX overlays - #615

Open
0x6461726B wants to merge 3 commits into
xcl-dev:mainfrom
0x6461726B:d3d12x-presentx-multiplane
Open

0x6461726B wants to merge 3 commits into
xcl-dev:mainfrom
0x6461726B:d3d12x-presentx-multiplane

Conversation

@0x6461726B

@0x6461726B 0x6461726B commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #605; only the top commit belongs here.

In Xbox Series S (lockhart) mode, a retail title presents two hardware overlay planes per frame to PresentX: plane 0 (1920x1080 scene) and plane 1 (3840x2160 UI/menu/HUD overlay). Because XCL previously copied only plane 0 to the swap chain, menus, loading screens, and HUD were invisible (solid black screen) even while the title ran at 30 fps.

This parses all planes from D3D12XBOX_PRESENT_PLANE_PARAMETERS (stride 0x48, optional pSourceRect) and, whenever 2+ planes are active, lazily composites them into a swap chain sized to the largest plane (plane 0 opaque, planes 1..N premultiplied-alpha over). Single-plane titles keep the existing direct CopyResource fast path.

What is in it

  • extract_planes, source_uv_rect, lazy D3D12 Compositor, and multi-plane present_now compositing path + unit test parse_present_planes_and_uv_rects and WARP GPU test compositor_blends_ui_plane_over_scene_plane in crates/xcl/src/hle/d3d12x/present.rs.

Tested

  • Hardware & OS: NVIDIA GeForce RTX 2060 (driver 32.0.16.2135), Intel Core i5-10400F, Microsoft Windows 11 Pro (Build 26300), rustc 1.100.0 (0ef1bc386 2026-11-09)
  • cargo test --workspace -- --test-threads=4 (debug): 686 passed, 0 failed, 41 ignored
    • SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
    • SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
  • Series S (lockhart) smoke run (retail title, 60 s, release): log confirmed present: compositing 2 planes into 3840x2160 DXGI_FORMAT(28) (plane 0: 1920x1080 DXGI_FORMAT(28) uv [0.0, 0.0, 1.0, 1.0], plane 1: 3840x2160 DXGI_FORMAT(28) uv [0.0, 0.0, 1.0, 1.0]) and present: first game frame shown (3840x2160), running the full 60 s with exit: 0x0, 975 frames shown (PresentX 975), 0 crashes, 0 device removals, and making the title's loading screens/menus visible.

Regression run

xcl-smoke v1
commit: 9ce2070eccf436d7bd38601c90407da447df34f3
gpu: NVIDIA GeForce RTX 2060
title: game6
seconds: 60
exit: 0x0
frames shown: 894 (PresentX 895)
presents per 2 s (last 3): 59 57 59
device removals: 0
crashes: 0
peak commit: 15170 MB
xcl-smoke v1
commit: 9251d80a7a9e283f3f681a77f22f9ede3152491c
gpu: NVIDIA GeForce RTX 2060
title: game6
seconds: 60
exit: 0x0
frames shown: 720 (PresentX 720)
presents per 2 s (last 3): 54 60 57
device removals: 0
crashes: 0
peak commit: 16116 MB

Not tested

  • AMD GPUs and native wave64 hardware (no wave64 skipped the two wave64 GPU tests above).
  • Titles presenting >2 planes, non-premultiplied/straight-alpha plane flags, or non-trivial pDestinationRect scaling.

AI use

  • Google Antigravity (Gemini 4 Neon High): diagnosed the 2-plane PresentX black screen from logs, implemented the plane parser, D3D12 compositor, and unit/WARP tests in present.rs, ran the test suite and smoke test, and drafted this description.

…LOAT

PC D3D12 rejects ALLOW_RENDER_TARGET and ALLOW_UNORDERED_ACCESS on DXGI_FORMAT_R9G9B9E5_SHAREDEXP (67) with E_INVALIDARG (0x80070057). In Series S (Lockhart) mode, a retail title creates a 1920x1080 format-67 target with flags 0x300005 during startup and aborts on the error.

Promote format-67 resources with RT/UAV flags and their RTV/UAV/SRV views to DXGI_FORMAT_R11G11B10_FLOAT (26, same 32 bpp unsigned HDR float with full PC RTV/UAV/SRV support), while keeping sampled-only format-67 textures unchanged.
In Series S (Lockhart) mode, retail titles submit 2 hardware display planes to PresentX: plane 0 (1920x1080 scene) and plane 1 (3840x2160 UI/menu overlay). Previously PresentX copied only plane 0 to the swap chain, leaving menus, loading screens, and HUD invisible (black screen).

Parse all planes from D3D12XBOX_PRESENT_PLANE_PARAMETERS (0x48 stride, with optional pSourceRect) and, when 2+ planes are active, composite plane 0 opaque and premultiplied-alpha blend planes 1..N into a swap chain sized to the largest plane. Single-plane titles keep the direct CopyResource path unchanged.
@CryingLaughing

Copy link
Copy Markdown

Tested

  • PR head 2ca749ab53cd3848acf51d6c5197e97911d05b80 with a scratch-only RGBA8 readback extension in present.rs. NVIDIA GeForce RTX 4080, driver 621.01, Intel Core i5-13600K, Windows 11 25H2 build 26200.9974, Rust 1.100.0 MSVC x64, debug. XCL_ADAPTER=4080, XCL_REQUIRE_GPU=1, all XCL_SAMPLE_* variables unset. The hardware fixture checked the device LUID against the selected DXGI adapter.
  • cargo test -p xcl --lib --locked -j 4 hle::d3d12x::present::frame_dump_tests::compositor_blends_ -- --show-output --test-threads=1 passed 2/2, with zero skips. The adapted WARP fixture passed its existing two-plane case. The hardware fixture read the same scene and UI first with two planes, then with a third plane that was transparent except for a premultiplied red texel over the green half-alpha sample.
RGBA8 sample Two planes on RTX 4080 Three planes on RTX 4080
Overlap [0, 128, 127, 255] [64, 96, 95, 255]
Neighbor [0, 128, 127, 255] [0, 128, 127, 255]
Transparent UI over scene [0, 0, 255, 255] [0, 0, 255, 255]
Opaque UI [255, 0, 0, 255] [255, 0, 0, 255]

Not tested

  • The PresentX plane parser, swapchain presentation, BGRA surfaces, retail titles, release builds, or a full workspace run. The readback exercises Compositor::record directly.

AI use

  • OpenAI Codex (GPT-6 family, exact variant unavailable) prepared the scratch fixture, ran the tests, and drafted this report.

@crosettiremi

Copy link
Copy Markdown

Native Windows 11 / Radeon RX 7900 XT, Series S profile, retail 1.0.2.1. I tested the compositor commit 2ca749a on a local integration. At the account picker the control presented 1920×1080 and sampled 129,600 zero texels per frame. With the compositor, the log identified a 1920×1080 scene plane plus a 3840×2160 UI plane. I inspected the composed 3840×2160 frame at 25.275 s and could read the Player 1 / account-picker prompt. A at 37.015 s advanced to full-colour loading artwork. This confirms that the second plane contributes visible UI on this Radeon.

The comparison also added #495's scatter-unmap fix. The control stopped at its known breakpoint at 41.473 s. The combined run reached world streaming, recorded 1,736 presents, and later hit the separate world-loading watchdog at 168.731 s with zero device removals. No verified gameplay.

The combined workspace passed 730 tests, 0 failed, 41 ignored; the compositor blend fixture passed. One nominal pass skipped the debug-layer title check because xgameruntime.dll was missing. Commands: cargo build --workspace --offline --locked and cargo test --workspace --offline --locked -- --test-threads=4 --nocapture, followed by a release hardware run. Codex (GPT-6) ran the tests and inspected the frame captures.

@upipibi

upipibi commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Two things in 2ca749a, found by reading the code (not run):

1. The fallback copies plane 0 into a back buffer of a different size (present.rs:954-976, :1028)
With two or more planes, the swap chain is sized to the largest plane (mw/mh). When the compositor is unavailable (compositor unavailable – falling back to plane 0), the !composited path does CopyResource(&bb, plane0). CopyResource requires identical dimensions, so a 1920×1080 plane 0 with a 3840×2160 plane 1 makes an invalid copy: the debug layer reports it, and without the debug layer the behaviour is undefined. Sizing the swap chain from resolved[0] whenever compositing isn't possible, or copying plane 0 with CopyTextureRegion and a box, would avoid it.

2. A root-signature reference leaks per pipeline (present.rs:702)
pRootSignature: ManuallyDrop::new(Some(self.root_sig.clone())) AddRefs and never releases, so each compositor PSO created keeps one extra reference. That's small, since the PSOs are cached per format. real.rs uses transmute_copy for this field, which takes no reference.

Merge order: this rewrites the same present path as #555 (which sizes the swap chain to the window) and #604, so whichever lands second has to redo its logic on top of the other, not just resolve the text.

AI-assisted (Claude Code), read-only review.

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

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

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: 703 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 662 passed, 0 failed, 21 ignored
  • 0 SKIPPED; compositor_blends_ui_plane_over_scene_plane and parse_present_planes_and_uv_rects pass.

Review: This adds an RDNA4 suite run to the retail run on the RX 7900 XT above; I did not check @upipibi's two points (they need the code path to run with a title). Note that it is stacked on #605, whose R11G11B10 choice I commented on there (it loses precision against R9G9B9E5; #242 uses fp16 for the same targets).

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.

@MrEjecutor

Copy link
Copy Markdown

Test report on Windows + NVIDIA for 2ca749a (this PR's head): on the Series S profile the menus become visible

Tested

  • RTX 5060 Ti 16 GB (wave32), driver 621.24; Intel Core Ultra 5 225F; 32 GB; Windows 11 Pro 26200; Rust 1.100.0 stable-x86_64-pc-windows-msvc; DXC 1.8.2505.32 (SDK 10.0.28000); release
  • Trees: base main e50836b + D3D12.X: promote R9G9B9E5_SHAREDEXP render/UAV targets to R11G11B10_FLOAT #605 (c3d350a) + kernelx: XMemMapPhysicalPagesScatter with no page array unmaps #495 (3ae0841) = c096040; with this PR on top = fcf9b8a. Local merges, no conflicts. kernelx: XMemMapPhysicalPagesScatter with no page array unmaps #495 is needed to get past +0xb18de7 on this profile.
  • cargo test --workspace --release --no-fail-fast -- --test-threads=4 on the base: 705 passed, 0 failed, 41 ignored; with this PR on top (fcf9b8a): 707 passed, 0 failed, 41 ignored; SKIPPED on both (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware
  • Retail title 1.0.2.1, device_type = "lockhart", XCL_NETWORK=0, XCL_FRAME_DUMP=120, XCL_PRESS_A_AT=14,17,21,30,40,50,60,75,90, 120 s, same saved state:
    • the title presents 2 planes (plane 0 1920x1080, plane 1 3840x2160); with this PR: compositing 2 planes into 3840x2160
    • share of sampled pixels with R+G+B > 30 in each dumped frame:
frame 20 140 260 380 500 620 740
base 0 % 0 % 0 % 0 % 0 % 0 % 94 %
this PR 0 % 0 % 100 % 100 % 100 % 100 % 100 %
  • with this PR the dumps show the intro artwork and the Legal Notices menu (the same screens the Series X profile shows on this card without this PR); on the base the window stays black.

Regression run (Series S profile; both from the local merges above, not from main / this PR's head alone)

xcl-smoke v1
commit: c09604072cb3177f4724b0c1a9bb7f570bbdaea1
gpu: NVIDIA GeForce RTX 5060 Ti
title: GTAVI
seconds: 120
exit: 0x0
frames shown: 816 (PresentX 816)
presents per 2 s (last 3): 12 7 8
device removals: 0
crashes: 0
peak commit: 18179 MB
xcl-smoke v1
commit: fcf9b8ac4a6ee959d325843c0b9d9cc7378b0a32
gpu: NVIDIA GeForce RTX 5060 Ti
title: GTAVI
seconds: 120
exit: 0x0
frames shown: 764 (PresentX 764)
presents per 2 s (last 3): 10 9 13
device removals: 0
crashes: 0
peak commit: 18346 MB

Not tested

AI use

  • Claude Code (Claude Opus 5.5) ran the builds, tests and runs and wrote this report; checked by mrejecutor.

@volkan12a-bot

Copy link
Copy Markdown

Test report: retail title, measurements on the two planes (for this PR's compositing)

Not a run of this PR's head (2ca749a). These are measurements with XCL_TRACE_FRAME=1 on main 7ebf1b8, then a run of a local patch that only shows the larger plane (no compositing). I post them because they show what the two planes hold.

Hardware / build

  • NVIDIA GeForce RTX 4070 Laptop GPU 8 GB, driver 32.0.16.1692; Intel Core i7-14700HX, 40 GB RAM; Windows 11 Pro 26200
  • Rust 1.97.1, cargo build --release
  • Retail title 930.048.020, Lockhart (Series S) profile

What the title passes

With plane 1 shown

Not tested

  • This PR's own commit and its blending.
  • An overlay plane with content: plane 0 stayed transparent in every frame I dumped.
  • smoke.ps1 blocks; AMD GPUs.

AI use

  • Claude Code with Claude Opus 5.5: read the traces, wrote the local patch and this report. The runs are mine.

@sander110419

Copy link
Copy Markdown

Test report on Linux (Wine), the newer retail game in the README table, Series S (lockhart) mode:

Without this PR the start screen was black in every Series S run, at a steady 30 fps. The log had PresentX now with 2 plane(s), plane 0 a 1920x1080 target and plane 1 a 3840x2160 one, and swap chain 1920x1080. A local switch that presented plane 1 alone showed the menu art, so the start screen lives only in the overlay plane.

With this PR the start screen shows at its normal brightness (checked by eye in the window), and the title takes input and goes on into world loading. The runs end later, in the +0x23cf683 stop and the 0xffffffffffffffff read from #505, which have nothing to do with presenting.

Merge note: on today's main this conflicts in present.rs with the Wine presenter queue (WineQueue). I kept both: the dedicated PC queue under Wine, with copy_sources taken from the resolved planes after the submit. cargo test under Wine of d3d12x::present::, device_x::, title_textures:: and vram::: 36 passed, 0 failed.

Not tested: Windows, AMD, gameplay with the HUD over a 3D scene (the runs do not get that far yet).

AI use: Hermes agent with Claude Opus 5.5 (claude-opus-5-5) ran the builds and the game, and wrote this report; I checked it.

@427001

427001 commented Nov 24, 2026 •

Copy link
Copy Markdown

Test report for 2ca749a on an RTX 3080 10 GB with 16 GB RAM, Series S profile: the menus become visible; loading starts, then the title's stall stop at +0x23cf683

Tested

base (without this PR) with this PR
swap chain 1920x1080 3840x2160 (compositing 2 planes into 3840x2160)
dumped frames fully black 55 of 56 3 of 15 (frames 20 and 170, and one at 132 s)
presents per 2 s, 80–118 s 59–61 30–35
how it ended exit 0 at 300 s, 8296 frames shown 0xc0000005 at +0x23cf683 (write at 0x0) at 226.9 s
peak commit 17 983 MB 25 804 MB
peak local video memory 7 385 MB 13 610 MB
device removals 0 0
  • With this PR the dumps show the intro artwork and the brightness menu, and the menus answer the gamepad in the window. DirectStorage reads start at about 122 s and the dumps from 148 s on are a dark screen with a loading spinner. Until 120 s the run stays at 18 349 MB commit / 7 742 MB local video memory; both then climb to the peaks above. The last present is at 198 s; nothing is presented for the 29 s before the stop.
  • The base run never left the first screens (about 2280 draws per 2 s and no DirectStorage read from 60 s to the end), so its lower memory and its clean exit say nothing against this PR: it did not get to loading.

Not tested

  • This PR's head on its own base; a smoke.ps1 block; the Series X profile with this PR; AMD; the two points of @upipibi's review.
  • Whether the lower present rate at 80–118 s comes from the 3840x2160 composite – it does not, see the update below: the two runs of the table were on different screens.
  • Whether the title gets further on this machine with its other programs closed (see the update: these runs had 6–9 GB of RAM free at the start, not 16).

Update (same day): a second pair of runs, and two corrections to the above

Same two trees, same settings, but only scripted presses, the same saved state restored before each run (first-run setup already done, so both go from the intro to loading), and Windows' memory counters read once a second.

  • The lower present rate is not this PR. Compared on the same screens (2 s windows with the same draws per present): 4 draws per present – base median 21 presents per 2 s (19 windows), with this PR 20 (21 windows); 9–12 draws per present – base 18 (30 windows), with this PR 19 (35 windows). The 59–61 against 30–35 of my table came from different screens.
  • The stop does not depend on this PR. The base stops at +0x23cf683 too: at 187.0 s, last present at about 158 s; with this PR at 229.1 s, last present at about 200 s. Peak commit 24 866 MB / 25 412 MB, peak local video memory 13 037 MB / 13 424 MB (base / this PR).
  • Correction about the machine: other programs were holding memory in all my runs. Before the title started, 6.4–8.8 GB of RAM was available and the system had 22–23 GB committed of a 38 GB limit. During loading, in both runs: under 300 MB of RAM available (lowest 16 MB), the system's commit within 1 GB of its limit while Windows grew the page file from 22 to 33 GB, the title's working set pushed down from 6–8 GB to 1.6–2.5 GB, 8 000–26 000 pages per second read back from disk, and 9.85 GB of the card's 10 GB in use.
  • So on this machine the stall comes with RAM and video memory exhausted. These runs say nothing about the +0x23cf683 stop on a machine with memory to spare, and they do not show that 16 GB is too little either: that needs a run with the other programs closed.

AI use

  • Claude Code (Claude Fable 5.2) made the local merges, ran the builds, tests and runs, read the logs and frame dumps and wrote this report. The picture in the window was checked by eye by me.

When PresentX receives multiple planes and sizes the swap chain to the largest plane, the non-composited fallback path could call CopyResource with a plane 0 resource whose dimensions differ from the swap-chain back buffer (caught in review on xcl-dev#615). Use CopyResource only when plane 0 matches p.w x p.h, and fall back to CopyTextureRegion clipped to the overlapping rectangle otherwise.
@0x6461726B

Copy link
Copy Markdown
Contributor Author

Two things in 2ca749a, found by reading the code (not run):

1. The fallback copies plane 0 into a back buffer of a different size (present.rs:954-976, :1028) With two or more planes, the swap chain is sized to the largest plane (mw/mh). When the compositor is unavailable (compositor unavailable – falling back to plane 0), the !composited path does CopyResource(&bb, plane0). CopyResource requires identical dimensions, so a 1920×1080 plane 0 with a 3840×2160 plane 1 makes an invalid copy: the debug layer reports it, and without the debug layer the behaviour is undefined. Sizing the swap chain from resolved[0] whenever compositing isn't possible, or copying plane 0 with CopyTextureRegion and a box, would avoid it.

2. A root-signature reference leaks per pipeline (present.rs:702) pRootSignature: ManuallyDrop::new(Some(self.root_sig.clone())) AddRefs and never releases, so each compositor PSO created keeps one extra reference. That's small, since the PSOs are cached per format. real.rs uses transmute_copy for this field, which takes no reference.

Merge order: this rewrites the same present path as #555 (which sizes the swap chain to the window) and #604, so whichever lands second has to redo its logic on top of the other, not just resolve the text.

AI-assisted (Claude Code), read-only review.

@upipibi Good catch — fixed #1 in 9251d80 (left #2 as-is since the PSOs are cached per backbuffer format, so it's at most 1–2 refs for the process lifetime).

@shortside

Copy link
Copy Markdown

Test report from macOS (CrossOver, Apple's D3DMetal): the compositor works there, and it is what makes Series S mode usable on this host.

Tested

  • MacBook Pro M5 Pro, 24 GB, macOS 27.2.1, Rosetta 2; CrossOver 26.3 (Wine 11.0), D3DMetal; DXC 1.9.2609. Release, cross-built for x86_64-pc-windows-msvc (clang-cl / lld-link 23.1.6, xwin SDK).
  • Tree: @Ahmet-Dedeler's Mac port mac7 (dbd9d09, on main 930e8b4) with this PR's head 9251d80 merged in. It merges without conflicts. main alone does not draw on this host (macOS (Apple Silicon, CrossOver + D3DMetal): the newer retail game reaches its first-run menus at 30 fps #258), so the port is the base.
  • The retail title, device_type = "lockhart" in xcl.toml, run through scripts/smoke.ps1 in the foreground, XCL_DXC_THREADS=2, XCL_FRAME_DUMP=600, the same data root for both runs.
  • Without this PR (mac7 as it is): PresentX – the title presents its own frames (2 plane(s)), swap chain 1920x1080, 30 fps, and every dumped frame up to frame 4220 is 0x00000000 in all sampled texels. The XCL window is black.
  • With this PR: present: compositing 2 planes into 3840x2160 DXGI_FORMAT(28) (plane 0: 1920x1080 DXGI_FORMAT(28) uv [0.0, 0.0, 1.0, 1.0], plane 1: 3840x2160 DXGI_FORMAT(28) uv [0.0, 0.0, 1.0, 1.0]). The menus are visible in the XCL window and take keyboard input; dumped frame 1220 is a menu page, frames 1820–3020 the loading artwork. No "compositor unavailable" line, no device removal, no crash. Presents per 30 s: 577, 432, 763, 900, 481, 100.
  • Both runs were ended by a memory watchdog of mine, not by the title (5 % of system memory free at 257 s without the PR, 4 % at 166 s with it; the second run was taken into loading sooner). So no exit code and no full xcl-smoke block from this host.

Not tested

  • The fallback path (the compositor never failed here), HDR formats, source rectangles other than the full plane, more than two planes.
  • Windows, and main without the Mac port.
  • Whether the 4K composite costs memory on this host compared with presenting plane 0 alone: the two runs went through the menus at different speeds, so their end times do not say.

AI use

  • Claude Code with Claude Fable 5.2 built the trees, made the runs on my machine, read the logs and frame dumps and wrote this report; I was at the keyboard for the runs.

@thehollowedone

Copy link
Copy Markdown

Tested

I checked the clipped fallback copy from 9251d80a on native D3D12 with an RTX 3080 Ti. The fixture copied a patterned 4×4 scene texture into an initialized 8×8 destination and read back the destination itself. All 16 pixels in the overlap matched the scene exactly, and all 48 outside it kept their sentinel values. The debug layer reported zero errors or corruption messages, and the device stayed healthy.

The scratch fixture called the PR’s copy block extracted into a helper. Substituting the old unconditional CopyResource in the same fixture triggered D3D12 debug error 944 for the unequal sizes. cargo test --offline --locked -p xcl --lib scratch_present_fallback_clips_copy_on_native_d3d12 -- --nocapture --test-threads=1 passed 1/1 with clipping and failed 1/1 with the old copy. The five stock hle::d3d12x::present::tests:: tests and the separate WARP compositor test also passed. Zero skips.

Windows 11 build 26300, NVIDIA driver 621.35, Ryzen 7 9800X3D, Rust 1.99.1 MSVC debug, Graphics Tools enabled for the native fixture.

Not tested

The native fixture used an offscreen destination. Retail presentation and swap-chain resize behavior were outside the check.

AI-assisted. Codex (GPT-6 family, exact variant unavailable) wrote and ran the fixture and drafted this report.

@NAbobo101

Copy link
Copy Markdown

Tested 9251d80 merged locally onto main 1d027e5 (clean merge, tree 5204044), retail title in Series S mode (device_type = "lockhart"), on an 8 GB NVIDIA card.

Tested

  • RTX 5060 8 GB (wave32 only), driver 621.14; Ryzen 7 5700G, 32 GB RAM; Windows 11 Pro 26300; Rust 1.100.0 MSVC; DXC 1.8.2502.11; release. XCL_NETWORK=0, XCL_DIRECT_DXIL=1, XCL_HEAP_WINDOWS=1; I walked the menus by hand.
  • Without this PR, on main c4d37be, the window stays black in Series S mode the whole time. The log says PresentX – the title presents its own frames (2 plane(s)) while the title runs at 30 fps in its menus (7 minutes, no crash).
  • With this PR the log shows present: compositing 2 planes into 3840x2160 DXGI_FORMAT(28) (plane 0: 1920x1080 …, plane 1: 3840x2160 …), and the menus and the loading screen are visible and correct.
  • I didn't run the test suite on this merge.

Not tested

AI use

  • Claude Code (Claude Opus 5.5) built the tree, ran the sessions, read the logs and drafted this comment. I played the menus and checked the screen.

@gavinnolan

Copy link
Copy Markdown

Tested on Series S (device_type = "lockhart") with the retail title 1.0.2.1: this fixes the black screen on my machine.

Setup: NVIDIA GeForce RTX 2060 Laptop 6 GB (driver 595.79), i7-10750H, 16 GB RAM, Windows 11 10.0.26200, Rust 1.97.1, release build, DXC 1.9.2609. main 689f2db with this PR (head 9251d80) merged locally, plus #833, #751, #1792 (Series S boot freeze) and #495's change applied by hand. XCL_NETWORK=0, XCL_FRAME_DUMP=90.

Before (same machine, earlier main without this PR): the title logs PresentX now with 2 plane(s) at ~20 s, and every frame dump for 208 s was 1920x1080 with 0 of 129600 samples not black (42 of 42 dumps).

With this PR: same 2-plane PresentX, frames are now 3840x2160 and the UI plane shows: the account picker prompts at ~139 s, the intro art at ~150 s, the Rockstar logo at ~163 s, and the world loading screens from ~218 s (11 of 44 dumps not black; the rest are black transitions and loading). No device removal from the compositor. Menus ran at about 20-25 fps (Series X: 30 on the same machine).

Not tested: AMD / Intel GPUs, Series X (one plane there, so the direct path).

@Filip722

Copy link
Copy Markdown

Verified the two-plane compositor on Bazzite 44 with an RTX 5060 Laptop GPU (8 GiB), NVIDIA 615.78.08, Proton Experimental 11.0-20261112 and vkd3d-proton 3.1.0 (local build 4522cc1+).

I applied the presenter changes through 9251d80 to XCL main 20cf130, which already includes the format prerequisite. The only additional change selected the physical NVIDIA adapter in the existing WARP fixture. The release-build test blended a 4×4 scene with an 8×8 UI and checked transparent, opaque and half-transparent pixels by GPU readback. 1 passed, 0 failed, 0 skipped in 0.86 s.

An earlier unpatched Series S run on this laptop recorded two present planes and showed a black window. This check covers the compositor with synthetic textures. A patched retail Series S run and gameplay are still unverified here.

OpenAI Codex assisted with the source port, testing and report.

@raylitebull

Copy link
Copy Markdown
Member

Diff and status check on 9251d80:

  • PR description is passing and this already has broad dual-vendor verification across AMD (RX 7900 XT, RX 9060 XT) and NVIDIA, plus Wine/CrossOver.
  • However, Build and test (Windows, no GPU) has not run on the current head 9251d80 (making mergeStateStatus UNSTABLE).

Next step to unblock merge: Please rebase onto current main (or push an updated commit) so CI runs Build and test (Windows, no GPU) on the head.

@raylitebull

Copy link
Copy Markdown
Member

Update: \Build and test (Windows, no GPU)\ is now green on \9251d80\ (\CLEAN). One quick independent AMD check on exact head \9251d80\ (the earlier AMD runs were on \2ca749a) is all that remains before merge.

@JJAutoCompare

Copy link
Copy Markdown

PR #615 verification

PR head 9251d80a7a9e283f3f681a77f22f9ede3152491c from refs/pull/615/head on origin. origin/main was 3da2abb81606df622610e009f0430de99aa9881c. The PR checkout was clean before and after testing. git merge-tree --write-tree origin/main HEAD exited 0 with tree aef93be58296f5fa3678171adc26a72fd3725458.

What is in it

  • crates/xcl/src/hle/d3d12x/present.rs composites multi-plane PresentX frames, applies per-plane source rectangles, and clips the plane-0 fallback copy when dimensions differ.

Tested

  • STOR-WINLAB, AMD Ryzen 7 3800X, Intel Arc A770 16 GiB (driver 32.0.101.9175, wave range 8–32, DoublePrecisionFloatShaderOps=0), Windows 11 Enterprise Evaluation build 26200.9974. rustc 1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL 1.9.2609.5, dev/test profiles with debug info and incremental compilation disabled.
  • cargo build --workspace and cargo test --workspace --no-run both exited 0 outside the GPU lock.
  • cargo test -p xcl --lib parse_present_planes_and_uv_rects -- --show-output passed (1 passed, 0 failed, 0 ignored).
  • cargo test -p xcl --lib compositor_blends_ui_plane_over_scene_plane -- --show-output passed (1 passed, 0 failed, 0 ignored). It uses D3D12 WARP and ran inside Invoke-ArcTest.ps1. Both targeted tests also passed in the workspace run.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 --show-output ran once under Invoke-ArcTest.ps1 with XCL_ADAPTER=A770. Cargo exited 101 after completing every target.
Suite target Passed Failed Ignored
xcl lib 631 15 21
xcl bin 0 0 0
console_dlls_e2e 13 0 0
console_shaders 3 0 4
disasm_e2e 1 0 0
e2e 2 1 0
gpu_compute_e2e 2 0 0
gpu_pso_e2e 7 0 0
heap_probe 0 0 4
pls_quota 1 0 0
predication_e2e 1 0 0
rpf_e2e 2 0 0
texture_states 1 0 0
xg_oracle 6 0 12
xcl-testtitle bin 0 0 0
docs (xcl) 0 0 0
Total 670 16 41

The reported passes include 5 explicit SKIPPED results and 15 additional logged test-level early returns. These tests provide no coverage of the skipped paths.

SKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64
SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64
SKIPPED placed_title_textures_share_vram_and_preserve_pixels: tiled tier < 2
SKIPPED test_title_draws_with_a_root_signature_under_the_debug_layer: no d3d12SDKLayers.dll
SKIPPED uploads_start_from_each_subresources_state: no D3D12 debug layer (The application requested an operation that depends on an SDK component that is missing or mismatched. (0x887A002D))
  • Other early returns affected 10 tests requiring retail samples (XCL_SAMPLE_RPF, XCL_SAMPLE_TTPF, or XCL_SAMPLE_AWC), 4 audio tests without a device or endpoint, and 1 Gaming Services test without system xgameruntime.dll.

Failures

GPU recompiler tests

  • gpu_clamp_and_omod_per_instruction, gpu_f64_class_compare, gpu_f64_compares_with_nan, gpu_f64_literal_high_word, gpu_f64_math_random, gpu_f64_roots, gpu_f64_rounding_and_conversions, gpu_float_compares_random, gpu_frexp_f64_exp_and_mant, gpu_ldexp_f64, and gpu_rndne_f64 all failed at CreateComputePipelineState with 0x80070057.
  • gpu_nonfused_mad_and_mac_prevent_fma_contraction failed the fused v_fma_f32 overflow control assertion.
  • gpu_ps_image_sample_offset_implicit_lod_between_mips read 25.609375 at pixel (0,0), expected 26.
  • gpu_valu_16_and_64_bit failed the lane 0 v_add_f16 high-half preservation assertion.
  • gpu_wave64_ps_whole_wave_reductions read [2, 188, 2] for pixel 0, expected [2, 44, 2].

In e2e, test_title_runs_and_game_folder_is_untouched failed the dynamic depth-bias check for RSSetDepthBiasX. The top-right pixel was blue, expected green.

Full output in L:\XclTooling\neon-slot-5\tmp\pr615-suite.log.

Not tested

  • A suite baseline on main, the merged tree, or other hardware. The run establishes failures on this PR head and adapter. Attribution requires a baseline.
  • Retail-title smoke runs on main and the PR head. The targeted overlay render used WARP and provides no direct hardware or retail-title coverage of multi-plane PresentX.

AI use

T3 Code / Codex (gpt-6.2-sol) ran the build and tests and drafted this report. Coordinator #2 (T3 Code / Antigravity, gemini-4-neon) verified the counts against pr615-suite.log and published this report.

@mikebuckets171

Copy link
Copy Markdown

Apple Silicon datapoint for this PR: the composite fixes the black Series S window on CrossOver + D3DMetal, and the new WARP test cannot run there

Machine and builds. MacBook Pro M5 Pro (Mac17,8), 48 GB, macOS 27.2.1 (26B131), Rosetta 2, CrossOver 26.3 with the D3DMetal backend — XCL selects the adapter it reports as "AMD Compatibility Mode (40960 MiB VRAM)". Rust 1.100.0, LLVM-MinGW 20261117, cargo build --release --locked -p xcl --target x86_64-pc-windows-gnullvm.

  • base: Ahmet's mac7 tip dbd9d09.
  • head: the whole pull/615/head branch (tip 9251d80) merged cleanly onto dbd9d09 — 2 files, merge commit 716e02a. This is an integration-branch comparison, not a main-versus-PR pair.
  • runs: the retail title, XCL_NETWORK=0 XCL_ACTIVITY=1 XCL_BACKGROUND=0 XCL_DXC_THREADS=4 and XCL_RUN_SECONDS=<bound>, inside a sandbox-exec profile, each attempt in its own fresh data root; Series S selected with device_type = "lockhart" in that profile's xcl.toml. Each run's XCL window was verified on screen on the current desktop Space before the run was accepted.

1. The gap this PR fixes reproduces on Apple Silicon, and the PR closes it.

run bound frames / PresentX exit crashes device removals PresentX planes swap chain
Series S, base dbd9d09 150 s 4054 / 4054 0x0 0 0 2 1920x1080 (plane 0 only)
Series S, head 716e02a 240 s 6753 / 6753 0x0 0 0 2 3840x2160
Series S, head 716e02a 120 s 3150 / 3151 0x0 0 0 2 3840x2160
Series X mode (anaconda), base 120 s 3377 / 3377 0x0 0 0 1 3840x2160

Head logs the new line: present: compositing 2 planes into 3840x2160 DXGI_FORMAT(28) (plane 0: 1920x1080 DXGI_FORMAT(28) uv [0.0, 0.0, 1.0, 1.0], plane 1: 3840x2160 DXGI_FORMAT(28) uv [0.0, 0.0, 1.0, 1.0]).

Measured window contents (XCL's own window captured locally on this Mac and compared numerically — percentages are whole-frame, colour counts are from a 1-in-11 pixel sample; no images are attached and none left this machine):

what XCL presented pure black pixels distinct colours mean RGB
Series S, base (plane 0 only) 96.35 % 93 [1.6, 1.6, 1.7]
Series S, this PR's head 9.26 % 360 [30.1, 30.1, 39.8]
Series X mode, base (1 plane, existing path) 9.26 % 361 [30.1, 30.1, 39.8]

Series S on the base build shows nothing: 96.35 % of the window is pure black, exactly the symptom described here. With this PR the same window is filled, and compared with the same title through the existing single-plane path on the same host, the composited frame differs by 0.75 % of pixels (max channel delta 51) — the compositor reproduces the picture this host already gets when the title presents one plane.

2. The composited output responds to input; it is not a stuck frame. In a 150 s Series S run the window was pixel-identical at 40 s and 60 s (0 of 263,211 sampled pixels differ). One Return key was then sent once to the window, focused without clicking it — no other key, no click in the client area, no controller input. Captures at 85, 110 and 140 s are identical to each other and differ from the pre-key frame by 16.35 % of sampled pixels (max channel delta 255), distinct colours 360 → 613. That run stayed clean: 4060 frames / 4060 PresentX, exit 0x0, 0 crashes, 0 device removals.

One caution for anyone reading Mac results: on this host, in every mode and build tried, the presented image settles into an unchanging frame from ~20 s onward while no input is sent, even though PresentX keeps counting at 30 fps. A Mac xcl-smoke block showing "N frames shown, N PresentX calls" does not by itself show the title advancing.

3. The new WARP test cannot run on this host, and it fails instead of skipping. cargo test --release --locked -p xcl --target x86_64-pc-windows-gnullvm --no-run, each test run through the offline CrossOver bottle with a literal --exact name:

hle::d3d12x::present::tests::parse_present_planes_and_uv_rects                                        1 passed
hle::d3d12x::present::frame_dump_tests::compositor_blends_ui_plane_over_scene_plane                  FAILED
  called `Result::unwrap()` on an `Err` value: Error { code: HRESULT(0x887A0004), message: "" }
hle::d3d12x::present::frame_dump_tests::mapped_frame_dump_distinguishes_dark_bright_and_undecoded_content   FAILED, same HRESULT

0x887A0004 is the missing-SDK-component code: the D3DMetal-backed DXGI that Wine gives XCL on a Mac has no WARP software rasteriser, so EnumWarpAdapter() cannot succeed here. Suggestion, following the skip idiom used elsewhere for host gaps:

-            let adapter: IDXGIAdapter = factory.EnumWarpAdapter().unwrap();
+            let adapter: IDXGIAdapter = match factory.EnumWarpAdapter() {
+                Ok(a) => a,
+                Err(_) => {
+                    crate::gpu::recomp::runner::skip_test("no WARP");
+                    return;
+                }
+            };

Verified on this host on a branch based on 9251d80: the parser test still passes and the compositor test now reports SKIPPED hle::d3d12x::present::frame_dump_tests::compositor_blends_ui_plane_over_scene_plane: no WARP. scripts/test.ps1 counts SKIPPED lines and neither it nor the workflow sets XCL_REQUIRE_GPU (ci.yml sets only Cargo environment values), so no WARP counts as a skip; skip_test in gpu/recomp/runner.rs still turns it into a failure if someone runs with XCL_REQUIRE_GPU=wave64 or =mesh. Note that the pre-existing sibling test named above fails identically at the same EnumWarpAdapter().unwrap() on this host — that one predates this PR, so the Mac test lane needs the same treatment in both places. Happy to hand the commit over if you want it.

Not tested. No Windows run and no scripts/smoke.ps1 pair (macOS only host, no Windows runner), no full cargo test --workspace, and no comparison against what a real Series S display composes — the composite is compared with this host's own single-plane output, not with console hardware. Run bounds differ between rows, so the frame counts are not a performance comparison. The pixel numbers describe XCL's own window on this Mac; they do not establish correct pixels or playable gameplay.

AI use: GPT-6 Luna (the runs, captures, measurements and this write-up).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.