Figure: Diagnostic workflow: Keyword combinations → Keep required variants → Verify build/runtime changes
Figure: Diagnostic workflow: Keyword combinations → Keep required variants → Verify build/runtime changes

Cause and mechanism

A shader variant is a program for one combination of enabled features, such as fog and shadows. More keywords can create more combinations and lengthen compilation. Use logs to distinguish slow progress, repeated compilation, and an unresponsive process; a long compile alone does not prove an infinite loop.

Check and correct the setup

  1. Inspect shader names, variant counts, progress, and resource use in logs.
    First error, references and target environment
    First error, references and target environment
  2. Use mutually exclusive keyword sets where appropriate and remove unused pipeline features.
    First error, references and target environment
    First error, references and target environment
  3. Retain runtime-selected variants when stripping via shader_feature or preprocessing. Manage required materials and build settings.
    First error, references and target environment
    First error, references and target environment

Limits and verification

Replacing all multi_compile declarations can strip required runtime variants. Test keyword changes in a target-API build.

A focused diagnostic setup

Choose one logged shader and inventory keyword sets/APIs. Four independent binary sets can yield sixteen combinations before other multipliers; this is an illustrative count.

Test in this order

  1. Distinguish progress in one compilation from repeated restarts.
    First error, references and target environment
    First error, references and target environment
  2. Make mutually exclusive states share sets and compare build logs.
    First error, references and target environment
    First error, references and target environment
  3. Retain required runtime combinations and exercise them in the target Player.
    First error, references and target environment
    First error, references and target environment

Interpret the result

Faster builds can break rendering if necessary variants disappear. Define required combinations rather than replacing every multi_compile. Runtime first-use preparation is a separate stage.

Related explanations

References