diff --git a/framework/Source/iOS/GPUImageContext.m b/framework/Source/iOS/GPUImageContext.m index c167d15d2..0ab021bac 100755 --- a/framework/Source/iOS/GPUImageContext.m +++ b/framework/Source/iOS/GPUImageContext.m @@ -80,6 +80,7 @@ - (void)useAsCurrentContext; EAGLContext *imageProcessingContext = [self context]; if ([EAGLContext currentContext] != imageProcessingContext) { + glFlush(); [EAGLContext setCurrentContext:imageProcessingContext]; } } @@ -95,6 +96,7 @@ - (void)setContextShaderProgram:(GLProgram *)shaderProgram; EAGLContext *imageProcessingContext = [self context]; if ([EAGLContext currentContext] != imageProcessingContext) { + glFlush(); [EAGLContext setCurrentContext:imageProcessingContext]; } @@ -277,6 +279,7 @@ - (EAGLContext *)context; { if (_context == nil) { + glFlush(); _context = [self createContext]; [EAGLContext setCurrentContext:_context];