]> git.sesse.net Git - movit/commitdiff
Correct the number of blur taps read.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 26 Jul 2014 23:17:12 +0000 (01:17 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Sat, 26 Jul 2014 23:19:06 +0000 (01:19 +0200)
We read about twice as many as we should have; the others were
probably just set to 0.0, which has no effect but still burns
arithmetic, unless your driver happens to optimize very aggressively
for this (which I don't think anyone does anymore).

Found by Christophe Thommeret.

blur_effect.frag

index afe9f2e4cc001247d51b2a9e214348d6f55ce327..df0aa4649608c9f67f684350a3b8f7248a472f5e 100644 (file)
@@ -4,11 +4,11 @@
 
 #define NUM_TAPS 16
 
-uniform vec2 PREFIX(samples)[NUM_TAPS + 1];
+uniform vec2 PREFIX(samples)[NUM_TAPS / 2 + 1];
 
 vec4 FUNCNAME(vec2 tc) {
        vec4 sum = vec4(PREFIX(samples)[0].y) * INPUT(tc);
-       for (int i = 1; i < NUM_TAPS + 1; ++i) {
+       for (int i = 1; i < NUM_TAPS / 2 + 1; ++i) {
                vec2 sample = PREFIX(samples)[i];
                vec2 sample1_tc = tc, sample2_tc = tc;
 #if DIRECTION_VERTICAL