Odin bindings for the wesl-rs compiler (based on wesl-c).
Usage examples (ported from wesl-c)
This is best used with the vendor:wgpu package. WESL allows you to to do cool stuff like imports in WGSL shaders:
import package::colors::chartreuse; // 1. modularize shaders in separate files
import random_wgsl::pcg_2u_3f; // 2. use shader libraries from npm/cargo
fn random_color(uv: vec2u) -> vec3f {
var color = pcg_2u_3f(uv);
@if(DEBUG) color = chartreuse; // 3. set conditions at runtime or build time
return color;
}