What it does

Shader Compilation converts Shader code into programs for the target graphics API. The API, keyword combinations, and rendering paths affect how many programs must be generated.

Figure: Conceptual relationship: Shader source → Compile for an API → Executable programs
Figure: Conceptual relationship: Shader source → Compile for an API → Executable programs

How to use it

Separate Unity variant compilation from driver preparation on first use. Editor import waiting, build duration and runtime first-use stalls are different observations.

A concrete example

A pause only when a new keyword combination first appears differs from a shader that is expensive every frame. Variant management and supported warmup approaches may be relevant.

How to check it

  1. Compare build logs and first versus repeated Player use, recording stall timing.
    First error, references and target environment
    First error, references and target environment
  2. After reducing variants, verify required quality levels, devices and materials.
    First error, references and target environment
    First error, references and target environment

Limitations

Build-time compilation differs from first-use driver preparation.

References