Repository navigation
D3D12.X: omit VRAM-only sparse tiles and GPU-written textures from write-watch ranges - #2754
Saksukella wants to merge 2 commits into
Conversation
luckyteagirl
left a comment
There was a problem hiding this comment.
On 60bc047f, mapped_ranges() now excludes an existing tile while entry.holes == 0xFFFF and caches that empty result in s.runs. The new invalidation in drain_lazy_commits() covers VEH commits, but the ordinary committed() → commit_range() path can also clear a hole bit on a tile that is already in s.mapped. In that case ensure_mapped() has no new entry to map, and commit_range() changes entry.holes without clearing s.runs or incrementing MAPPED_GEN. title_textures::cached_watch_ranges() can therefore keep omitting the newly CPU-backed tile on later submits, missing its CPU dirty pages until some unrelated mapping changes.
I reproduced the cache transition with a small CPU harness that compiles the exact commit_range, mapped_ranges, and new watchable_tile_runs functions from this head, with minimal state/ensure_mapped stubs for one already-mapped tile. After priming an all-holes tile and committing one 4 KiB page, the base b5c0275 still returned its watch range (exit 0); this head returned [] with holes=0xfffe and generation unchanged (assertion failure, exit 101). This isolates the cache behavior; it does not reproduce a D3D12 title failure.
Could the explicit commit path invalidate both the cached runs and generation when a tile becomes watchable? A regression test should prime mapped_ranges() before committing part of a VRAM-only tile, then assert the next range and generation include it. Codex (GPT-6.2 Sol and GPT-6.2 Astra) reviewed this exact head and CPU differential.
|
Independent test report: PR #2754 at head Hardware / toolchain
Tested (
Regression run
Not tested
AI use
|
|
Good catch @luckyteagirl — fixed in |
|
Independent Windows/NVIDIA check of PR #2754 head
I also attempted Not tested: paired clean-commit retail smoke, the time saved by AI use: Codex (GPT-6.2 Sol) ran the Windows checks, compared the focused failure with the base, and drafted this report. |
|
Tested - retail title on native Windows AMD RDNA2, PR head Tool: OpenCode with DeepSeek V4.1 Flash 1017
The target does not move on this title: the ~1.9M dirty pages are in tiles with CPU-committed Note: the PR is Not tested: world/FPS (not reached), NVIDIA/Intel GPUs, full workspace, debug build. AI use: OpenCode with DeepSeek V4.1 Flash 1017 ran the tests and the game runs, read the logs and wrote this comment; the counts, write-watch lines and merge check were verified against the logs and git. |
What is in it
crates/xcl/src/hle/d3d12x/sparse.rs:watchable_tile_runs(mapped)and exclude VRAM-only tiles (holes == 0xFFFF, never CPU-committed) frommapped_ranges()soGetWriteWatchskips purely GPU-resident sparse tiles.drain_lazy_commits(), invalidateself.runsand bumpMAPPED_GENwhen a lazily CPU-committed tile transitions offholes == 0xFFFF.drain_lazy_commits_if_pending()(zero-lockAcquirefast path when no lazy commits are pending) sorefresh_once()reflects newly CPU-committed tiles on the very first submit without a 1-submit delay.watchable_tile_runs_omits_vram_only_holes_until_unmasked.crates/xcl/src/hle/d3d12x/title_textures.rs:Table::watchable_ranges(&self)excludinge.gpu_writtenrender targets / UAV textures fromcached_watch_ranges(), bumpTEXTURES_GENinnote_gpu_write()when a texture becomes GPU-written, and callsparse::drain_lazy_commits_if_pending()beforecached_watch_ranges(u)inrefresh_once().watchable_ranges_excludes_gpu_written_textures.amd-dev(wherealloc_vram_only/drain_lazy_commitslive).Tested
32.0.32029.2010), 24-thread x86_64 CPU, 32 GB RAM, Windows;rustc 1.100.0 (0ef1bc386 2026-11-09); debug (tests) and release (xcl.exe).cargo test -p xcl --lib watchable_tile_runs_omits_vram_only_holes_until_unmasked: 1 passed, 0 failed (0.00s).cargo test -p xcl --lib watchable_ranges_excludes_gpu_written_textures: 1 passed, 0 failed (0.00s).Regression run
Not tested
AI use
GetWriteWatchrange collection, catching the first-submitdrain_lazy_commitsordering hazard, writing the patch and unit tests, and running local tests and smoke verification. All diffs and measurements were verified locally on hardware.