Support us on Patreon to keep GamingOnLinux alive. This ensures all of our main content remains free for everyone. Just good, fresh content! Alternatively, you can donate through PayPal. You can also buy games using our partner links for GOG and Humble Store.
We do often include affiliate links to earn us some pennies. See more here.
Dolphin [Official Site] is one of my favorite open source projects and the progress they’ve made in the past few years is truly impressive. In their latest project blog post, the developers have outlined a very exciting new feature in the emulator, one which helps mitigate the issue of stuttering.

The problem of shader compilation stuttering is something of a recurring problem when it comes to rendering. If there’s no shader cache present, GPUs generally spend precious time compiling shaders which then results in jerkiness as things struggle to be rendered properly. To complicate things, shader caches are unique to driver versions, configurations and the actual game so, that, if there’s any change, they need to be re-compiled. In short, and I know I’m simplifying things for the sake of brevity, being able to have a reliable shader cache is something that can vastly improve user experience.

image

The Dolphin team is confident that they’ve implemented a very “ridiculous” but good solution to this stuttering problem. They’ve written an interpreter that emulates the actual Gamecube/Wii rendering pipeline. It avoids compilation during the game and instead relies upon flexible shaders that compile when you initially start up the game. It required a very specialized knowledge of not only the hardware but also the APIs and drivers, so it’s a massive achievement to get something like this done.

The write up by the Dolphin team details the nature of these challenges and the technical considerations that had to be made in order to get all of this working. I recommend that you give it a read if you’re more technically-minder or simply curious to learn more.

So, what does this mean, in practical terms, to the average user? With these so-called “Ubershaders” a lot, if not nearly all, of the stuttering in the emulator is gone. The current recommended “hybrid” option greatly reduces performance cost while keeping games running smoothly. I tried them out for myself and found that the implementation seems to work as promised. Shaders compiled at startup and I didn’t notice any stutter as I played a bit of Super Mario Sunshine and Twilight Princess. These Ubershaders ought to work on both OpenGL and Vulkan backends, though I only tried it out with the latter.

image

There’s a few caveats to all of this, mostly for a few specific hardware vendors and driver combinations. For Linux users, there’s a few quirks that mostly affect those who use Nvidia cards with proprietary drivers. First and foremost, the compiled shaders are much slower on OpenGL and Vulkan than their (Windows) D3D backend. The Dolphin team is limited by the lack of tools provided by Nvidia to disassemble shaders, despite every other vendor providing the tools. Likewise, there’s also a quirk in the driver that causes some slight stutter when shaders are compiled which again does not happen in D3D.

Mesa users like myself are all good, however, and the project gets some praise for smartly sharing shaders between pipelines and thus eliminating any potential stutter with new blending modes. Both Intel and AMD users are recommended to use the Vulkan backend as anv and radv behave well with the emulator.

The Dolphin team are still hard at work adding new features and optimizing things and I, for one, can’t wait to see what other things they have in store for the future. You’ll have to grab a development version or compile from source to check out Ubershaders for now. Article taken from GamingOnLinux.com.
12 Likes
About the author -
author picture
History, sci-fi, technology, cooking, writing and playing games are things I enjoy very much. I'm always keen to try different genres of games and discover all the gems out there.

Oh and the name doesn't mean anything but coincidentally could be pronounced as "Buttery" which suits me just fine.
See more from me
The comments on this article are closed.
8 comments

GustyGhost Jul 30, 2017
Much needed as any emulators for older consoles run flawlessly but, once you get into ~6th generation console territory, your PC needs to be really beefy to have a chance at emulating with minimal stutter. Considering the age of GC/Wii games at this point, it is kind of discouraging to see so much modern hardware still struggling. Thanks for reminding me to donate to the Dolphin project.
chimpy Jul 31, 2017
For anyone with eperience with this emulator: what's more important, the CPU or the GPU?
Nasra Jul 31, 2017
Quoting: chimpyFor anyone with experience with this emulator: what's more important, the CPU or the GPU?

In term of performances, CPU is more important in Dolphin, performances per cores is a very important thing for Dolphin (a "simple" Intel Pentium performs similar than AMD FX processors).

In term of display, some effects needs to be supported by the drivers / graphic card to be displayed correctly, this is affect performances.
silmeth Jul 31, 2017
QuoteIf there’s no shader cache present, GPUs generally spend precious time compiling shaders which then results in jerkiness as things struggle to be rendered properly.

It’s the CPU which compiles the shaders (the compiler code is part of the graphics driver, but it is executed on the CPU, the GPU then only executes the compiled shader). True, though, that the compile time can be long and the game has to wait until the shader is compiled, ending with stutter (or can keep working while shader is being compiled asynchronously in the background – with ugly rendering artifacts).

QuoteThe Dolphin team is confident that they’ve implemented a very “ridiculous” but good solution to this stuttering problem. They’ve written an interpretter that emulates the actual Gamecube/Wii rendering pipeline.
Writing an interpreter for the rendering pipeline is not ridiculous – that’s totally fine solution for an emulator. What is ridiculous is the fact that the interpreter is executed by the GPU, itself being a big shader, called by them ubershader (though IMO metashader would be better – shader interpreting other shaders). As far as I know, there was no other projects, at least in the FLOSS world, to write such a big piece of non-rendering logic in a shading language. That trully is ridiculous and pretty amazing.
Leopard Jul 31, 2017
Nvidia is one of the reasons why OpenGL turns into a horror show.

They've added so many extensions to it for their cards.
elmapul Jul 31, 2017
Quoting: AnxiousInfusionMuch needed as any emulators for older consoles run flawlessly but, once you get into ~6th generation console territory
what emulator do you use for n64? mupen stoped evolving (except for android mupen) and there are a lot of games unplayable on it.

project64 dont have an native version (and emulating an emulator is not an ideal solution.
GustyGhost Jul 31, 2017
Quoting: elmapulwhat emulator do you use for n64? mupen stoped evolving (except for android mupen) and there are a lot of games unplayable on it.

project64 dont have an native version (and emulating an emulator is not an ideal solution.

Performance is fine, but yes, there are rendering inaccuracies. I'm keeping my hopes up for cen64 cycle-accurate emulator.
edo Jul 31, 2017
All I know is that I updated my dolphin to the latest git and now it doesn't start on the nvidia card.
While you're here, please consider supporting GamingOnLinux on:

Reward Tiers: Patreon. Plain Donations: PayPal.

This ensures all of our main content remains totally free for everyone! Patreon supporters can also remove all adverts and sponsors! Supporting us helps bring good, fresh content. Without your continued support, we simply could not continue!

You can find even more ways to support us on this dedicated page any time. If you already are, thank you!
The comments on this article are closed.