From 47b4160062cdaa53b7d49d7f99ce2c686f02cff8 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Sun, 27 Jul 2014 01:17:12 +0200 Subject: [PATCH] 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. --- blur_effect.frag | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 -- 2.39.2