Shader Compilation on PC: About to become a bigger bottleneck?

So I mean okay there is a "surprise!" after a 100 frames - driver did its job and everything is running 20%-100% faster now.

For a graphics programmer this means that their code is shit. Right? Because the driver managed to produce a better code out of a 100 submitted frames than the programmer made after several years of working on the project. Tough luck, you suck, get better, etc.

For a user it means that the code is running optimized after ONE SECOND of it being ran.

Now why is this bad? For a programmer who now know that their code is... not good... this is obviously not a pleasant thing. For a user though? Would a user be better if served a code which runs worse just so that programmer in question would feel good knowing that this is exactly the performance they'd get out of their code?

We had several games launched in such a state on new APIs, and users were not happy. They were calling these programmers names and such. So maybe the idea here is completely wrong and it would actually be better to allow the h/w to optimise after the programmer because that would actually help the programmers too?

Just a thought.
 
So I mean okay there is a "surprise!" after a 100 frames - driver did its job and everything is running 20%-100% faster now.

There's a lot of details and context left out of that 211 character tweet, which is understandable because it's just a tweet.

Is this simply the drivers compiling the shaders or is this the driver doing shader replacements? Or is it a genuine optimization pass and adjustment? If it's compiling it, isn't that the job of the drivers and can't be done by the developers? -- I mean other than the game having a pre-loading screen itself and loading up everything that would be used then, which is now part of the "precompiling shaders" step.
 
There's a lot of details and context left out of that 211 character tweet, which is understandable because it's just a tweet.

Is this simply the drivers compiling the shaders or is this the driver doing shader replacements? Or is it a genuine optimization pass and adjustment? If it's compiling it, isn't that the job of the drivers and can't be done by the developers? -- I mean other than the game having a pre-loading screen itself and loading up everything that would be used then, which is now part of the "precompiling shaders" step.
Does all of this matter?

The selling point of going with full programmer control was "games stutter because driver is doing something we don't know what".

Well guess what...
 
Does all of this matter?

No. I was merely curious what was actually going on. None of these discussions matter cause it's just games.

The selling point of going with full programmer control was "games stutter because driver is doing something we don't know what".

Well guess what...

Obviously the developers don't have total and full control because the drivers are still doing things. We obviously need to give developers even more control than what they have now. 🤣
 
No. I was merely curious what was actually going on. None of these discussions matter cause it's just games.
We are on a forum about real time 3D... Or you want to discuss how D3D12 issues matter in an Israeli Palestinian conflict? Not very much I think.

Obviously the developers don't have total and full control because the drivers are still doing things. We obviously need to give developers even more control than what they have now. 🤣
Or maybe the basis is wrong and instead of fulfilling developers dreams we should start thinking about the users first? That's my point.
 
The one you cut off with an abrupt "Does all of this matter?"
Well does it? You could ask if this driver intervention would affect different stages of frame rendering or produce something else instead of stuttering - what does it matter if the driver optimized code still ends up being better for the user than whatever the programmer has managed to conjure?

This is the topic of the thread after all.
 
Well does it? You could ask if this driver intervention would affect different stages of frame rendering or produce something else instead of stuttering - what does it matter if the driver optimized code still ends up being better for the user than whatever the programmer has managed to conjure?

This is the topic of the thread after all.
How do you know the code is not good.... if you don't know what the driver did in those 100 frames? If it's compilation.. that's literally the job of the driver.

It's a question worth asking.

If the code is better (which it would naturally be optimized for the specific hardware) then that's great... but it doesn't mean things are behaving how the developer intends.
 
Well does it? You could ask if this driver intervention would affect different stages of frame rendering or produce something else instead of stuttering - what does it matter if the driver optimized code still ends up being better for the user than whatever the programmer has managed to conjure?

This is the topic of the thread after all.

I think it does, but I don't have enough context and thus do not know, which is exactly why I asked the question. Let me rephrase it another way that maybe you will understand and see what I was trying to expand on.

Would the things the driver was doing in those first 100 frames still be there and still happen with all the recently proposed full-scale replacement paradigms?

I am not passing judgments on what it's doing as being good or bad.
 
Is this simply the drivers compiling the shaders or is this the driver doing shader replacements? Or is it a genuine optimization pass and adjustment? If it's compiling it, isn't that the job of the drivers and can't be done by the developers?

It’s not just compilation but also tweaking of device configs based on runtime heuristics. As far as I know this isn’t common on CPUs but Nvidia seems to be a fan of the idea.

Presumably the first 100 runs are compiled and executed with some default config and then the recompile runs based on heuristics captured doing those 100 runs. If it was something static like shader replacement you wouldn’t need to wait for those 100 runs.

Opinions are clearly divided on this but why are some graphics developers so obsessed with explicit control over things that they can never control unless they start writing GPU assembly? I get why DX11 can be limiting with the high level of synchronization and babysitting required in the driver. With DX12 and Vulkan developers have far more explicit control of memory allocation and locks. Why is it a problem that the hardware and driver does further optimization? Seems to be driven by ego more than any practical reason.
 
So what I’m understanding now is different architectures favoured having different features/state included in pipelines, so the pipeline ended up including everything. The mobile companies had unique requirements from AMD and Nvidia, who had different requirements from each other. I haven’t gone back to look at Mantle but I’d guess it’s version of a pipeline is much simpler.

Now this post is suggesting that ESO extension is not just GL hammered into Vulkan, but I guess we’ll see. There was a post I read about how the GPL extension didn’t full address issues but I can’t find it.

 
I only understand one thing now, I'm done with this PSO cashing mechanism, I'm done with this crap, it's getting tiresome and it's getting old pretty fast.

