Constant FLIP

Source
const FLIP: &str = r#"
void main() {
    vec2 uv = gl_FragCoord.xy / u_res;
    vec4 src = texture(tex, uv);
    vec2 f = vec2(p0 >= 0.5 ? 1.0 - uv.x : uv.x, p1 >= 0.5 ? 1.0 - uv.y : uv.y);
    vec4 res = texture(tex, f);
    float m = u_has_mask > 0.5 ? texture(u_mask, uv).r : 1.0;
    out_color = mix(src, res, m);
}
"#;
Expand description

p0 = horizontal, p1 = vertical (>= 0.5 = on).