GPU detile pass (#592) causes severe FPS regression at native/high internal resolution
Bug Description
PR #592 ("GPU compute detile for guest tiled textures", commit a158960) introduces a severe FPS regression on at least Demon's Souls (PPSA01341) at native/high internal resolution. This looks like it's the same symptom multiple people are currently reporting on #2 (e.g. "5fps is max" at splash, audio stuttering after the SIE logo) on recent builds.
Reproduction / Evidence
Reverting a158960 alone (git revert a158960 on current main, no other changes) restores normal performance on the same title/hardware:
With detile pass (current main) |
a158960 reverted |
|
|---|---|---|
| Init to main loop | ~17.3s | ~11.6s |
ResourcePool::GatherResourceFileInfo() |
~36.3s | ~13.9s |
| In-game FPS (menus/cinematic) | 0.3 – 2.0 fps | 4.5 – 6.6 fps |
(Second set of numbers measured on a build with a separate boot-crash fix applied on top — see #617 — but the detile pass is the only variable changed between the two columns.)
Earlier local testing (session log, not on this account) measured the same regression at the extremes: ~6fps → ~0.2fps on Demon's Souls at 3840×2160 with the detile pass present, and init time 6.3s → 1.7s with it reverted.
Hardware
- CPU: AMD Ryzen 9 7900X
- GPU: NVIDIA GeForce RTX 3090
- RAM: 130 GB
- OS: Windows 11
Suggested Next Step
Worth profiling VulkanDetilePass.cs / the new compute dispatch path specifically — likely candidates are per-frame allocation or a synchronous wait that scales badly at higher internal resolutions, since the regression is much more severe at native res than it may have been in whatever conditions #592 was validated under.
Note: character creation screens remain slow (1.6–2.7fps) even with the detile pass reverted — that looks like a separate, unrelated bottleneck (possibly tied to an unresolved sceAgcDcbDrawIndirect import seen firing repeatedly during character-model rendering), not something this issue is about.
Follow-up: pooled VulkanDetilePass's per-call Vulkan buffers/descriptor pool instead of creating and destroying them on every RecordDetile call (a busy loading screen creates many textures per frame, each previously paying for 4 fresh buffer allocations + a fresh descriptor pool). Correctness-verified (all 16 VulkanDetileSelfTest cases pass) and pushed to the same branch/PR as the earlier memory-locality fix.
Direct A/B on Demon's Souls, same machine/conditions, same loading-phase checkpoint: FPS and the perf overlay's ALLOC/GC numbers are effectively identical with and without this change (~0.6-0.7 FPS, ~5.1-5.5 GB/s either way).
Checked what the overlay's "ALLOC" stat actually measures (PerfOverlay.cs: GC.GetTotalAllocatedBytes) - it's the .NET managed heap allocation rate, not native Vulkan allocations. So this pooling change doesn't touch the thing that's actually saturating during this loading phase. Whatever is allocating 5+ GB/s of managed memory during that window is very likely the real bottleneck behind the low FPS, not per-call Vulkan buffer/descriptor-pool overhead. That's the next concrete thing to chase for this issue - profiling what's producing that managed allocation volume (dotnet-trace/dotnet-counters during this same loading phase would likely point right at it), not further Vulkan-side pooling.
Could you take a look at the log of my last test for the gpu guest tiled fix main? for some reason, the game runs normally from the splash screen to the ps logo, but then it freezes, the audio stutters, and it won't go past that point. I think something's wrong with my pc because other people who run the game can reach the character menu, and it happens to me in every test I do. I've already mentioned it in the game's thread but my rig is i7-14700k 4080 super and 16GB.