Repository navigation
D3D12.X: composite multi-plane PresentX overlays - #615
0x6461726B wants to merge 3 commits into
Conversation
…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.
|
Tested
Not tested
AI use
|
|
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. |
|
Two things in 1. The fallback copies plane 0 into a back buffer of a different size ( 2. A root-signature reference leaks per pipeline ( 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. |
|
Test run of Tested
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 Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code. |
|
Test report on Windows + NVIDIA for Tested
Regression run (Series S profile; both from the local merges above, not from Not tested
AI use
|
|
Test report: retail title, measurements on the two planes (for this PR's compositing) Not a run of this PR's head ( Hardware / build
What the title passes
With plane 1 shown
Not tested
AI use
|
|
Test report on Linux (Wine), the newer retail game in the README table, Series S (
Without this PR the start screen was black in every Series S run, at a steady 30 fps. The log had 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 Merge note: on today's 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 ( |
|
Test report for Tested
Not tested
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.
AI use
|
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.
@upipibi Good catch — fixed #1 in |
|
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
Not tested
AI use
|
|
Tested I checked the clipped fallback copy from The scratch fixture called the PR’s copy block extracted into a helper. Substituting the old unconditional 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. |
|
Tested Tested
Not tested
AI use
|
|
Tested on Series S ( 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. Before (same machine, earlier 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). |
|
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 I applied the presenter changes through 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. |
|
Diff and status check on
Next step to unblock merge: Please rebase onto current |
|
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. |
PR #615 verificationPR head What is in it
Tested
The reported passes include 5 explicit
Failures GPU recompiler tests
In Full output in Not tested
AI use T3 Code / Codex ( |
Apple Silicon datapoint for this PR: the composite fixes the black Series S window on CrossOver + D3DMetal, and the new WARP test cannot run thereMachine and builds. MacBook Pro M5 Pro (
1. The gap this PR fixes reproduces on Apple Silicon, and the PR closes it.
Head logs the new line: 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):
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 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 3. The new WARP test cannot run on this host, and it fails instead of skipping.
- 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 Not tested. No Windows run and no AI use: GPT-6 Luna (the runs, captures, measurements and this write-up). |
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 toPresentX: plane 0 (1920x1080scene) and plane 1 (3840x2160UI/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(stride0x48, optionalpSourceRect) and, whenever 2+ planes are active, lazily composites them into a swap chain sized to the largest plane (plane 0 opaque, planes1..Npremultiplied-alpha over). Single-plane titles keep the existing directCopyResourcefast path.What is in it
extract_planes,source_uv_rect, lazy D3D12Compositor, and multi-planepresent_nowcompositing path + unit testparse_present_planes_and_uv_rectsand WARP GPU testcompositor_blends_ui_plane_over_scene_planeincrates/xcl/src/hle/d3d12x/present.rs.Tested
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 ignoredSKIPPED gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask: no wave64SKIPPED gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware: no wave64lockhart) smoke run (retail title, 60 s, release): log confirmedpresent: 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])andpresent: first game frame shown (3840x2160), running the full 60 s withexit: 0x0, 975 frames shown (PresentX 975), 0 crashes, 0 device removals, and making the title's loading screens/menus visible.Regression run
Not tested
no wave64skipped the two wave64 GPU tests above).pDestinationRectscaling.AI use
PresentXblack screen from logs, implemented the plane parser, D3D12 compositor, and unit/WARP tests inpresent.rs, ran the test suite and smoke test, and drafted this description.