Skip to main content

binary_wgsl

Function binary_wgsl 

Source
pub fn binary_wgsl(op: &str) -> String
Expand description

Generate WGSL source for an element-wise binary operation.

The shader reads n elements from two input buffers (lhs and rhs), applies the operation, and writes the results to output.

§Arguments

  • op — one of: "add", "sub", "mul", "div", "max", "min", "pow". Unknown ops fall back to identity on lhs.