gfx/angle/src/libGLESv2/renderer/shaders/Blit.vs

branch
TOR_BUG_3246
changeset 6
8bccb770b82d
equal deleted inserted replaced
-1:000000000000 0:dff9a706b3d8
1 //
2 // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6
7 struct VS_OUTPUT
8 {
9 float4 position : POSITION;
10 float4 texcoord : TEXCOORD0;
11 };
12
13 uniform float4 halfPixelSize : c0;
14
15 // Standard Vertex Shader
16 // Input 0 is the homogenous position.
17 // Outputs the homogenous position as-is.
18 // Outputs a tex coord with (0,0) in the upper-left corner of the screen and (1,1) in the bottom right.
19 // C0.X must be negative half-pixel width, C0.Y must be half-pixel height. C0.ZW must be 0.
20 VS_OUTPUT standardvs(in float4 position : POSITION)
21 {
22 VS_OUTPUT Out;
23
24 Out.position = position + halfPixelSize;
25 Out.texcoord = position * float4(0.5, -0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0);
26
27 return Out;
28 };
29
30 // Flip Y Vertex Shader
31 // Input 0 is the homogenous position.
32 // Outputs the homogenous position as-is.
33 // Outputs a tex coord with (0,1) in the upper-left corner of the screen and (1,0) in the bottom right.
34 // C0.XY must be the half-pixel width and height. C0.ZW must be 0.
35 VS_OUTPUT flipyvs(in float4 position : POSITION)
36 {
37 VS_OUTPUT Out;
38
39 Out.position = position + halfPixelSize;
40 Out.texcoord = position * float4(0.5, 0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0);
41
42 return Out;
43 };

mercurial