Repository navigation
Conversation
e2cf935 to
bebf2dd
Compare
|
Independent AMD RDNA4 (native wave64) test report on exact head Tested
Regression run (60 s retail-title smoke, (Matched Not tested
AI use
|
Port upstream PR #2436 (by Saintwolf, adapted for #2306 lazy level pages and #2275 multi-queue retirement) onto amd-dev. Streamed sampled textures placed on shared 64 KiB video-memory pages previously called CreateReservedResource and GetResourceTiling on every placement, costing 0.6-1.7 ms per texture on AMD drivers (#1268). Keep a bounded per-device pool (512 idle entries, FIFO eviction, opt-out via XCL_RESERVED_POOL=0) of released reserved sampled textures keyed by exact (D3D12_RESOURCE_DESC, uniform D3D12_RESOURCE_STATES), also caching the #2306 Levels tiling layout so XCL_TEXTURE_LEVEL_PAGES=1 placements skip both CreateReservedResource and GetResourceTiling on reuse. When late_release finishes draining all live GPU queues past a texture's batch, vram::recycle_ready unmaps any still-mapped tiles on the background thread (skipping unmap for lazy textures that had zero mapped levels) and parks the ID3D12Resource for reuse. Fixes #1268. Part of #1833. Assisted-by: Antigravity (Gemini 4 Neon High)
Port upstream PR #1835 (commits 2441d59..5005620) cleanly onto amd-dev with #2436 reserved-texture recycling and #2306 lazy levels. Small sampled textures (< 64 KiB) previously each consumed a full 64 KiB tile plus CreateReservedResource, GetResourceTiling, and UpdateTileMappings overhead. Pack eligible sub-64 KiB sampled textures (when not aliasing an existing live 64 KiB GPU-owned page) into shared 4 KiB-aligned 4 MiB default heaps via CreatePlacedResource in vram_small.rs, reclaiming their 4 KiB slots on release in vram::forget_for_recycle before falling through to reserved-page recycling. Fixes #1835. Assisted-by: Antigravity (Gemini 4 Neon High)
|
|
|
Verification on RTX 3060 Ti (Windows 11), branch merged with current
The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge. — Devin |
bmjask
left a comment
There was a problem hiding this comment.
P2: ReservedPool::take at vram.rs:196-204 removes an entry from by_key/live but does not remove or invalidate its matching VecDeque entry in order. Every reuse/repark adds another order entry (:225-227), so a pool below cap accumulates stale entries indefinitely. At cap, a stale entry can match a reparked pointer and evict it by its original rather than current parking time, violating the intended bounded FIFO behavior. The test takes entries only once and misses reuse->repark cycles. Please tombstone/remove by generation on take and add a repeated recycle/repark plus cap-FIFO test.
…d state Streamed sampled textures placed on shared 64 KiB video-memory pages previously called CreateReservedResource and GetResourceTiling on every placement, costing 0.6-1.7 ms per texture on AMD drivers (xcl-dev#1268) and ~111-140 us on NVIDIA. Keep a bounded per-device pool (512 idle entries, FIFO eviction, opt-out via XCL_RESERVED_POOL=0) of released reserved sampled textures keyed by exact (D3D12_RESOURCE_DESC, uniform D3D12_RESOURCE_STATES). When late_release finishes draining all live GPU queues past a texture's batch, vram::recycle_ready unmaps any still-mapped tiles on the background thread and parks the ID3D12Resource for reuse; matching place_pages calls QueryInterface on the pooled object and reuse its cached tile count, skipping CreateReservedResource and GetResourceTiling. Fixes xcl-dev#1268. Part of xcl-dev#1833. Assisted-by: Antigravity (Gemini 4 Neon) # Conflicts: # crates/xcl/src/hle/d3d12x/vram.rs
bebf2dd to
2f92cc8
Compare
|
@bmjask Good catch — fixed in
|
…extures) Integrates xcl-dev#2436 cleanly alongside xcl-dev#2385 (top-mip shedding) and xcl-dev#2474 (foreign-thread release_cleanup). Assisted-by: Antigravity (Gemini 4 Neon)
|
Independent AMD report for Tested
Not tested
AI use Claude Code (Claude Sonnet 5.5) ran the tests and wrote this report. No game files, dumps or shader names are included. |
|
Re-verification on RTX 3060 Ti (Windows 11), new head merged with current
Thanks! — Devin |
Recycles released reserved sampled textures in a bounded per-device pool keyed by exact
(D3D12_RESOURCE_DESC, uniform D3D12_RESOURCE_STATES)so streamed texture placements skipCreateReservedResourceandGetResourceTiling. Fixes #1268. Part of #1833.What is in it
crates/xcl/src/hle/d3d12x/title_textures.rs:forget(res)returns the removed texture's last tracked uniformD3D12_RESOURCE_STATESwhen all subresources share a single state (states.len() == 1), orNonefor mixed-state / untracked textures.crates/xcl/src/hle/d3d12x/real.rs: on finalRelease(n == 0) whilelate_releaseholds the last PC ref, parks eligibleplace_pagessampled textures with their actual uniform D3D12 state; exposesnote_reservedso reused pointers re-register inRESERVED.crates/xcl/src/hle/d3d12x/late_release.rs: once every live GPU queue is past a batch's fence, hands parked textures tovram::recycle_readyinstead of destroying them.crates/xcl/src/hle/d3d12x/vram.rs: addsReservedKeyand a bounded per-deviceReservedPool(512idle entries/device, generation-tombstoned FIFO eviction with boundedordercompaction, evicted entries dropped outsidePAGES.lock(), opt-out viaXCL_RESERVED_POOL=0).recycle_readyunmaps any still-mapped tiles (pages.unmap) on the backgroundlate_releasethread so retired 64 MiB VRAM pool heaps never leave stale page-table references.place_on_pagespops matching pooled reserved textures viaQueryInterfaceand reuses their cached tile count, skippingCreateReservedResourceandGetResourceTiling. Adds unit tests (reuse hit, state isolation, FIFO eviction, cap=0, repeated take/repark tombstoning + cap-FIFO ordering) and a GPU recycle/rebind test.Tested
32.0.16.2140), AMD Ryzen 7 7800X3D,rustc 1.100.0 (0ef1bc386 2026-11-09), DXC/DXIL1.8.2502.11..\scripts\test.ps1(cargo test --workspace -- --test-threads=4, debug) on head2f92cc8: 1426 passed, 0 failed, 46 ignored across 37 test binaries, including allhle::d3d12x::vram::tests(reserved_pool_reuses_matching_key_isolates_state_and_evicts_fifo,reserved_pool_repark_tombstones_stale_order_and_preserves_fifo, andreserved_resource_recycle_unmaps_reuses_and_remaps_on_gpu).SKIPPEDGPU tests on this adapter (27 total): 21no wave64, 3 per-lane form#1426refusals (V_CVT_F16_F32,V_MUL_F16,V_PK_MUL_F16), 1cannot disable the driver cache (Windows Developer Mode is required)(0x887A002D), 1no xgameruntime.dll, 1no heap windows.#1268microbenchmark on RTX 4070 SUPER (release,2,000iterations each):256x256 BC1 (9 mips):CreateReservedResource + GetResourceTiling + Release222.33 ms (111.17 µs/tex) → recycled pool 0.04 ms (0.019 µs/tex) (5,730× faster).1024x1024 BC7 (11 mips): 279.58 ms (139.79 µs/tex) → recycled pool 0.04 ms (0.019 µs/tex) (7,262× faster).XCL_DIRECT_DXIL=1,XCL_PSO_WAIT_MS=50,XCL_PRESS_A_AT=15,20,25,30,35,40,45, isolated caches):XCL_RESERVED_POOL=1cleanly recycled 32+ streamed reserved textures live before both arms hit the same pre-existingxboxbvhbuilder.dll40-bit VA exception (~112–116 s), with0device removals and-352 MBlower peak commit (28,903 MBvs29,255 MB).Regression run
Not tested
0.62–1.70 msper-textureCreateReservedResourcestall from D3D12.X: CreateReservedResource for each streamed title texture costs ~1 ms on AMD and stalls the title's render thread during world loading #1268 was measured on AMD RDNA2 and should see the largest streaming speedup there).xboxbvhbuilder.dll40-bit VA exception).AI use