blob: b72db81bdc28f681a480158941fd78f0441236f6 (
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);
}
|