Transpiling
vec4 lerp(vec4 a, vec4 b, float t) {
return t * b + (1. - t) * a;
}
gives
function lerp (a, b, t) {
a = a.slice();
b = b.slice();
return [t * b[0] + (1. - t) * a[0], t * b[1] + (1. - t) * a[1], t * b[2] + (1. - t) * a[2], t * b[3] + (1. - t) * a[3]];
}
which has redundant slicing: slower performance, longer output. Probably we should guard mutation only in case of out qualifiers.
@Pessimistress what do you think?