Documentation
    Preparing search index...

    Type Alias ShaderNode

    ShaderNode:
        | { kind: "constant"; type: ShaderValueType; value: readonly number[] }
        | { kind: "uniform"; name: string; type: ShaderValueType }
        | { kind: "attribute"; name: ShaderAttributeName }
        | { kind: "texture"; name: string; uv: ShaderNodeId }
        | { kind: "time" }
        | {
            kind: "compose";
            parts: readonly ShaderNodeId[];
            type: ShaderValueType;
        }
        | { kind: "swizzle"; pattern: string; source: ShaderNodeId }
        | { kind: "unary"; op: ShaderUnaryOp; source: ShaderNodeId }
        | {
            kind: "binary";
            left: ShaderNodeId;
            op: ShaderBinaryOp;
            right: ShaderNodeId;
        }
        | { a: ShaderNodeId; b: ShaderNodeId; kind: "mix"; t: ShaderNodeId }

    One operator, as a closed discriminated union — closed for exactly the reason the module header gives. Every reference is a ShaderNodeId that must point at an earlier node (id < index), which is what makes every well-formed graph acyclic by construction and lets a backend emit it in one forward pass (§33).