IT lexicon › Hardware › Shader variant

Shader variant

Hardware På svenska → Updated: 2026-10-25

One concrete compiled version of a shader, produced by fixing a particular combination of its compile-time keywords and features.

A shader written with conditional features doesn't compile to a single program; the toolchain emits one variant per enabled-keyword combination it might need (shadows on/off, fog on/off, instancing on/off). Each variant is a distinct GPU program the driver can bind.

The problem is multiplicative: a handful of independent on/off keywords yields hundreds or thousands of variants, each adding build time, disk size and runtime memory, and causing hitches when first compiled or loaded. Engines fight this with variant stripping (dropping combinations no material uses), shader caches and warming passes. The uber-shader authoring style is the usual source of the explosion.

← Back to the lexicon