• Hey Guest. Check out your NeoGAF Wrapped 2025 results here!

Dolphin adds Ubershaders - Shader Compilation Stuttering a solved problem

gngf123

Member
https://dolphin-emu.org/blog/2017/07/30/ubershaders/

When you're playing your favorite game on Dolphin with a powerful computer, things should run fairly well. The game is running full speed, there are no graphical glitches, and you can use your favorite controller if you want. Yet, every time you go to a new area, or load a new effect, there's a very slight but noticeable "stutter." You turn off the framelimiter to check and your computer can run the game at well over full speed. What's going on?

The slowdown when loading new areas, effects, models, and more is commonly referred to as "Shader Compilation Stuttering," by users and developers alike. This problem has been a part of Dolphin since the very beginning, but has only recently become more of a focus.

Read more over on the link. Exclusive mode appears to need a high end GPU, but Hybrid mode is there for that.
 
I've heard this is massively expensive at IR's in 4K. So I will be skipping this at the moment, though, would be cool to see some benchmarks. Ishiiruka still works well enough.
 
That's a long article but a good read!

Also:

Mc45XIf.png
 
That stutter was an annoying on my laptop. Wanted to replay Xenoblade on Wii U but it does not look too good in HD. I can run it fine with a higher res, but that stutter makes it unplayable for me.
 
Great stuff, they've been working on this for a very long time. It was one of the things holding back the official release compared to the Ishiiruka build, although that used a less accurate method of eliminating stuttering. And well detailed article from the devs as always.
 
Also minor question about gamecube pad setting on DS4 - how should i better map ABXY buttons on triangle, square, x and o? 😀 Gamecube have such weird button placement..
PS - should i map triggers with analog triggers or only analog triggers alone?
 
Hybrid mode works pretty well with Metroid Prime. Exclusive mode is too much for my GTX 970 though, even with 1080p resolution. 😀
 
Does this work better than the Isuriika fork? I always found that pretty much solved all stuttering issues anyway.

In short it's a better solution but if you want to run 4K on the internal res you are out of luck for now for the most part.

I will be sticking with Ishii because with compiling on startup and a few other options I need my image quality at 4K and 2xMSAA with a few more goodies like per pixel lighting.

Not sure about hybrid mode though. Tino said he would try and implement these in ishii when I asked him.
 
In short it's a better solution but if you want to run 4K on the internal res you are out of luck for now for the most part.

I will be sticking with Ishii because with compiling on startup and a few other options I need my image quality at 4K and 2xMSAA with a few more goodies like per pixel lighting.

Not sure about hybrid mode though. Tino said he would try and implement these in ishii when I asked him.

You can try Hybrid mode though, its much faster.
 
You can try Hybrid mode though, its much faster.

Yeah, I will have to do that. I have been using Ishii for a long time.

Not quite sure I can do it though on a 2500k and 1070 but we will see.

Man, games like DKCR look so amazing with the texture and font pack at 4K. At some point uber shaders are going to be amazing for all.
 
This should help Rogue Squadron 2 yeah? I've only just got into emulation but I thought I read that a lot of stutter in that game was from shader generation.
 
phire himself recollected that his initial reaction consisted of, Holy shit, it's actually running at full speed and further admitted that GPUs shouldn't really be able to run these at playable speeds, but they do.

Hahaha, it reads like something Lionel Mandrake would have written.
 
Yeah, I will have to do that. I have been using Ishii for a long time.

Not quite sure I can do it though on a 2500k and 1070 but we will see.

Man, games like DKCR look so amazing with the texture and font pack at 4K. At some point uber shaders are going to be amazing for all.

Well, Metroid Prime in 4k+2xmsaa was to much even for Hybrid Mode for my i5-3570 and gtx970, but 1440p+2msaa works fine, maybe even something in between these resolutions also will work without framedrops =)
 
Fantastic read as always. They also get in to something that has also been plaguing the PC industry for so long;

NVIDIA's Compiled Shaders on OpenGL and Vulkan are Much Slower than D3D

This one is particularly frustrating as there is no great way for us to debug this. We're feeding the same shaders to the host GPU on OpenGL, Vulkan and D3D, yet, D3D ends up with shaders that are much faster than the other two backends. This means that on a GTX 760, you may only get 1x internal resolution in a particular game on OpenGL or Vulkan, but on D3D, be able to comfortably get double or even triple before seeing slowdown.

Since NVIDIA does not allow us to disassemble shaders despite every other desktop GPU vendor having open shader disassembly, we have no way to debug this or figure out why the compiled code is so much more efficient on D3D. Think about how ridiculous this is: we want to make Dolphin run better on NVIDIA and they don't provide the tools to let us even attempt it. It's a baffling decision that we hope is rectified in the future. Without the shader disassembly tools provided by other vendors, fixing various bugs would have been much more difficult.

