Vixen
02b45cc4
csharp
public class ShaderBindingsGenerator

Turns Raven's .reflect.json files into typed C# keys and constant-buffer writers.

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

Remarks

Add a shader's reflection to a project as an AdditionalFiles item and its bindings appear in Vixen.Shaders.Generated. The reflection is produced by raven compile --emit-reflection, which the content build runs anyway — so the generator adds no step, only a consumer for a file that already exists.

Why an analyzer rather than a build task. The generated code has to be visible to the code that uses it, in the same compilation, with rename and go-to-definition working in the editor before anything is built. A task writing .cs into obj/ gets there eventually and gets there wrong for the first build after a shader changes.

Methods (1)

  • public void Initialize(IncrementalGeneratorInitializationContext context)

    Called to initialize the generator and register generation steps via callbacks on the