summaryrefslogtreecommitdiffstats
path: root/wgpu/src/shader/solid.wgsl
blob: 68a8fea3b8b762aab47b895b3f49a5d529a11bea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
struct Uniforms {
    transform: mat4x4<f32>,
    color: vec4<f32>
}

@group(0) @binding(0)
var<uniform> uniforms: Uniforms;

@vertex
fn vs_main(@location(0) input: vec2<f32>) -> @builtin(position) vec4<f32> {
    return uniforms.transform * vec4<f32>(input.xy, 0.0, 1.0);
}

@fragment
fn fs_main() -> @location(0) vec4<f32> {
    return uniforms.color;
}