gpu: report GET_LOD_STATS as "no data yet" instead of every texture wanting mip 0 #1880
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1880
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1880/head"
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?
@fabled-aesop on GitHub · 2026-10-24 16:21 UTC · original
fabled-aesop:lod-stats-zero→main· +3 −5 · 1 files · 1 commits · closed without mergingProblem
ASTRO BOT (PPSA21564 01.007.000) never leaves the loading screen before its first level. The loading screen keeps rendering at about 39 FPS, but the game keeps reading files at about 400 MB/s: over 125 GB in under 7 minutes, against 3.8 GB for a normal boot to the menus.
A guest file log shows the same 35-44 textures, almost all normal maps (
*_n.gnfp), opened and fully read about 110 times each. Their reads alternate between 5.7 MB and 128 KB. The texture streamer loads full detail, drops it, and loads it again, forever.Cause
The streamer chooses each texture's detail level from the GET_LOD_STATS report:
0xFwhen unsampled)CpOpGetLodStatszeroes the report and then writes 1 to the first dword (// Hack?). That makes a valid report in which every counter's finest mip is 0. So:Fix
Leave the whole report zeroed. With an invalid header, the guest treats it as "no data yet" and stops thrashing. Textures may stream at lower detail, because nothing is ever reported as sampled. Real statistics would need instrumented pixel shaders.
Jetsku's fork reaches the same conclusion. Its
ExecLodStatskeeps this placeholder as a "legacy" mode that thrashes the streamer, and offers zeroing as the safe fallback (KYTY_LOD_STATS_MODE=zero) next to real GPU statistics (gpu). This change matches thezeromode. I narrowed it down by setting Jetsku's other runtime switches to upstream-like values; Jetsku still loaded with each of them:KYTY_LABEL_MODE=completionKYTY_RT_SOFTWARE=0KYTY_BDA_WRITES=0KYTY_AGC_DONE_MODE=idleKYTY_EQUEUE_COALESCE=0Testing
Windows 11, RTX 5080, i7-14700K,
--amd-cpu:8291cfeb.The game runs came from a branch that also carries other local fixes (#838, the mesh-slice patch from #793, and a DS_APPEND helper-lane fix for #1511). This PR's one commit is the only change aimed at the loading loop. Without it, that same branch stays stuck.
Not tested: other titles that use GET_LOD_STATS.
AI Use: Code and builds generated by Claude. Reviewed and tested changes personally.
ASTRO BOT (PPSA21564) never leaves the loading screen before its first level. The screen keeps rendering (about 39 FPS) while the game reads about 400 MB/s of files: over 125 GB in under 7 minutes, against 3.8 GB for a normal boot to the menus. A guest file log shows the same 35-44 textures (almost all normal maps, *_n.gnfp) opened and fully read about 110 times each, alternating a 5.7 MB and a 128 KB read: the texture streamer loads full detail, drops it and loads it again, forever. The streamer decides each texture's detail from the GET_LOD_STATS report: a 64-byte header whose first dword marks it valid, then one 64-bit entry per T# counter (sample count in bits 0..23, finest sampled mip in bits 56..59, 0xF when unsampled). The placeholder zeroed the report and wrote 1 into the first dword ("Hack?"). That is a valid report in which every counter's finest mip is 0, so every texture asks for full detail, the streaming budget overflows, textures are evicted and asked for again on the next report. Leave the whole report zero instead. With an invalid header the guest keeps "no data yet" and stops thrashing; textures can drift to lower detail, since nothing is ever reported as sampled. Real statistics need instrumented pixel shaders (Jetsku's fork, KYTY_LOD_STATS_MODE=gpu). How this was found: Jetsku's int19.4 fork gets through the same loading screen on the same PC. Jetsku's other runtime switches set to upstream-like values (KYTY_LABEL_MODE=completion, KYTY_RT_SOFTWARE=0, KYTY_BDA_WRITES=0, KYTY_AGC_DONE_MODE=idle, KYTY_EQUEUE_COALESCE=0) all still loaded. Its ExecLodStats documents this placeholder as the "legacy" mode that "thrashes the streamer" and offers "zero" as the safe fallback, which this change matches. Tested on RTX 5080 / i7-14700K with --amd-cpu: the normal maps are read 3-8 times, the first gameplay model loads and the game reaches the level (VS 258 / PS 189 / CS 92 / GS 10), as in Jetsku's working runs. Co-Authored-By: Claude Opus 5.5 <[email protected]>Pull request closed