Table of Contents

API Reference

This reference is generated by DocFX from the XML doc-comments in the four plain net8.0 library projects that make up the compiler:

Assembly What lives here
ShadowDusk.Core The consumer contract and shared types: IShaderCompiler, CompilerOptions, CompiledShader, ShaderError, PlatformTarget, the Result<T, TError> discriminated union, the .mgfx writer, and the reflection / preprocessor families. Start here — this is the public API a consumer touches.
ShadowDusk.Compiler EffectCompiler — the product entry point, an IShaderCompiler that orchestrates the full pipeline.
ShadowDusk.HLSL The FX9 pre-parser, preprocessor, DXC integration, HLSL reflection, and the vkd3d-shader / d3dcompiler_47 DXBC backends. Mostly contributor-facing internals.
ShadowDusk.GLSL The SPIR-V → GLSL transpiler (ISpirvToGlslTranspiler / SpirvCrossGlslTranspiler) and the MonoGameGlslRewriter MojoShader-dialect rewrite.

What is not in this reference

  • ShadowDusk.Wasm (the in-browser WasmShaderCompiler) targets net8.0-browser and uses the Razor/Blazor SDK plus a dxcompiler.wasm build gate, which make Roslyn metadata extraction fragile in CI. It is documented conceptually in In-Browser (KNI/Blazor WASM) and WASM In-Browser Frontend.
  • ShadowDusk.Cli has no public API surface — mgfxc is a CLI contract, documented on the CLI Reference page.
  • ShadowDusk.ShaderToy is an optional, standalone front end (GLSL/ShaderToy → .fx), deliberately not part of the faithful mgfxc-replacement pipeline — ShadowDusk.Compiler does not depend on it — so it sits outside this compiler reference. Its single entry point is documented on Installation.
  • ShadowDusk.Metal (MslEmitter) is a stub ("future / not implemented") and is excluded from the reference. See Metal (future).
  • ShadowDusk.MgcbPlugin is a build-time MGCB plugin, not a compiler API: its public surface is the [ContentImporter]/[ContentProcessor] pair MGCB discovers by reflection, and the way you "call" it is the /reference: + /processor: lines in a .mgcb. It is documented on MGCB Content Pipeline rather than here.

Where to start

For the consumer story, read the In-Memory Quickstart first, then browse IShaderCompiler and EffectCompiler.