ShaderCompiler::Emitter class

Emits the generated C++ header and the "--check" reflection dump.

Public static functions

static auto BuildTypesHeader() -> String
static auto EmitHeader(const std::vector<ProgramReflection>& programs, StringView ns, StringView inputFileName, const SpirvCompileFn& compileSpirv, String& output, Diagnostic& diag) -> bool
static auto BuildCheckDump(const ShaderDocument& document, const std::vector<VariantReflection>& variants) -> String

Function documentation

static String ShaderCompiler::Emitter::BuildTypesHeader()

Builds the standalone "ShaderCompilerTypes.h" header with the shared reflection types

static bool ShaderCompiler::Emitter::EmitHeader(const std::vector<ProgramReflection>& programs, StringView ns, StringView inputFileName, const SpirvCompileFn& compileSpirv, String& output, Diagnostic& diag)

Emits the complete generated header, returns false and fills diag on error. One input file yields one header, but it may carry multiple programs (a canvas_item document plus its "batched" twin) — all of them are emitted into the same namespace.

static String ShaderCompiler::Emitter::BuildCheckDump(const ShaderDocument& document, const std::vector<VariantReflection>& variants)

Builds the human-readable reflection dump printed by "--check" (called once per program)