Repository navigation
Conversation
Since Eglantine-Community#794, Switch 2 titles read report timestamps as nanoseconds (ReadGpuTimestamp). Mario Kart World sizes its dynamic resolution from GPU timestamps: with nanoseconds the emulator's GPU latency reads as a nearly full frame budget, so the resolution changes every few frames and each change recreates and re-uploads its render targets (16x the texture cache image creations of the previous behaviour). Keep the previous timestamps (GPU ticks over the GPU clock setting's divisor) for Mario Kart World only; other Switch 2 titles are unchanged. Whistlestop Summit time trial, RX 6700S, default settings: before Eglantine-Community#794 27-28 fps, nx2-experimental 19.7 fps, with this 30.1-30.2 fps. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQZoXmd1tepstZpngXBzCj
|
Performance win on Linux with RX 6600 (8GB VRAM) |
Nx2NoteListHostWrite queued a new list copy of a page when a write couldn't be patched into the existing copy. Nx2CopyListPages copies the host buffer, which doesn't hold CPU-written words until the buffer is next synchronized, so the new copy was marked current with the GPU's older data. DmaPusher then parsed that data as commands: Mario Kart World (RX 6600, RADV) read float words as "method 0x1 count 8063", ran garbage puller methods and render targets, and aborted after 8-21 minutes. Leave the copy stale instead, as before Eglantine-Community#794: Nx2ReadListCopy answers Unknown and the list is read the safe way. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YQZoXmd1tepstZpngXBzCj
|
Added aeab4fc for the crash @Octelly hit with this PR (RX 6600, RADV). Both logs abort the same way: the command reader parses float data ( The cause is from #794, not the timestamp change. When a CPU write can't be patched into a command list page's copy, MKW performance is unchanged (31.1 fps in the same test). I can't reproduce the crash on my machine (it took 8–21 minutes on Linux), so it needs a longer session on an affected setup to confirm. 🤖 Generated with Claude Code |
2ecab36
into
Eglantine-Community:nx2-experimental
Problem
Since #794, Switch 2 titles read report timestamps as real nanoseconds (
ReadGpuTimestampingpu_timestamp.h). Before,GetTicks()returned 614.4 MHz GPU ticks divided by the GPU clock setting (256 with the default Boost).Mario Kart World sizes its dynamic resolution from these timestamps. With nanoseconds, the emulator's GPU latency looks like a nearly full frame budget, so the game changes its resolution every few frames (render targets switch between about 336x188 and 352x200 at the same address). Each change makes the texture cache recreate and re-upload those render targets. In a race that's about 48,000 image creations per 2,600 frames, against about 3,000 before #794, and it all lands on the GPU back thread.
Fix
Mario Kart World (
0400C3F00006E000) keeps the previous timestamps: the existing non-ampere path, GPU ticks over the clock setting's divisor. Other Switch 2 titles are unchanged. The title is looked up once the application process exists and cached per GPU instance; before that, nanoseconds are used as now.Testing
Time trial on Whistlestop Summit, the same course in every run, fps over the same 1,800 race frames. RX 6700S (AMDVLK, Windows), default settings:
db61d0de3)nx2-experimental(28edf9fd1)nx2-experimental+ this PRSetting the GPU clock to Overclock on unpatched builds also restores about 30 fps, which confirms the cause. Frames looked normal in the patched runs.
I added a unit test to
src/tests/video_core/gpu_timestamp.cpp, but haven't compiled or run it: the test build is off on the machine I used.Not addressed
Any title that changes its dynamic resolution still pays the render-target recreation cost in the texture cache. Making those resizes cheaper would be a separate change.
🤖 Generated with Claude Code
https://claude.ai/code/session_01YQZoXmd1tepstZpngXBzCj
Summary by CodeRabbit