summaryrefslogtreecommitdiff
path: root/Rend/demos/teapot/shaders/texture.slang
blob: 0210b668fb0f99380b82ce2f44a120ca4a17a025 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
struct VSInput {
    [[vk::location(0)]] float3 pos : POSITION;
    [[vk::location(1)]] float2 uv : TEXCOORD0;
    [[vk::location(2)]] float2 offset;
};

struct VSOutput {
    float4 pos : SV_Position;
    float2 uv;
};

[[vk::binding(0, 0)]] ConstantBuffer<float4x4> ubos[3];
[[vk::binding(1, 0)]] Sampler2D test[3];

[shader("vertex")]
VSOutput vertMain(VSInput input) {
    VSOutput output;
    output.pos = float4(input.pos, 1.0);
    output.pos.x -= input.offset.x;
    output.pos.y -= input.offset.y;
    output.uv = input.uv;
    return output;
}

[shader("fragment")]
float4 fragMain(VSOutput vertIn) : SV_TARGET {
    return test[0].Sample(vertIn.uv);
}