What is shader compilation and why is it so prevalent now?

145 views

With the recent hubbub about The Calisto Protocol stuttering due to rampant “shader compilation”, I was recently reminded that other recent games (like Horizon Zero Dawn) were also known for shader compilation issues.

What is the game doing that makes it different from other games that just open and play without stutter or compilation?

I also don’t remember anyone making a fuss about this for titles 5 years ago.

In: 30

5 Answers

Anonymous 0 Comments

Your GPU isn’t just some fancy thing that makes pictures. It’s an wntire computer. A shader is a computer program designed to run on a specialized kind of computer, which has extra hardware that let’s it do certain matrix calculations faster than a regular general purpose computer.

Shader can be compiled at two different times. Before or during the time you want to draw an image. If you compile the shader, that is, convert the code into instruction the machine understands, ahead of time, then you don’t have to waste time doing that conversion whike you try to draw stuff.

Alternatively, you can wait until its time to run the program to compile it. This has the upside of being able to dynamically change what you want the program to do in order to be more efficient at the specific task it will be accomplishing.

So, there is an equilibrium point where being better able to plan and adjust for the current situation saves more time than is costs to do that adjustment.

Shader recompilation is an optimization technique used when an application thinks that by changing the program running on the GPU, it can make it run faster.

You are viewing 1 out of 5 answers, click here to view all answers.