try_wrap_bool_arith_operand

Function try_wrap_bool_arith_operand 

Source
fn try_wrap_bool_arith_operand(e: &Expr, ctx: &mut WalkCtx<'_>)
Expand description

Emit a select(0.0, 1.0, (<expr>)) zero-length-insertion wrap around e if its top-level operator is a boolean producer. Mirrors try_wrap_bool_rhs but is called from arithmetic context, and also emits the vector-shape form select(vec3<f32>(0.0), vec3<f32>(1.0), (vec_cmp)) when the bool’s operands are vector-typed, since WGSL select(scalar, scalar, vecN<bool>) is invalid.