mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-30 18:14:18 +01:00
15 lines
315 B
WebGPU Shading Language
15 lines
315 B
WebGPU Shading Language
fn splat() -> vec4<f32> {
|
|
let a: vec2<f32> = (((vec2<f32>(1.0) + vec2<f32>(2.0)) - vec2<f32>(3.0)) / vec2<f32>(4.0));
|
|
let b: vec4<i32> = (vec4<i32>(5) % vec4<i32>(2));
|
|
return (a.xyxy + vec4<f32>(b));
|
|
}
|
|
|
|
fn unary() -> i32 {
|
|
if (!(true)) {
|
|
return 1;
|
|
} else {
|
|
return ~(1);
|
|
}
|
|
}
|
|
|