definition and how it affects game performance

The Boss

PC

definition and how it affects game performance

affects, definition, game, performance

GPUs are processors just like CPUs, but they are different in that their parallelism is thread-oriented. This is why a graphics processor is said to be of the TLP type while a central processor is of the ILP type. To this must be added that while the execution threads in the graph are not oriented towards the processes but towards the graphic primitives or the data.

In other words, each triangle, pixel or fragment has its own shader program for each stage of the 3D pipeline. Which is written in a high-level language, for example HLSL if we are talking about DirectX or GLSL if we are talking about OpenGL or Vulkan. Although there are also some that are exclusive to certain systems, such as the PSGL of SONY’s PlayStation consoles. Well, these programs need to be compiled and, therefore, passed from source code to binary.

What is Shader Cache?

Shader Cache CoD

The problem comes when, contrary to what happens with CPUs where they are all x86, in the case of GPUs, the set of registers and instructions is not common, not between brands, but also between architectures. the same brand. This means that the shader code has to be compiled as we play, which causes stuttering and performance issues. Therefore, the generated binary is stored in a file which, when the game is reloaded, will be reloaded on the video memory of the graphics card, which we know as shader cache or shader cache.

So if we update our graphics card, these will have to be generated again for each of our games, if we also delete it from the HDD or SSD. Besides, this is one of the reasons why it is not good to judge a graphics card when playing a game for the first time. Especially if we want to measure their regular performance.

VRAM also takes up space

Cache Shader NVIDIA Control Panel

Your graphics card’s GPU only accesses system RAM through the PCI Express interface and using its DMA unit, so the shader cache will be loaded with the visual information needed to compose the scene from the storage unit to RAM and RAM to Video Memory. Although with DirectStorage, it is expected that the graphics hardware can directly access the SSD, reducing access latency and the problem of having to depend on the CPU.

Many games are well developed and the shader cache takes up little space, but some not so much and it ends up taking up a lot of graphics memory. Which means that if the driver has an associated limit or the game itself, suddenly you find that new builds overwrite old ones and the original performance issues return.

In any case, it must be borne in mind that if the game we are playing requires space in the video RAM, it will prioritize the rendering of the current image. It will therefore seek to temporarily recover the shader cache stored in system memory. Also remember that the dumps to the storage unit are done continuously, since once the shader of a graphic primitive has been generated, it will no longer be necessary to redo it.

Ray Tracing and Shader Cache

In ray tracing the question most often asked by the GPU is of the Boolean type. Does this ray intersect this graph primitive? The answer is not always yes and therefore there is a condition that will or will not occur depending on the circumstances. Therefore, on the first run of this shader, it will be necessary to compile and generate the cache shader for all possible results.

Shader cache on consoles

Consoles XSX, XSS, PS5

A video game console will always have the same components, from the first model out of the factory to the last. Although several years have passed, its specifications will not change. For example, today you can find older models than the oldest graphics card. One way to take advantage of its hardware immutability is to use the so-called shaders already compiled into the game’s installation. This makes it unnecessary to generate a shader cache for each game, but it’s also a double sword sharp.

For example, if you want to create a more powerful and backward compatible console, you have the following options:

  • Export the ISA to the new system’s GPU, making it work as a superset of the old one. This is what AMD has done in the PlayStation 5 and Xbox Series with the RDNA 2 architecture to smoothly run previous generation games designed for GCN.
  • Integrate all graphics circuits from the previous system into the new system. This is something Nintendo has done on its consoles up to 3DS and SONY with its second PlayStation and some models of the third.

At the emulator level, what is done in many cases is to take the already compiled shaders and do the reverse process, generating intermediate code that can generate a generated Shader Cache to work with your graphics card. However, this is not an exact science and you may encounter certain graphical issues while running the games.

Optimizations for GPU manufacturers

Lovelace Hopper Organization

NVIDIA and AMD usually include optimizations in the latest drivers for the most advanced games. These not only include the optimal settings for higher performance, but also the shader cache already optimized for each game and better specs than the base game. And it is that both manufacturers are interested in their most advanced graphics card having the maximum possible performance in the most powerful game of all that exists today.

These therefore leave money for the various development studios, which optimize shader programs for certain graphics architectures and generate a shader cache that performs better than the one that comes with the base game. This is done to encourage the purchase of new models and create program obsolescence, which is necessary for there to be a consumer flow that sustains the industry. This is why many games with virtually no visual changes from their previous releases end up performing worse.

Leave a Comment