Dolphin, the GameCube and Wii emulator - Forums

Full Version: What exactly causes shader cache stuttering?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3 4
Whether it's loading up a new effect like any character's unique effects in Super Smash Bros. Melee or Brawl or firing off all your beams/using Morph Ball for the first time in Metroid Prime, I've been wondering what's currently unknown in Dolphin's development that causes this. 

This isn't a "Why hasn't this been fixed already?" sort of question, but more of a curiosity in what's preventing accurate emulation to remove these stutters.
It takes time to compile the shaders that represent the current Gamecube GPU pipeline configuration, and since this is done by the graphics driver, there's no direct way around it.

Possible solutions include:

1) Ishiruuka's solution: just don't display the object until its shader is compiled, causing potentially bad graphical glitches but avoiding stutters.

2) Ubershader solution: compile an ubershader (or a set of ubershaders) that can represent any Gamecube GPU pipeline configuration, and load that until the specialized one is finished compiling. Nobody's done this one yet, so it's not certain it would work effectively.

3) Partial ubershader: identify families of shaders which are similar but differ in small ways, and compile slightly more generic versions than currently (but not fully generic) so that a single shader can represent all those slight variations, thus dramatically reducing the number of shaders necessary (and much less stuttering). This would require analysis of how games configure the GPU pipeline and what sort of shaders are typically generated in games that generate very large numbers of shaders, like Metroid.
Wait the compiling is done by the drivers not dolphin? There are many games where the stutters often last several seconds, is that entire time seriously spent with the application waiting for the drivers to compile a shader? What on earth could the drivers possibly be doing specifically that would take that long?
So, it's a large scale issue with a lot of research involved in it then. This is a bit of an assumption (as I haven't actually used it), but the Ishiruuka branch exists for the purpose of temporarily getting around these issues in a messier fashion for better performance then? I imagine this is something that won't get a proper workaround for a while although at least its impact isn't substantial.
Compiling lots of code takes a long time! Shader compilers are often optimized for performance -- not compilation speed -- to get maximum framerate in real games.
I have only stuttering and issues with Mario Kart Wii in games I play atm. I have been wondering if it will get better. Still mostly playable for me and I could probably tweak some settings.
What about pre-compiled shaders? I would be willing to play through a few games and then upload my shader cache. Get enough people and you could have shader packs that people could download. How big do the shader caches typically run? If their not too big you could download them when it detects said game in your library similar to how it downloads a picture that represents the game.
(04-08-2015, 03:47 AM)bomblord Wrote: [ -> ]What about pre-compiled shaders? I would be willing to play through a few games and then upload my shader cache. Get enough people and you could have shader packs that people could download. How big do the shader caches typically run? If their not too big you could download them when it detects said game in your library similar to how it downloads a picture that represents the game.
The compiled shaders are different not only between games but also between Dolphin versions, graphics cards and graphics backends. A shader pack would be useful for so few people that it's not worthwhile. (Also, the pictures for the games are not downloaded.)
It doesn't actually download the banner image - for GameCube games it's in a certain part of the disk image for every game, and for Wii games it's embedded in the save game.
(04-08-2015, 03:59 AM)AnyOldName3 Wrote: [ -> ]It doesn't actually download the banner image - for GameCube games it's in a certain part of the disk image for every game, and for Wii games it's embedded in the save game.

I didn't know that that's neat.

Quote:The compiled shaders are different not only between games but also between Dolphin versions, graphics cards and graphics backends. A shader pack would be useful for so few people that it's not worthwhile. (Also, the pictures for the games are not downloaded

alright sorry
Pages: 1 2 3 4