Repository navigation
perf(agc): learn a bound depth target's fast clear from its pending HTILE fill - #6764
SP4C3B4R-8 wants to merge 1 commit into
Conversation
…TILE fill A depth target whose HTILE a recorded uniform fill is still writing made storeBackClearedHtile read the whole HTILE on the CPU, so the flush hook waited for the batch holding the fill. Astro Bot clears its shadow cascades' HTILE that way every frame (2048x2048, 256 KiB each): about 190 such reads per 10 s at Crash Site, 3.3 s of GPU waits inside queue 0's draws, every one reading the uniform word the fill had just been noted with. NoteDepthMetadataFill now keeps the fill's word with the recorder note of its write. While that write is still the newest recorded write over the target's HTILE (and no unit shadow covers it), the word is what the range will hold: the clear is taken from it, and the expanded words the CPU path writes after its read go in by a GPU fill ordered behind the noted one, which becomes the range's newest note. Any other noted metadata write over the range (forgetHtileReads) drops the kept fill. agc_driver_depth_fast_clear_submit gains PendingFillClearsWithoutWait: a GPU fill of the HTILE, noted and still pending, then a bind of the target (depth, and depth with stencil in the HTILE) takes the clear without a hook wait, leaves the HTILE expanded, and a later draw keeps its depth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
|
Data point from a CPU-bound scene on Windows: RTX 3060 12 GB (NVIDIA 617.42), i5-12400F, Windows 10 19045, MinGW GCC Release. Minecraft Dungeons II (PPSA16064 01.100.100), title screen, no input, 200 s rows,
Within the run-to-run spread (about ±1.5 % here), no regression, 0 fatal. AI-assisted: yes (Claude Code) |
|
Hi @SP4C3B4R-8 — this looks like the same change as #6505 (opened 2026-10-15): both take a bound depth target's fast clear from a pending uniform HTILE fill and record the expanded words as a GPU fill behind it, instead of reading the HTILE in #6505 has test reports so far from ASTRO BOT Happy to run both PRs side by side on the 780M if that helps the maintainers pick one. |
|
Tested on GTA V (PPSA04264) in the open world (Los Santos, a story save resumed), Windows 11, RTX 4090 (driver 616.92), i9-13900K. Both HTILE PRs were measured on the same base, one run each, in the same session:
A committer profile of the base (sampling the AI-assisted (Claude Code). |
|
Closing in favour of #6505, which takes the same idea further (75% of the GTA V hook wait removed against 40% here, per @tibzejoker's side-by-side run) and now covers the depth and stencil case |
What
When a depth target is bound while a recorded uniform fill of its HTILE is still pending,
storeBackClearedHtilereads the whole HTILE on the CPU to learn the fast clear. The read goes through the flush hook, so it waits for the batch that holds the fill, inside the draw.Astro Bot (PPSA21564) clears its shadow cascades this way every frame (2048x2048, a 256 KiB HTILE each). At
-lvl hub_crashsitethat was about 190 such reads per 10 s, 3.3 s of hook waits inside queue 0's draws ([draws] ... hook waits inside draws), and every one of them read the uniform word the fill had just been noted with (NoteDepthMetadataFill).NoteDepthMetadataFillkeeps the fill's word with the recorder note of its write (LastWriteNote, only under the GPU mutex, so a fill stored on the CPU keeps none).NewestWriteNote) and no unit shadow covers it, the HTILE will hold that word: the clear is taken from it without reading. Same scheme as the DCC key memo (NoteKeysFillOnGpu/PendingStoreKeys).forgetHtileReads: another fill, a recognized HTILE clear kernel) drops the kept fill. Anything else, the CPU path runs as before.Measured on Windows (where draw inputs need #6763 to leave the GPU-bound regime), Crash Site,
APS5_PROFILE_DRAW=1/APS5_PROFILE_GPU=1: hook waits inside draws 3.3 s -> 0.0 s per 10 s, queue 0 worker 74.6 -> 32.1 us per draw packet; with the draw input copies, 7.52 -> 7.86 fps. Dumped frames match (shadows of the player, the tower and the foliage on the sand).Tested
Windows 11 Pro (26300), MinGW-w64 GCC 15.2.0, Release, Ryzen 7 7800X3D, RTX 5070 Ti.
agc_driver_depth_fast_clear_submitgainsPendingFillClearsWithoutWait: a GPU fill of the HTILE, noted and still pending, then a bind of the target (depth only, and depth with stencil in the HTILE): the clear is taken with no hook wait (Recorder::ThreadHookWaitsunchanged), the HTILE ends expanded (0xfffc000f / 0xfffff3ff), and the next draw keeps its depth. With the new path disabled it fails ("the bind read the HTILE under its pending fill: it waited for the batch").ctest -R "depth|htile|fast_clear|_fill") pass.agc_driver_multisample_fill_host_onlyfails now and then here ("the sentinel fill did not land"), 1 of 10 runs onmainwithout this change too.tools/check_conventions.py --base origin/mainpasses.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository🤖 Generated with Claude Code