summaryrefslogtreecommitdiff
path: root/common/shaders/render/fullscreen_vs.wgsl
blob: a68604bf171b8918c683b3f66a38517b05394930 (plain)
1
2
3
4
5
6
7
8
9
10
// Common vertex shader for fullscreen post-processing effects.
// Draws a single triangle that covers the entire screen.
@vertex fn vs_main(@builtin(vertex_index) i: u32) -> @builtin(position) vec4<f32> {
    var pos = array<vec2<f32>, 3>(
        vec2<f32>(-1, -1),
        vec2<f32>(3, -1),
        vec2<f32>(-1, 3)
    );
    return vec4<f32>(pos[i], 0.0, 1.0);
}