From: Steinar H. Gunderson Date: Sat, 26 Jul 2014 23:17:12 +0000 (+0200) Subject: Correct the number of blur taps read. X-Git-Tag: 1.1.2~1 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=47b4160062cdaa53b7d49d7f99ce2c686f02cff8 Correct the number of blur taps read. 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. --- diff --git a/blur_effect.frag b/blur_effect.frag index afe9f2e..df0aa46 100644 --- a/blur_effect.frag +++ b/blur_effect.frag @@ -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