summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErkin Bahceci <erkinbah@gmail.com>2007-05-12 15:47:45 -0500
committerErkin Bahceci <erkinbah@gmail.com>2007-05-12 15:47:45 -0500
commitcc0e0c4e1c788ce19bf42fbea9c629e5e80e10c4 (patch)
treeb0434bed17f251211af6da14b3a1b205ba4a4e1b
parentf201c08c4308a53da87461610d55975edcec9081 (diff)
downloadberyl-premerge-cc0e0c4e1c788ce19bf42fbea9c629e5e80e10c4.tar.gz
beryl-premerge-cc0e0c4e1c788ce19bf42fbea9c629e5e80e10c4.tar.bz2
neg: Speed up by using one less fragment op when a window has alpha channel
(transparent terminals, etc.). Uses negation, which is free. For reference, look here: http://lawlor.cs.uaf.edu/~olawlor/ref/gl/glfp/
-rw-r--r--src/neg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/neg.c b/src/neg.c
index 57edc90..0b35d55 100644
--- a/src/neg.c
+++ b/src/neg.c
@@ -171,9 +171,10 @@ getNegFragmentFunction (CompScreen *s, CompTexture *texture, Bool alpha)
if (alpha)
{
ok &= addDataOpToFunctionData (data, "RCP neg.a, output.a;");
- ok &= addDataOpToFunctionData (data, "MUL output.rgb, neg.a, output;");
+ ok &= addDataOpToFunctionData (data, "MAD output.rgb, -neg.a, output, 1.0;");
}
- ok &= addDataOpToFunctionData (data, "SUB output.rgb, 1.0, output;");
+ else
+ ok &= addDataOpToFunctionData (data, "SUB output.rgb, 1.0, output;");
if (alpha)
{
ok &= addDataOpToFunctionData (data, "MUL output.rgb, output.a, output;");