From 309ce4013a3e302ce8502969a921b28c73835c2c Mon Sep 17 00:00:00 2001 From: "Pierre-Loup A. Griffais" Date: Sun, 16 Oct 2011 00:41:40 -0700 Subject: [PATCH] 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 --- scene-fragment.glsl | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/scene-fragment.glsl b/scene-fragment.glsl index da4b31a25a..22463c16c2 100644 --- a/scene-fragment.glsl +++ b/scene-fragment.glsl @@ -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 );