Repository navigation
Conversation
…ap reclamation Ports @treybertram06's opt-in XCL_TEXTURE_SYSMEM=1 (xcl-dev#3039) to amd-dev: new pages of lazily mapped texture levels come from 64 MiB L0 system-memory pool heaps, tagged SYS_TILE in the heap index. Includes empty L0 pool heap reclamation independent of the local heaps (per @thehollowedone's review on xcl-dev#3039) and creation-order wording for page aliasing (per @thehollowedone and @andrewDoing). Based-on: xcl-dev#3039 (@treybertram06) Signed-off-by: Enrique Villa <eevilla@up.edu.ph>
|
Review (head 13500f3, diff read, not a merge-check; draft, base
Fine: off by default, and with it off the behaviour is unchanged (no tagged tiles, so the AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point. |
|
This is a port of the vram.rs half of open #3039 ( AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human. |
Ports @treybertram06's opt-in
XCL_TEXTURE_SYSMEM=1(#3039, which targetsmainand does not apply toamd-dev) toamd-devf33df5a7. Off by default; needsXCL_TEXTURE_LEVEL_PAGES=1.New pages that
map_levelstakes for lazily mapped texture levels come from 64 MiB L0 system-memory pool heaps (custom, write-back, sampled by the GPU over PCIe) instead of local video memory; a page there hasSYS_TILE(bit 31) in its heap index. If an L0 heap cannot be made, local video memory is used. Pages already mapped at a title address keep their backing, so aliasing (an RT placed over a streamed page) is unchanged.vram.rs:SYS_TILE,texture_sysmem(),alloc_sys_pool_heap(),heap_in(),cool_in(),sys_pools/sys_poolonPages,bind_range_in(.., sys),SYS_TILEhandling indrain_fenced_tiles,flush_zero_tiles,map,release_tiles, the byte counts, and empty L0 heap reclamation next to the local one insweep_and_reclaim(per @thehollowedone's review on D3D12.X: XCL_TEXTURE_SYSMEM puts streamed texture levels in system memory #3039; creation-order aliasing wording per @thehollowedone and @andrewDoing).a_system_memory_page_is_told_apart_and_cools_in_its_own_pool,cooled_system_memory_pool_heaps_are_reclaimed_independently.apply_backing; that function no longer exists onf33df5a7.Tested
32.0.21045.29003), Ryzen 7 5700X, Windows 11,rustc 1.100.0, debug test build onorigin/amd-devf33df5a7+ this commit.cargo test --lib system_memory: 2 passed (the GPU one ran, it did not skip).hle::d3d12x::vram::: 30 passed, 0 failed, 1 ignored.cargo test --lib hle::d3d12x:: -- --test-threads=1: the same 8 tests fail with and without this commit; no new failures.7c795f5e) the port ran 600 s world-load runs on this card up to 3,027 presents with no crash. Onf33df5a7only the 60 s smoke below was run (with the option off); the option's path is not soaked on this base.Regression run
Both 60 s runs with
scripts/smoke.ps1 -Seconds 60,XCL_PREPARE=0, on the same retail title and RX 6650 XT, afterxcl pso-precompile --usedhad warmed the compute pipeline cache (with a build that has all three ports of this series). Firstmaind8bd9a38, then this PR's head.XCL_TEXTURE_SYSMEMwas not set, so this run covers the off (no-change) path.Peak commit is 1.56x main's, past the 1.25x rule, but that is
amd-dev's, not this change's: the same 60 s run onamd-devf33df5a7without this commit peaks at 25,028 MB (1,429 frames). So everyamd-devPR will fail that one line of the check untilamd-devitself comes down.Not tested
cargo test --workspace, NVIDIA, RDNA3/RDNA4.AI use
amd-dev7c795f5e) was written and tested by Antigravity with Gemini 4 Neon (High). Its port tof33df5a7(the old patch no longer applied: the code moved) was done by Claude Code (Claude Sonnet 5.5, effort high), which also ran the tests below and wrote this text. The account owner did not write the code or this text.