Vixen
02b45cc4
csharp
public record class PermutationClosureResult

What enumerating a shader's variants produced.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

is a warning, and worth reading. A key is in an EffectKey only if the shader read it, and the engine decides which keys those are from the reflection checked in beside the shader — one reflection, from one variant. That works when reading a key does not depend on the others, which is the ordinary case: a flag tested at the top of the function is read whatever the rest are.

When it is not the ordinary case — if (Outer) { if (Inner) … } — this finds more variants than a draw can ask for, because the generated key list was built from a compilation that never reached Inner. Baking them is not wrong, but the extra ones will not be resolved by anything, and the shader wants restructuring so that the inner flag is read unconditionally.

Fields and properties (4)

  • public ImmutableArray<EffectData> Effects

    The distinct variants, in key order.

  • public int Compilations

    How many compilations it took, including the ones that turned out to be duplicates.

  • public ImmutableArray<string> Used

    The permutation keys that turned out to matter, by their declared names.

  • public bool Dependent

    Whether which keys matter depends on what the other keys are set to.

Methods (1)

  • public PermutationClosureResult(ImmutableArray<EffectData> Effects, int Compilations, ImmutableArray<string> Used, bool Dependent = false)

    What enumerating a shader's variants produced.

Used by (4)

  • EffectBundleBuilderVixen.ShaderCompiler
  • EffectCompilerTestsVixen.ShaderCompiler.Tests
  • PermutationClosureVixen.ShaderCompiler
  • ZeroRuntimeCompilationTestsVixen.ShaderCompiler.Tests