• Login
  • Register
  • Dolphin Forums
  • Home
  • FAQ
  • Download
  • Wiki
  • Code


Dolphin, the GameCube and Wii emulator - Forums › Dolphin Emulator Discussion and Support › General Discussion v
« Previous 1 ... 61 62 63 64 65 ... 365 Next »

Option to force shader recompiling (Ubershaders)
View New Posts | View Today's Posts

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Thread Modes
Option to force shader recompiling (Ubershaders)
11-20-2017, 04:21 AM (This post was last modified: 11-20-2017, 04:37 AM by Themperror.)
#1
Themperror Offline
Junior Member
**
Posts: 8
Threads: 2
Joined: Jul 2016
Hello,

So while this option may seem a bit weird to have initially, let me explain.

I've been playing Metroid Prime 2: Echoes (NGC) the last week and it runs perfectly on my computer (except for the small laggspikes when moving out of water or opening a portal (refraction?)) but yesterday I encountered something weird when I started the game.. The main menu had a green overlay and when I loaded my save it looked like this:
[Image: Qt5V816.png]
[Image: STairp9.png]
[Image: GT9qNfE.png]

So that was weird.. As I'm a programmer myself I knew it had something to do with shaders or textures missing, then I remembered saying that driver updates, swapping GPU or anything like that might invalidate the shader cache used by the Ubershaders and they'd have to be compiled again.. Now let luck have it that the night before Windows decided to update. I believe it also updated my graphics drivers among other things.. So ok.. I'll need dolphin to recompile shaders for me..

No problem, let's see.. Dolphin directory.. Hmm where does Dolphin keep its compiled shaders.. Not here anywhere..
Ok perhaps it keeps it elsewhere, lets check %appdata% .. Not in the roaming folder, not in the local folder..., come on this is the spot where application data should be kept.. even temporary..
C:\ProgramData\ perhaps? Nope not here, Ok let's google quickly, saves are kept in My Documents, ok lets have a look there.

Ok My Documents it was, though a bit weird to keep all the other data in here too but sure.. Now to find the shaders..
"Documents\Dolphin Emulator\Cache\Shaders" That seems like it, now delete it all and Dolphin would have to force a shader recompile.

So I run the game.. No recompile? huh that's weird, booted up and same issue.. So I check the settings.. it IS set to Exclusive mode on Ubershaders. Well how do I get Dolphin to recompile my shaders ugh, Ok I know, I'll just switch rendering API (Vulkan -> D3D) and bam there it goes, compiling shaders, and we're all set now it works again..

So that was ehm a bit of a hassle to go through..

So my request, especially as Windows updates can happen frequently (and/or graphics drivers too)
Can we have a flag or a button that recompiles the shaders the next time a game is run? Because it seems it doesn't automatically detect it (or not in all cases atleast). Its little effort and helps a lot.
Find
Reply
11-20-2017, 04:56 AM
#2
JonnyH Offline
Shameless AMD shill
**********
Developers (Some Administrators and Super Moderators)
Posts: 701
Threads: 0
Joined: May 2017
Some GPU vendors (like Nvidia and AMD, though I believe the AMD one is opt-in on a per game basis so probably doesn't get enabled with Dolphin - not sure about Nvidia) have their own shader cache implemented in the driver. It's possible that you've successfully removed the dolphin-managed cached shaders, so dolphin is submitting them for a recompile, but the driver cache still has an old shader, and the driver cache is incorrectly returning that instead of actually recompiling the shader. You may need to clear this cache too.

That is all assuming it is actually a shader cache issue. Generally, there have been a number of issues with the drivers on windows update being older than the ones on the vendor website (nvidia.com) - it may be that the windows update actually *downgraded* your GPU driver - this happened to me when I got the latest fall creator update. Getting the latest version off the vendor website and installing that may help.
Find
Reply
11-20-2017, 05:07 PM
#3
mbc07 Offline
Wiki Caretaker
*******
Content Creators (Moderators)
Posts: 3,520
Threads: 46
Joined: Dec 2010
If you're running on an NVIDIA GPU and is using Dolphin's OpenGL backend, try clearing the contents of "C:\Users\<your username>\AppData\Local\NVIDIA\GLCache"...
Avell A70 MOB: Core i7-11800H, GeForce RTX 3060, 16 GB DDR4-3200, Windows 11 (Insider Preview)
ASRock Z97M OC Formula: Pentium G3258, GeForce GT 440, 16 GB DDR3-1600, Windows 10 (21H2)
Find
Reply
11-26-2017, 12:18 AM
#4
Themperror Offline
Junior Member
**
Posts: 8
Threads: 2
Joined: Jul 2016
(11-20-2017, 05:07 PM)mbc07 Wrote: If you're running on an NVIDIA GPU and is using Dolphin's OpenGL backend, try clearing the contents of "C:\Users\<your username>\AppData\Local\NVIDIA\GLCache"...


I was running Vulkan at that moment as the window title shows, I somehow managed to get it to recompile shaders by switching over to DirectX11 again and doing some stuff which I can't remember..

Anyhow a "Clear Shaders" button or something like that would make this a lot easier Tongue
Find
Reply
11-26-2017, 02:48 AM (This post was last modified: 11-26-2017, 02:48 AM by Helios.)
#5
Helios Offline
Stellaaaaaaa
**********
Developers (Some Administrators and Super Moderators)
Posts: 4,395
Threads: 15
Joined: May 2012
I'm not a fan of something like that for a couple of reasons.

1. If this is a bug, all we would be doing is making the bug go away and not fixing it proper

2. Since NVIDIA and AMD do global shader caches, this includes programs other than Dolphin. nvidia hashes the names so we can't be precise with what we purge, and would have to purge the entire cache. Dolphin has no business messing with the cache of other programs.
Find
Reply
11-30-2017, 06:30 AM
#6
Themperror Offline
Junior Member
**
Posts: 8
Threads: 2
Joined: Jul 2016
Hmm fair enough, any way I could help you find out if this is a bug or not? Need any specific system info for that?

The problem itself is already gone, so I doubt I could reproduce it without a windows update coming along every attempt.
Though perhaps it happens when a driver downgrade occurs? I'm not sure if that is what actually happened, but it's a scenario that could be tested. Like it potentially doesn't detect invalid shaders if the version its compiled with is higher than the current version (and only the other way around, I'm sure that's a bug I'd ever write ( I mean.. versions only go up right? Tongue)).
Find
Reply
12-01-2017, 07:33 PM
#7
Stenzek Offline
Junior Member
**
Posts: 17
Threads: 0
Joined: Nov 2016
Interesting that this happened in the Vulkan backend. We actually compare the UUID when loading the shader cache (see https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoBackends/Vulkan/ShaderCache.cpp#L563), I'm guessing the driver upgrade didn't change the UUID? Perhaps we should include the driver version as well, which would result in the cache being ignored on driver changes. Could do the same with OpenGL by comparing GL_VERSION.

Feel free to open a feature request issue about it.
Find
Reply
« Next Oldest | Next Newest »


  • View a Printable Version
  • Subscribe to this thread
Forum Jump:


Users browsing this thread: 1 Guest(s)



Powered By MyBB | Theme by Fragma

Linear Mode
Threaded Mode