What's the proper way to write includes for wgslFn WebGPU ? (0.156.1)

What’s the proper way to write includes for WebGPU?
The example below doesn’t work. It gives the error:
Uncaught (in promise) TypeError: include.build is not a function

const test = wgslFn( `

fn test( color:vec3<f32> ) -> vec3<f32> {

return color / .5;

}

`);

const desaturateWGSLNode = wgslFn( `

fn desaturate( color:vec3<f32> ) -> vec3<f32> {

let lum = vec3<f32>( 0.299, 0.587, 0.114 );

return test(lum+color);

}

`,[test]);

Hi @michealmyers81.

This was a bug, it is fixed here.

1 Like