In the age of constant driver updates for maximum performance and features and in the age of constant game updates to fix performance issues, bugs and crashes, I can't stand to have the entirety of my recent library of games do shader compilation every couple of weeks, every recent freaking game on my PC now do this. I have to wait for half an hour or more to complete this every time I want to play. It's getting really really tiresome and it needs to stop.

You launch COD MW2 or Warzone 2, and you get a shader compillation step, Fortnite is constantly compiling shader in the background and introducing stutter because the game receives multiple updates every two weeks, The Last of Us, shader compilation every update, Uncharted 4 compile shader every driver update, Warhammer Darktide, Hogwarts Legacy and many many more. Every driver update and every game patch incurs a shader compilation step across a wide range of games, my gaming life in the last three months has been nothing but a long wait for shaders to compile, this needs to stop NOW, this isn't a user friendly experience. Whoever thought that this is the way PC games should be played and experienced is a moron, this is absolute torture.

You press play, then wait for the game to launch (through all the stupid splash screens) then to compile shaders then to load the level, literally anywhere from 15 to 60 minutes (depending on the game) are wasted waiting for this crap, and it gets longer and longer for people with low/medium end CPUs.

This crap needs to stop stats. Because I am quite literally done playing any game with this shader bullshit, and I am also done playing anygame with constant stutters, and I know many more people that are fed up with this as well, those genius developers need to come up with reasonable solutions pretty fast, because this crap can't continue forever.

rant over.
 
Honestly none of the games I play have really been that bad. Even fortnite, I'll get stutters when the game first loads and everbody is waiting in the lobby, but generally it becomes a non-issue once the bus takes off and everyone is dropping into parts of the map.
 
I only understand one thing now, I'm done with this PSO cashing mechanism, I'm done with this crap, it's getting tiresome and it's getting old pretty fast.

In the age of constant driver updates for maximum performance and features and in the age of constant game updates to fix performance issues, bugs and crashes, I can't stand to have the entirety of my recent library of games do shader compilation every couple of weeks, every recent freaking game on my PC now do this. I have to wait for half an hour or more to complete this every time I want to play. It's getting really really tiresome and it needs to stop.

You launch COD MW2 or Warzone 2, and you get a shader compillation step, Fortnite is constantly compiling shader in the background and introducing stutter because the game receives multiple updates every two weeks, The Last of Us, shader compilation every update, Uncharted 4 compile shader every driver update, Warhammer Darktide, Hogwarts Legacy and many many more. Every driver update and every game patch incurs a shader compilation step across a wide range of games, my gaming life in the last three months has been nothing but a long wait for shaders to compile, this needs to stop NOW, this isn't a user friendly experience. Whoever thought that this is the way PC games should be played and experienced is a moron, this is absolute torture.

You press play, then wait for the game to launch (through all the stupid splash screens) then to compile shaders then to load the level, literally anywhere from 15 to 60 minutes (depending on the game) are wasted waiting for this crap, and it gets longer and longer for people with low/medium end CPUs.

This crap needs to stop stats. Because I am quite literally done playing any game with this shader bullshit, and I am also done playing anygame with constant stutters, and I know many more people that are fed up with this as well, those genius developers need to come up with reasonable solutions pretty fast, because this crap can't continue forever.

rant over.
Just give up and switch to consoles.. it will never be as simple as you want it to be on PC.

I think you're overexaggerating in many ways.. but definitely right on the money with others. Yes, it's a pain in the butt when a game is constantly being updated, and it has a long shader compilation step.. But this isn't going to stop.. this is going to become far more common.. and it absolutely should. Games like Uncharted, and TLOU P1 are outliers with how long their shader compilations take, because those games were developed specifically for consoles without ever being considered for PC. So in those cases it's understandable. Most games like COD, Hogwarts, and Warhammer, it's really not that long to wait. I realize not everyone has a high end CPU though, and it does suck for those people. You're definitely not overexaggerating how awful it is to deal with constant stuttering like you do in Fortnite and some other games.

This is going to be a fact of life for PC gaming... and now the more and more developers are doing this step because it's far preferrable to the constant stuttering these games would have otherwise.. literally making them unplayable. I mean developers pre-compile shaders for consoles for a reason..

Now that more and more developers are doing this pre-compilation step, what we need to do is figure out a way to augment it so there's less friction for the user. Things like Valve's Fossilize, where the files required to compile the shaders are downloaded first, and compile in the background as the game itself downloads would be awesome. I think if these "shader compilation" steps were done right after the game downloaded or updated, for example, the game downloads and once it finishes it automatically kicks off the game and compiles the shaders in the background (essentially like "decrypting" the files) and then closes once they're done. Then once you load it up, you can just play right away.

I think a lot of it is the mentality that something should be ready when you launch it. Nobody likes launching a game and then having to wait.. but I think people would be more understanding if the game itself automatically kicked off after being downloaded, did the shader compile, and then closed... being ready for you when you open it the first time, or after updates. I think that would go over much better with gamers.

But good rant. It's completely understandable that people are getting fed up with this, and honestly the industry should have been focusing more on this for a long time already. But I think we'll get there in the end.
 
Last edited:
I just dont update my drivers that often. I also usually wait to play the latest games (not necessarily deliberately, just because I always have a massive backlog of older games) so the initial patching frenzy is over.

I've no problem at all with an initial shader compile. I just see it as part of the download/install wait. I do agree repeated compiles after that are ennoying though which is why I avoid driver updates unless I'm starting a new game that isn't optimised in my driver. But in that instance I generally update the driver before installing the game.
 
Back
Top