aboutsummaryrefslogtreecommitdiff
path: root/assets/shaders/textured_quad.slang
blob: 9ff81fddb0438a55345ff387b43df51429f789e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// full-screen textured quad: samples one 2D texture straight to the target.
// used to blit an off-screen colour buffer to the swapchain.

struct VSInput  { float2 position : POSITION; float2 texCoord : TEXCOORD0; };
struct VSOutput { float4 position : SV_Position; float2 texCoord : TEXCOORD0; };

[shader("vertex")]
VSOutput vertexMain(VSInput input)
{
    VSOutput output;
    output.position = float4(input.position, 0.0, 1.0);
    output.texCoord = input.texCoord;
    return output;
}

Sampler2D u_ScreenTexture;

[shader("fragment")]
float4 fragmentMain(VSOutput input) : SV_Target
{
    return u_ScreenTexture.Sample(input.texCoord);
}