Dolphin, the GameCube and Wii emulator - Forums

Full Version: Where is the Shader Cache Stored?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've noticed that every time I reinstall Dolphin 5.0 after resetting a computer (or onto a new computer) and I play a game, it typically stutters (small "micro-stutters") more than usual, but the stutter tend to go away after playing that game enough times. I read that this was caused by a "shader cache" being built up by Dolphin. I've heard that this shader cache is closely related to the GPU of the computer, but I'm still wondering; what exactly is this shader cache, and where is it stored? Is it just a bunch of files that build up on the hard drive somewhere that Dolphin accesses again to prevent the stuttering, or is this shader cache something totally different? Can it even be thought of as a collection of files? I'm not a computer expert, so for all I know, the shader cache could be something stored directly on the GPU. I just don't know.
Very simplified answer (about to make the developers wince)
The Gamecube and Wii use their GPU in a way that is different to how your computer uses a GPU.  The simplified reason is every Gamecube and every Wii uses the same GPU (among other hardware) as every other Gamecube and Wii, so you don't need things like api (OpenGL/DirectX/Vulkan) because you don't need to make your game compatible with different hardware.  This is also the reason to the age old emulation question of "Why can't this computer with hardware just a little better then X console emulate that console... even ones based on PC like hardware?"  To emulate the way the GC/Wii GPU works Dolphin compiles shaders (think little GPU programs that can do various graphical things) to emulate the effects the original hardware would just do directly.  Each of these little programs take time to compile (write) and that is where the micro stutters come in.

As far as coping the shader cache
In regular Dolphin the shader cache can be invalidated (made useless) if any one of many things changes.  New GPU, GPU drivers, changing the version, and I am sure others.  So while you could copy it I am not sure it would work.  But it is under Dolphin\user\cache (I use a portable installation to keep all the files in the same place so I am not sure exactly where it would be in a normal version).

Other option
Dolphin ishiiruka https://forums.dolphin-emu.org/Thread-un...om-version
This custom version of Dolphin tries to mitigate as much of the shader micro stutter issue as possible, but other issues can pop up instead.  Up to you if you want to take a look.
(05-29-2017, 02:48 PM)JohnTravolski Wrote: [ -> ]Is it just a bunch of files that build up on the hard drive somewhere that Dolphin accesses again to prevent the stuttering

Yes, exactly.
Thanks to both of you for the information.