Skip to content

start on a wesl-test cli #186

Description

@mighdoll

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Unprioritized

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions