Expand description
Pass: user-defined function call-site arg coercion.
FunctionsΒ§
- coerce_
arg π - Emit an edit on
argthat converts its inferred type toexpected. No-op when both types agree or either is unknown / non-scalar-vec. - coerce_
arg_ πknown - Variant that takes the already-known operand type. Use this when an
outer pass (binop_vec) has already type-walked the expression and may
have emitted truncation edits that change the effective type β the
stateless
infer_typedoesnβt see those edits and would over-coerce. - coerce_
user_ πfn_ args - Collect every top-level user-defined function in
src, then walk every call site to those names and coerce mismatched arg types. MD2 author sloppiness picked up here: passinglavcol(ret*2)whereret*2is vec3 butlavcol(float t)expects scalar (the EVET preset). HLSL silently truncated; WGSL refuses with InvalidCall. - walk_
block_ πfor_ user_ fn - walk_
expr_ πfor_ user_ fn - walk_
stmt_ πfor_ user_ fn