D3D12.X: prepare for the unified memory copy path #1316
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1326"
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?
Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-24T14:48:33Z.
First of four PRs that bring the unified memory copy path to
main(Part of #258): helpers it needs, with no change in behaviour. D3DMetal answers E_NOTIMPL forOpenExistingHeapFromAddress, so on a Mac there is no GPU unified memory; the copy path (the fourth PR) gives the committed window a copy in video memory instead.Based on Ahmet-Dedeler's
c70bf8aonmac-on-main-wip("Unified memory without OpenExistingHeapFromAddress: the committed window gets a copy in video memory"), which he handed over in https://github.com/ivall/xcl/issues/258#issuecomment-7134093997. Rebased ontomain930e8b4and split into four PRs.What is in it
crates/xcl/src/gpu/uma.rs:Uma::shadowed(never set in this PR) andis_gpu_copy(p): a sparse window, or a committed one the GPU only has a copy of.crates/xcl/src/hle/d3d12x/sparse.rs:new_stateextracted frominit, so the copy path can build the state without sparse windows; it keepsmain'sparkedlist and debug names.crates/xcl/src/hle/d3d12x/list_x.rs:note_copy_into, which records PC copies into console buffers whose memory the GPU only has a copy of; it returns at once whileshadowedis false.crates/xcl/src/hle/d3d12x/real.rs: the places that askedis_sparseaskis_gpu_copy, which is the same thing whileshadowedis false.Tested
x86_64-pc-windows-gnu(mingw-w64 GCC 16.2.0), debug, DXC 1.9.2609. Each test in its own process (<test exe> --exact <test> --test-threads=1 --nocapture).3dd994a: the seven UMA tests that fail onmainon this host fail the same way, at the same lines (gpu_uma_import_check_at_init,gpu_unified_memory_arena,gpu_memory_windows_above_4_gib,gpu_mesh_mode_reads_memory_windows,gpu_bvh64_intersect_ray_across_memory_windows_and_grazing,gpu_memory_windows_reject_out_of_uma_aliasing,gpu_sparse_vram_descriptors_buffers_and_xmem), and thelist_xandvramtests I sampled still pass.cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored on both (@futurepro62, https://github.com/ivall/xcl/pull/1326#issuecomment-7135133510); AMD RX 9070 XT (RDNA4), Windows 11, release: 751 passed, 0 failed, 41 ignored, with the seven UMA tests passing natively (@eizispark, https://github.com/ivall/xcl/pull/1326#issuecomment-7135248447).Regression run
This changes runtime files, so it needs an
xcl-smokepair from someone with a title; I have none. Nothing in it is reached whileshadowedis false.Not tested
AI use
c70bf8aontomainand split it. Claude Code with Claude Opus 5.5 reviewed the slices, ran the tests above on this machine and wrote this description.Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:54:06Z.
Full-suite run, since this PR has no test report yet. Tested exact head
3dd994a(on its base930e8b4).Tested
cargo build --workspace, thenXCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored. SKIPPED (no wave64):gpu_geometry_wave32_prefix_count_over_a_mask,gpu_wave32_program_in_wave64_hardware.#[test]functions in the diff.XCL_ADAPTER=radeon),cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored, no skips.Not tested
AI use
Imported from ivall/xcl. Originally posted by eizispark on 2026-11-24T14:58:21Z.
Hardware test report — commit
3dd994aVerified clean merge with
main(930e8b4) on3dd994adb78c2b758d07866632083d261c3e8871: pass.Tested
rustc 1.100.0 (0ef1bc386 2026-11-09), release + test profilecargo test --workspace --no-fail-fast -- --test-threads=4:751 passed, 0 failed, 41 ignored(GPU tests skipped on this adapter:none)gpu_uma_import_check_at_init,gpu_unified_memory_arena,gpu_memory_windows_above_4_gib,gpu_mesh_mode_reads_memory_windows,gpu_bvh64_intersect_ray_across_memory_windows_and_grazing,gpu_memory_windows_reject_out_of_uma_aliasing,gpu_sparse_vram_descriptors_buffers_and_xmem)Regression run
main(930e8b4):PR (
3dd994a):Not tested
XCL_D3D12_DEBUG=1; gameplay past the menusAI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:18:44Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: 707-709 passed, 0 failed, 21 ignored.Thanks!
Imported from ivall/xcl. Originally posted by Kalmarv on 2026-11-24T15:26:56Z.
Regression pair for
3dd994aagainstmain930e8b4(this PR's base), for the Regression run section. Both runs pass: no device removal, no crash, 101 % ofmain's frames, 94 % of its peak commit.Tested
scripts/smoke.ps1, the same retail title for 60 s each:mainat930e8b4(this PR's base) first, then this PR's head, one after the other on the same machine.main930e8b4:this PR,
3dd994a:Not tested
shadowedis never set in this PR, so the run only shows no regression.AI use: Claude Code (Claude Opus 5.5)
Imported from ivall/xcl. Originally posted by JoaoPauluu on 2026-11-24T15:28:05Z.
A regression run under Wine on Linux, on a retail title.
Tested
x86_64-pc-windows-gnu.3dd994aas it is andmain930e8b4, no uncommitted changes. Retail title 1.0.2.1,scripts/linux/smoke.sh(#257) for 60 s, no input. Nine runs in a row,mainfirst and last, other PRs in between.Regression run
main (first run):
this PR:
The last
mainrun: 1338 frames,exit: 0x0, no device removal, no crash. Under Wine,peak commitreads 0 MB, so these blocks do not check memory.Not tested
AI use
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:58:35Z.
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodifiedmain.)Thanks!
upstream-sync referenced this pull request2026-11-24 21:08:21 +00:00
upstream-sync referenced this pull request2026-11-24 23:06:49 +00:00
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-27T21:26:21Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by vakaobr on 2026-11-30T13:21:34Z.
Closing: its commit is in
mainthrough #1329 (merged 28 Nov), patch for patch.Pull request closed