BradLarson/GPUImage — pull request #935 by aburgel (2013-04-21 14:08:39+00:00)
Title: Fix filter resetting to ensure GPUImageTwoInputFilter is in good state

GPUImageTwoInputFilter is not being reset properly, specifically `hasSetFirstTexture` is not being set back to `NO`. My previous patch attempted to fix this but did not take into account some subtleties. This patch fixes my original issue and also doesn't break the FilterShowcase app.

The reason for this issue, as I understand it, is that the meaning of GLUint zero in `[GPUImageInput setInputTexture:atIndex:]` is being overloaded as both "this is a placeholder, wait for the real value" and "reset the filter".

The first meaning comes into play when setting up. `[GPUImageOutput outputTexture]' is not yet initialized, but its still used as the filters' inputTexture. Then when it is initialized, the filters are notified via '[GPUImageOutput notifyTargetsAboutNewOutputTexture]`.

The second meaning is used in `[GPUImageOutput removeAllTargets]`.

My original fix broke the first case. For this new fix, I noticed that GPUImageTwoInputFilter resets itself in `setInputSize:atIndex:`, but this was being called in the wrong order so it would get reset and then immediately unreset. This patch fixes the call order.