The sad thing is, the tools we need do exist - - if you're a big enough game studio.

Rally up enough commotion on issues like this and hopefully some day NVIDIA will change their ways. Being so closed and proprietary with your technology causes nothing but hurt for consumers and headaches for developers.
 
So is this the best way to play Metroid Prime now?

Fantastic read as always. They also get in to something that has also been plaguing the PC industry for so long;



Rally up enough commotion on issues like this and hopefully some day NVIDIA will change their ways. Being so closed and proprietary with your technology causes nothing but hurt for consumers and headaches for developers.

Nvidia has 0 incentive to change when they are still destroying AMD in slaes on the PC. If AMD actually gets competitive we might see Nvidia change. I wouldn't hold my breath though.
 
The shader cache stuttering turned me off playing on Dolphin since I'm super sensitive to that stuff, so this is very promising news :D
 
In short it's a better solution but if you want to run 4K on the internal res you are out of luck for now for the most part.

I will be sticking with Ishii because with compiling on startup and a few other options I need my image quality at 4K and 2xMSAA with a few more goodies like per pixel lighting.

Not sure about hybrid mode though. Tino said he would try and implement these in ishii when I asked him.

Mixing the two would make little sense. Ishiiruka is fast because it ignores the new shader objects while the object-specific shader is being compiled, while hybrid mode is using ubershaders while the object-specific shader is being compiled. You either do one or the other, I think.
 
It's a little bit off topic but this issue is really apparent with Dark Souls even on high end pc's (especially with HQ texture mods).

It would be awesome if there would be a way to do that with that game.
 
The hybrid solution is really impressive in terns of engineering. Nicely done.

Fantastic read as always. They also get in to something that has also been plaguing the PC industry for so long;
You are ignoring a bit of important context here. If you read on to the "Recommended Settings" section of the article, you'll note that they say "The AMD OpenGL driver is just slow in general.", and that it's recommended not to use it at all.
 
so in light of this Recent update whats the Best way to play twin snakes have a 1080 and 4770k

trying to locate a controller config for my DS4 as well .....
 
The hybrid solution is really impressive in terns of engineering. Nicely done.

You are ignoring a bit of important context here. If you read on to the "Recommended Settings" section of the article, you'll note that they say "The AMD OpenGL driver is just slow in general.", and that it's recommended not to use it at all.

They do say both of AMD's Vulkan drivers are good though (The official Windows/Linux one and RADV). Their Nvidia complaint existed for Vulkan too.
 
As someone who knows a little about graphics programming, this is pretty crazy indeed. They basically implemented part of the Gamecube/Wii GPU emulation on the host GPU itself. What's important to note here is that shaders (programs that run on the GPU) are not great at anything except number crunching. GPUs are really dumb compared to CPUs but they are much more parallel. That they made this work at all, and so well, is very impressive, especially for an open source project.
 
Yay. The stuttering in Prime was really annoying. I'm so happy they have finally found a solution.

And it's nice to see the GPUs put to work.
 
This should make playing Tatsunoku vs Capcom way better. Every time you tried to do a super it was stutter city.
 
So problem solved but at the expensive of Dolphin becoming more resource intensive. Damn, emulation is a cruel beast. Just when I could finally run games in 4k at full-speed after an upgrade. Well, maybe in another 5 years.
 
Having tested this on a GTX 1080, stick with Direct3D 11 if you have nvidia. I was getting stuttering using opengl in hybrid mode. DX11 cleared it up.

So problem solved but at the expensive of Dolphin becoming more resource intensive. Damn, emulation is a cruel beast. Just when I could finally run games in 4k at full-speed after an upgrade. Well, maybe in another 5 years.

Hybrid should be a good option for most everyone. Every time it would stutter before it will instead now try and use ubershaders until a dedicated shader is created and then will use that moving forward. It is more resource intensive only on the initial creation of any particular shader. If you look at the graphs included in the article hybrid mode always outperforms dolphin with ubershaders disabled.

Exclusive mode is the mode people should be reasonable about. If you enable exclusive mode your performance is directly linked to the power of your video card. If you aren't running a GTX 1080 or 1080ti don't expect to be running 3x IR or higher in exclusive mode without performance problems.
 
It is not the first time I read serious complaints about NVIDIA shader speeds on OpenGL and Vulkan. And nobody but them can fix it because they are the shittiest when it comes to open source drivers.
 
It is not the first time I read serious complaints about NVIDIA shader speeds on OpenGL and Vulkan. And nobody but them can fix it because they are the shittiest when it comes to open source drivers.

This has nothing to do with open source drivers. These are closed source drivers that are shitty.
 
This has nothing to do with open source drivers. These are closed source drivers that are shitty.

It has to do with NVIDIA not open sourcing their drivers, nor helping the community develop open source alternatives. The opposite of what AMD and Intel are doing.
 
Top Bottom