wesl-test foo.wesl seems handy for users, and potentially for IDE integration.
If foo.wesl contains:
import lygia::math::saturate::saturate;
@compute @workgroup_size(1)
fn foo() { test::results[0] = saturate(1.5); }
the cli could run the test and print the result:
> wesl-test foo.wesl
[1.0]
If foo.wesl contains:
// @toy
@group(0) @binding(0) var<uniform> uniforms: test::Uniforms;
@fragment
fn fs_main(@builtin(position) pos: vec4f) -> @location(0) vec4f {
let st = pos.xy / uniforms.resolution;
let color = lygia::generative::snoise::snoise2(...);
return vec4f(color, 1.0);
}
the cli could run the test and record the image:
> wesl-test foo.wesl -o image.png
created image.png (48Kb)
wesl-test foo.weslseems handy for users, and potentially for IDE integration.If
foo.weslcontains:the cli could run the test and print the result:
> wesl-test foo.wesl [1.0]If
foo.weslcontains:the cli could run the test and record the image: