gfx/angle/src/libANGLE/renderer/d3d/d3d9/shaders/Blit.vs
author Morris Tseng <mtseng@mozilla.com>
Thu, 08 Sep 2016 16:28:30 +0800
changeset 354509 53735145cfbeede7164416318becd8e33dca53c9
parent 298486 56db457aef33a889004f51a6211f174aa12cca2d
child 400459 2fd9927e85ae56c93a8a453910d5e5acb89c6be9
permissions -rwxr-xr-x
Bug 1297924 - Update ANGLE to chromium/2845. r=jgilbert MozReview-Commit-ID: 2H0PBFFgmDp

//
// Copyright (c) 2012 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//

struct VS_OUTPUT
{
    float4 position : POSITION;
    float4 texcoord : TEXCOORD0;
};

uniform float4 halfPixelSize : c0;

// Standard Vertex Shader
// Input 0 is the homogenous position.
// Outputs the homogenous position as-is.
// Outputs a tex coord with (0,0) in the upper-left corner of the screen and (1,1) in the bottom right.
// C0.X must be negative half-pixel width, C0.Y must be half-pixel height. C0.ZW must be 0.
VS_OUTPUT standardvs(in float4 position : POSITION)
{
    VS_OUTPUT Out;

    Out.position = position + halfPixelSize;
    Out.texcoord = position * float4(0.5, -0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0);

    return Out;
};

// Flip Y Vertex Shader
// Input 0 is the homogenous position.
// Outputs the homogenous position as-is.
// Outputs a tex coord with (0,1) in the upper-left corner of the screen and (1,0) in the bottom right.
// C0.XY must be the half-pixel width and height. C0.ZW must be 0.
VS_OUTPUT flipyvs(in float4 position : POSITION)
{
    VS_OUTPUT Out;

    Out.position = position + halfPixelSize;
    Out.texcoord = position * float4(0.5, 0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0);

    return Out;
};