D3D12.X: harden PresentX compositor and single-plane sub-rect scaling #2418
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2418
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2418"
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?
@Decodere on GitHub · 2026-11-25 18:19 UTC · original
Decodere:fix-615-present-compositor→main· +125 −6 · 1 files · 1 commits · openWhat is in it
Follow-up hardening to #615's
PresentXmulti-plane compositor incrates/xcl/src/hle/d3d12x/present.rs(+125/-6lines, single file):ManuallyDrop<Option<ID3D12RootSignature>>viaManuallyDrop::into_inner(pd.pRootSignature)afterCreateGraphicsPipelineStateinCompositor::psos_foron both success and failure paths, fixing a 2-ref COM leak onself.root_sigper RTV format.Compositor::record(D3D12_RESOURCE_DIMENSION_TEXTURE2D,SampleDesc.Count == 1, noD3D12_RESOURCE_FLAG_DENY_SHADER_RESOURCE, andswap_format(desc.Format).is_some()) before compiling PSOs, mutating RTV/SRV descriptors, or recording draws, returningfalsecleanly sopresent_nowfalls back to plane-0 copy.plane_counttoMAX_PLANESinpresent_x_frame's raw-word logging helper (raw_plane_words), matchingextract_planesand avoiding overflow or oversized reads on large guest counts.PresentXframes with a non-fulluv_rect != [0.0, 0.0, 1.0, 1.0]throughCompositorvianeeds_compositor(with plane-0 copy fallback) so single-plane dynamic-resolution sub-rects scale to fill the target, while keeping the full-rect 1-planeCopyResourcefast path intact.Part of #1452
Part of #1333
Tested
origin/main(68a284a5):cargo test -p xcl --lib hle::d3d12x::present -- --test-threads=1 --nocapturefailed2of11(compositor_psos_for_preserves_root_sig_refcountleakedID3D12RootSignaturerefs7 != 3;compositor_record_rejects_unreadable_planes_without_mutating_statereturnedtrueand mutated compositor state on invalid planes).hle::d3d12x::present(3f4a1291, WARP-backed CI-safe tests coveringpsos_forrefcount on valid and failing formats,recordrejection ofDENY_SHADER_RESOURCE/ MSAA / unsupported format / buffer / empty planes without state mutation,needs_compositorrouting + single-plane[0.0, 0.0, 0.5, 0.5]sub-rect scaling readback, andraw_plane_wordsMAX_PLANEScapping):cargo test -p xcl --lib hle::d3d12x::present -- --test-threads=1 --nocapture):11 passed; 0 failed; 0 ignored(0.07 s).cargo test --release -p xcl --lib hle::d3d12x::present -- --test-threads=1 --nocapture):11 passed; 0 failed; 0 ignored(0.07 s).XCL_ADAPTER=warp cargo test --release -p xcl --lib hle::d3d12x::present -- --test-threads=1 --nocapture):11 passed; 0 failed; 0 ignored(0.07 s).cargo test --release --workspace --no-fail-fast -- --test-threads=4 --nocapture, RTX 4060):23test binaries,1291 passed; 1 failed; 46 ignored.origin/main(68a284a5) failuregpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier(tracked by #2379).29pre-existingSKIPPEDlines on this RTX 4060 host (21no wave64,3per-lane wave32 refused,3no D3D12 debug layer /d3d12SDKLayers.dll,1no heap windows,1cannot disable driver cache;0skipped inhle::d3d12x::present).Regression run
Paired 60 s RTX 4060 smoke (
scripts/smoke.ps1 -Seconds 60) on baseorigin/mainvs PR head (exercises the preserved full-rect single-planePresentXfast path;1593vs1557frames =102.3%,0device removals,0crashes):Base (
origin/main):PR head:
Not tested
PresentXplanes or a single-plane dynamic-resolutionpSourceRect(the smoke title uses a full-rect single plane; single-plane sub-rect scaling, refcount cleanup, and invalid-plane fallback are covered by WARP unit tests).d3d12SDKLayers.dllnot installed on this host).AI use
Written and verified with Google Antigravity (Gemini 4 Neon). All changes were validated locally with failing-first WARP tests, full release workspace tests, and paired 60 s RTX 4060 smoke runs.
@Aniseto on GitHub · 2026-11-25 18:40 UTC · original
Ran the PresentX compositor tests at
3f4a129:Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, wave32 only, 16 GB) driver 32.0.16.2124, Intel Core i5-12400F, 64 GB RAM, rustc 1.100.0 (0ef1bc386 2026-11-09) MSVC 14.44.35207, DXC 1.9.2609.5, debug build.
All eleven tests pass here, including the three new ones for the root-signature refcount, invalid-plane rejection and single-plane
[0, 0, 0.5, 0.5]sub-rect scaling. As the description says, these are WARP-backed tests, so they do not measure the real adapter's PresentX path.What this adds: the thread has no report from another machine. This host has a different GPU/driver (RTX 5070 Ti, 32.0.16.2124) and DXC 1.9.2609.5 from the author's RTX 4060 run, but the tests themselves use WARP on both.
Not tested: a live retail title presenting multiple planes or a dynamic-resolution sub-rect, the D3D12 debug layer, the full workspace suite, a paired 60 s smoke run, AMD and Intel GPUs, release profile, title data.
AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@DavidM1911 on GitHub · 2026-11-25 19:47 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 1 real failure, deterministic (also fails--test-threads=1, 1219/1):The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.
— Devin
@Decodere on GitHub · 2026-11-25 19:53 UTC · original
Thanks for testing! That
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrierfailure comes from a pre-#2420mainbase (#2074) and was fixed onmainin#2420(c56e7448).This PR (
#2418) only touchescrates/xcl/src/hle/d3d12x/present.rs, and CIBuild and teston currentmainis green (0failures).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.