Hacker News new | ask | show | jobs
by armada651 660 days ago
> Dolphin's ubershader does one thing; simulate fixed-function blending/texturing using modern flexible hardware.

Just to clarify, Dolphin's specialized shaders simulate fixed-function blending/texturing too. What's different about ubershaders is that a single shader can handle a wide variety of fixed-function states whereas a specialized shader can only handle a single state.

Thus whereas specialized shaders have to be generated and compiled on-the-fly resulting in stutter; ubershaders can all be pre-compiled before running the game. Add to this the capability to asynchronously compile specialized shaders to replace ubershaders and the performance loss of ubershaders becomes negligible. A rare case of having your cake and eating it too.

1 comments

This is very true. And to make matters even more confusing, certain drivers were at some point capable of constant-folding shaders on-the-fly so that ubershaders are essentially moved back into a bunch of specialized shaders, negating the entire concept. I don't believe this actually affects Dolphin, though (I think the drivers in question have given up this optimization).