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

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/gfx/angle/src/libGLESv2/renderer/shaders/Blit.ps	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,39 @@
     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 +sampler2D tex : s0;
    1.11 +
    1.12 +uniform float4 mode : c0;
    1.13 +
    1.14 +// Passthrough Pixel Shader
    1.15 +// Outputs texture 0 sampled at texcoord 0.
    1.16 +float4 passthroughps(float4 texcoord : TEXCOORD0) : COLOR
    1.17 +{
    1.18 +	return tex2D(tex, texcoord.xy);
    1.19 +};
    1.20 +
    1.21 +// Luminance Conversion Pixel Shader
    1.22 +// Outputs sample(tex0, tc0).rrra.
    1.23 +// For LA output (pass A) set C0.X = 1, C0.Y = 0.
    1.24 +// For L output (A = 1) set C0.X = 0, C0.Y = 1.
    1.25 +float4 luminanceps(float4 texcoord : TEXCOORD0) : COLOR
    1.26 +{
    1.27 +	float4 tmp = tex2D(tex, texcoord.xy);
    1.28 +	tmp.w = tmp.w * mode.x + mode.y;
    1.29 +	return tmp.xxxw;
    1.30 +};
    1.31 +
    1.32 +// RGB/A Component Mask Pixel Shader
    1.33 +// Outputs sample(tex0, tc0) with options to force RGB = 0 and/or A = 1.
    1.34 +// To force RGB = 0, set C0.X = 0, otherwise C0.X = 1.
    1.35 +// To force A = 1, set C0.Z = 0, C0.W = 1, otherwise C0.Z = 1, C0.W = 0.
    1.36 +float4 componentmaskps(float4 texcoord : TEXCOORD0) : COLOR
    1.37 +{
    1.38 +	float4 tmp = tex2D(tex, texcoord.xy);
    1.39 +	tmp.xyz = tmp.xyz * mode.x;
    1.40 +	tmp.w = tmp.w * mode.z + mode.w;
    1.41 +	return tmp;
    1.42 +};

mercurial