From 2ae5b930b4a19b414802e20dc173922ea427a84e Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 25 Jun 2018 16:54:02 +0800 Subject: [PATCH] glfulsh before setCurrentContext --- framework/Source/iOS/GPUImageContext.m | 3 +++ 1 file changed, 3 insertions(+) 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];