r/GlobalOffensive • u/wazernet • 16h ago
Discussion CS2 has over 147,000 shader variants compared to Deadlock's 14,572. Both use Source 2. Is this really necessary?
I've been looking into CS2's shader compilation after using SCSKiller to precompile the game's shaders on my RTX 5080.
What caught my attention was the ridiculous number of shaders the game contains. It took roughly an hour to compile everything, which made me question what exactly is going on with Source 2.
I started digging and found an interesting investigation on SCSKiller's GitHub comparing CS2 and Deadlock.
Both games use Valve's Source 2 engine, yet the difference is massive.
Shader analysis from October 2026:
| Shader type | CS2 | Deadlock |
|---|---|---|
| Pixel shaders | ~139,000 | ~10,000 |
| Vertex shaders | ~6,200 | ~2,800 |
| Compute shaders | ~1,500 | ~1,400 |
| Geometry shaders | 25 | 21 |
| Total indexed shaders | 147,193 | 14,572 |
| VFX programs | 251 | 211 |
That's over 10 times as many shader variants in CS2, while the number of VFX programs is only around 19% higher.
Now, I'm fully aware that having 147,000 shader variants doesn't mean they're all running simultaneously or that every single one affects performance. Many are different permutations of the same shaders, depending on rendering conditions and configurations.
But that's exactly why I'm questioning this.
CS2 isn't some massive open-world game with thousands of environments, complex weather systems and constantly changing lighting conditions. It's a competitive shooter with relatively small maps and a fairly predictable set of visual effects.
So why does it need this many shader permutations?
More importantly, how efficiently is Source 2 managing them?
Shader compilation can cause frametime spikes, and cache misses or unnecessary shader creation can introduce additional CPU overhead. These things matter in a competitive game where players are chasing consistent frametimes, high 1% lows and minimal input latency.
I'm not saying the 147,000 shaders are directly responsible for CS2's performance problems. There's no evidence proving that without profiling the engine.
However, I do think the numbers deserve some attention, especially considering how much CS2's performance and frametime consistency have been discussed.
I'd genuinely like to know:
- How many of these shader variants are actually used during a normal competitive match?
- Are there thousands of redundant or unused permutations included in the game?
- Does Source 2 still compile shaders during active gameplay, potentially causing frametime spikes?
- How effectively does CS2 reuse compiled shaders between sessions?
- Could reducing shader permutations and improving cache management help performance, particularly 1% and 0.1% lows?
I also find it interesting that Deadlock, another Source 2 game with considerably more varied characters and abilities, has roughly one-tenth the indexed shader count in this analysis.
Of course, different rendering systems and shader implementations could explain some of that difference. The comparison alone doesn't prove anything is wrong.
The figures are from an October 2026 analysis, so the exact numbers may have changed with subsequent updates.
Still, spending an hour compiling shaders for a competitive shooter seems excessive, and I'd love to see Valve explain whether this is expected behavior or something that could be optimized further.
Maybe someone with deeper knowledge of Source 2's rendering pipeline can shed some light on this.
Sources:
SCSKiller Source 2 investigation (CS2 vs. Deadlock)
I'm not looking for another placebo FPS tweak. I'd rather understand what's actually happening inside the engine and whether there's room for meaningful improvements.
