Skip to content

Commit

Permalink
Fixing issue where the first frame would always be white because glUn…
Browse files Browse the repository at this point in the history
…iform1i was failing after this switched shader programs unexpectedly due to the need to initialize the second filter.
  • Loading branch information
Sean Meiners committed Sep 5, 2013
1 parent b7cac76 commit e98cc81
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions framework/Source/GPUImageSobelEdgeDetectionFilter.m
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ - (void)setupFilterForSize:(CGSize)filterFrameSize;
_texelHeight = 1.0 / filterFrameSize.height;

runSynchronouslyOnVideoProcessingQueue(^{
GLProgram *previousProgram = [GPUImageContext sharedImageProcessingContext].currentShaderProgram;
[GPUImageContext setActiveShaderProgram:secondFilterProgram];
glUniform1f(texelWidthUniform, _texelWidth);
glUniform1f(texelHeightUniform, _texelHeight);
[GPUImageContext setActiveShaderProgram:previousProgram];
});
}
}
Expand Down

0 comments on commit e98cc81

Please sign in to comment.