1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/gfx/angle/src/libGLESv2/renderer/shaders/Blit.vs Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,43 @@ 1.4 +// 1.5 +// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. 1.6 +// Use of this source code is governed by a BSD-style license that can be 1.7 +// found in the LICENSE file. 1.8 +// 1.9 + 1.10 +struct VS_OUTPUT 1.11 +{ 1.12 + float4 position : POSITION; 1.13 + float4 texcoord : TEXCOORD0; 1.14 +}; 1.15 + 1.16 +uniform float4 halfPixelSize : c0; 1.17 + 1.18 +// Standard Vertex Shader 1.19 +// Input 0 is the homogenous position. 1.20 +// Outputs the homogenous position as-is. 1.21 +// Outputs a tex coord with (0,0) in the upper-left corner of the screen and (1,1) in the bottom right. 1.22 +// C0.X must be negative half-pixel width, C0.Y must be half-pixel height. C0.ZW must be 0. 1.23 +VS_OUTPUT standardvs(in float4 position : POSITION) 1.24 +{ 1.25 + VS_OUTPUT Out; 1.26 + 1.27 + Out.position = position + halfPixelSize; 1.28 + Out.texcoord = position * float4(0.5, -0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0); 1.29 + 1.30 + return Out; 1.31 +}; 1.32 + 1.33 +// Flip Y Vertex Shader 1.34 +// Input 0 is the homogenous position. 1.35 +// Outputs the homogenous position as-is. 1.36 +// Outputs a tex coord with (0,1) in the upper-left corner of the screen and (1,0) in the bottom right. 1.37 +// C0.XY must be the half-pixel width and height. C0.ZW must be 0. 1.38 +VS_OUTPUT flipyvs(in float4 position : POSITION) 1.39 +{ 1.40 + VS_OUTPUT Out; 1.41 + 1.42 + Out.position = position + halfPixelSize; 1.43 + Out.texcoord = position * float4(0.5, 0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0); 1.44 + 1.45 + return Out; 1.46 +};