kwin-gles: save a branch in the main shader

On less flexible hardware, one instruction for one branch might not be a good
trade.

REVIEW: 102886
This commit is contained in:
Pierre-Loup A. Griffais 2011-10-16 00:41:40 -07:00 committed by Martin Gräßlin
parent 951904ba1a
commit 309ce4013a

View file

@ -10,9 +10,7 @@ varying vec2 varyingTexCoords;
void main() {
vec4 tex = texture2D(sampler, varyingTexCoords);
if (u_forceAlpha > 0) {
tex.a = 1.0;
}
tex.a += float(u_forceAlpha);
if( saturation != 1.0 ) {
vec3 desaturated = tex.rgb * vec3( 0.30, 0.59, 0.11 );