ShaderCompiler::FixedFunctionResult struct

Outcome of transpiling one fixed_function block variant to C++.

Public variables

bool Ok
true when the block fits the grammar and Body was emitted
String Error
Error message (only meaningful when Ok is false).
std::int32_t Line
1-based input line of the error (0 when unknown)
String Body
The emitted function BODY (prologue + statements at 3-tab indent, no signature), empty when Intrinsic is set.
String Intrinsic
FixedFunctionIntrinsic member name declared by a pipeline <name>; block, or empty
bool UsesOffsetColor
Whether any reachable p.offset_color = ... assignment exists in the emitted function.
FixedFunctionRequirements Requirements
Which optional EffectContext facilities the emitted body calls.

Variable documentation

String ShaderCompiler::FixedFunctionResult::Body

The emitted function BODY (prologue + statements at 3-tab indent, no signature), empty when Intrinsic is set.

Deliberately name-free: two (program, variant) blocks that transpile to the same passes produce byte-identical bodies (batched twins, palette variants whose difference lives in the dispatch loop), which is what lets Main.cpp deduplicate them — one emitted function, named after its first occurrence, shared by every matching table row.

String ShaderCompiler::FixedFunctionResult::Intrinsic

FixedFunctionIntrinsic member name declared by a pipeline <name>; block, or empty

A block whose sole statement is pipeline <name>; transpiles to no function at all: the program binds itself to a backend pipeline stage that consumes engine data structures (tile-layer meshes, line strips, the lighting hook). The table entry then carries the enum value instead of a function pointer, so even these stages are named in the shader file rather than matched by label in a backend.

bool ShaderCompiler::FixedFunctionResult::UsesOffsetColor

Whether any reachable p.offset_color = ... assignment exists in the emitted function.

Computed statically per (program, variant) - the variant's preprocessing has already been applied - and written into the generated table entry, because the PVR needs it when compiling the base polygon header (specular enable is per program, not per pass).

FixedFunctionRequirements ShaderCompiler::FixedFunctionResult::Requirements

Which optional EffectContext facilities the emitted body calls.

Computed statically during emission (a bit is set exactly when the corresponding builtin family was transpiled) and written into the generated table entry, so the backends can skip the per-draw context setup for facilities the effect can never touch.