aboutsummaryrefslogtreecommitdiff
path: root/src/shaders/shader.slang
blob: 37041c65a9c6182b0381b6804ed1294ae6f075c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
struct VertexInput {
    float2 pos;
    float3 col;
};

struct VertexOutput {
    float4 pos : SV_Position;
    float3 col;
};

[shader("vertex")]
VertexOutput vert_main(VertexInput vi) {
    VertexOutput vo;
    vo.pos = float4(vi.pos, 0., 1.);
    vo.col = vi.col;
    return vo;
}

[shader("fragment")]
float4 frag_main(VertexOutput vo) : SV_Target {
    return float4(vo.col, 1.);
}