mirror of
https://github.com/gfx-rs/wgpu.git
synced 2024-12-11 16:14:44 +00:00
10 lines
225 B
WebGPU Shading Language
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;
|
|
}
|