ShaderCompiler::ConsoleFixedFunction class

Transpiles fixed_function blocks into C++ effect functions over the EffectContext contract.

Public static functions

static auto TranspileBlock(const FixedFunctionBlock& block, StringView define, FixedFunctionBackend backend) -> FixedFunctionResult
static auto BuildRuntimeSupport() -> String

Function documentation

static FixedFunctionResult ShaderCompiler::ConsoleFixedFunction::TranspileBlock(const FixedFunctionBlock& block, StringView define, FixedFunctionBackend backend)

Transpiles the captured block into the BODY of a void (EffectContext&) function — Main.cpp wraps it in a signature and provenance comment, sharing one function among all (program, variant) entries whose bodies came out byte-identical. define is the variant define baked into the block's preprocessing (empty for the base variant), so #ifdef <VARIANT> conditionals inside the block resolve per variant. The portable core emits identically for every backend (the PVR ignores tev, the GX approximates offset_color with its silhouette preset, the GU expands it into modulate + additive silhouette); the extended vocabulary and the per-hardware capabilities are gated on the block's own target LIST — blocks that name their backends only, and against the intersection of what those backends can do, so backend selects which aggregate header the body is destined for, never how strictly it is checked.

static String ShaderCompiler::ConsoleFixedFunction::BuildRuntimeSupport()

Returns the support code every generated aggregate header carries once, at 2-tab indent (backend namespace + anonymous namespace): a ff namespace with GLSL-style float vector types, the builtins of the expression subset and the pass-field store helpers. Emitted into the header (rather than shipped as an engine header) so the generated artifact stays self-contained — FixedFunctionPass.h remains the only runtime contract.