wgpu/tests/in/standard.wgsl
2021-05-14 09:53:24 -04:00

10 lines
225 B
WebGPU Shading Language

// Standard functions.
[[stage(fragment)]]
fn derivatives([[builtin(position)]] foo: vec4<f32>) -> [[location(0)]] vec4<f32> {
let x = dpdx(foo);
let y = dpdy(foo);
let z = fwidth(foo);
return (x + y) * z;
}