1// 2// Copyright 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 7struct VS_OUTPUT 8{ 9 float4 position : POSITION; 10 float4 texcoord : TEXCOORD0; 11}; 12 13uniform float4 halfPixelSize : c0; 14uniform float4 texcoordOffset : c1; 15 16// Standard Vertex Shader 17// Input 0 is the homogenous position. 18// Outputs the homogenous position as-is. 19// Outputs a tex coord with (0,0) in the upper-left corner of the screen and (1,1) in the bottom right. 20// C0.X must be negative half-pixel width, C0.Y must be half-pixel height. C0.ZW must be 0. 21VS_OUTPUT standardvs(in float4 position : POSITION) 22{ 23 VS_OUTPUT Out; 24 25 Out.position = position + halfPixelSize; 26 Out.texcoord = ((position * float4(0.5, -0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0)) * float4(texcoordOffset.zw, 1.0, 1.0)) + float4(texcoordOffset.xy, 0, 0); 27 28 return Out; 29}; 30