michael@0: // michael@0: // Copyright (c) 2012 The ANGLE Project Authors. All rights reserved. michael@0: // Use of this source code is governed by a BSD-style license that can be michael@0: // found in the LICENSE file. michael@0: // michael@0: michael@0: struct VS_OUTPUT michael@0: { michael@0: float4 position : POSITION; michael@0: float4 texcoord : TEXCOORD0; michael@0: }; michael@0: michael@0: uniform float4 halfPixelSize : c0; michael@0: michael@0: // Standard Vertex Shader michael@0: // Input 0 is the homogenous position. michael@0: // Outputs the homogenous position as-is. michael@0: // Outputs a tex coord with (0,0) in the upper-left corner of the screen and (1,1) in the bottom right. michael@0: // C0.X must be negative half-pixel width, C0.Y must be half-pixel height. C0.ZW must be 0. michael@0: VS_OUTPUT standardvs(in float4 position : POSITION) michael@0: { michael@0: VS_OUTPUT Out; michael@0: michael@0: Out.position = position + halfPixelSize; michael@0: Out.texcoord = position * float4(0.5, -0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0); michael@0: michael@0: return Out; michael@0: }; michael@0: michael@0: // Flip Y Vertex Shader michael@0: // Input 0 is the homogenous position. michael@0: // Outputs the homogenous position as-is. michael@0: // Outputs a tex coord with (0,1) in the upper-left corner of the screen and (1,0) in the bottom right. michael@0: // C0.XY must be the half-pixel width and height. C0.ZW must be 0. michael@0: VS_OUTPUT flipyvs(in float4 position : POSITION) michael@0: { michael@0: VS_OUTPUT Out; michael@0: michael@0: Out.position = position + halfPixelSize; michael@0: Out.texcoord = position * float4(0.5, 0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0); michael@0: michael@0: return Out; michael@0: };