fn is_boolean_producing(e: &Expr, ctx: &mut WalkCtx<'_>) -> boolExpand description
True when the top-level operator of e is one that produces a bool
value in WGSL (comparison, short-circuit boolean, or a swizzle over
one). We follow Swizzle so that (vec >= 0).xyz reaches this
function during a vec3 assignment and the bool-vec3 result still
gets the select(...) wrap.
The ctx argument lets us also catch the HLSL idiom of using a
bool-typed variable in arithmetic context (corpus shape:
bool mask = …; return !mask*domain + mask*refrac_uv;). HLSL
silently coerces those bool operands to 0.0 / 1.0; WGSL refuses
the multiplication outright, so the wrap has to apply at the
identifier level too.