4 ms·
Linux has the same issue in principle, the problem is that shaders must be compiled anew for each driver version, at runtime. It is impractical for the develope
by incrudible 4y ago
Linux has the same issue in principle, the problem is that shaders must be compiled anew for each driver version, at runtime. It is impractical for the developer, but a distributor like Steam can actually track and redistribute caches for most combinations of drivers and GPUs in active use. Also, warming up the cache (not just precompiling) is possible.
- Aardwolf 4y agoSteam is always compiling shaders before starting a game. What is this needed for actually, can't these come precompiled with the game, just like the game's executable? There are 3 brands of GPU so max 3 precompiled versions needed? Is that naive to assume this? CPU's need only one version mostly between AMD and Intel (or at most a few for different SIMD instructions)
- ThatPlayer 4y agoUnlike low level SIMD instructions, GPUs work on higher level APIs: Vulkan, DirectX, OpenGL. How that gets interpreted by the GPU changes with driver updates. That's how Intel Arc GPU performance started off in a somewhat bad state yet are steadily improving. Changes in interpretation also mean changes in shaders, so you can't just take shaders on one version of a driver and use it on another. Internal pipelines can vary between GPU architecture too. Currently AMD ships a different branch of their own Windows drivers for the new RDNA3 architecture GPUs (RX 7000 series). So precompiled shaders probably work won't between architectures.
- Aardwolf 4y agoBut why do they change this per driver update? That sounds horrible to do! CPU's are not changing their instructions based on driver updates either. IMHO, time for CPU's to offer thousands-of-floats-wide SIMD instruction sets instead of the measily 512 bits, that can do the same as GPU's but are way more stable, and get rid of those annoying, version-of-driver-dependent, install-100-python-libraries-to-use-them GPU's.
- incrudible 4y agoPerformance. Vendors will literally go in and hack the shaders for major titles. Also, drivers have bugs. GPUs will never be outperformed by a CPU with wider SIMD. Intel learned that the hard way with Larrabee. They are on a different place on the pareto front.
- Aardwolf 4y agoPerformance at the cost of stutter. So not really performance... When did compiling of shaders become a thing? Nvidia GeForce had shaders in the year 2001 but I don't remember ever seeing this then. The first time I saw compiling of shaders happen was in 2017 in a console emulator I think. So how did it work before then, and what exactly has this compiling now improved compared to before?
- incrudible 4y agoIt only stutters the first time the shader is used, but modern games use a lot of shaders and they are more complex. In modern APIs it is not just shaders but a combination of shaders and state.
- incrudible 4y agoThey can be precompiled, but not to the point where there is no stutter, because some optimizations only happen at the point where the shader is executed. That is why you need a warmup. You need to actually execute the shader. Theoretically with Vk/D3D12 you can cache and ship the entire state, but again, it is a combinatorial explosion of drivers and devices.