[Bf-blender-cvs] [d59c4c9d61a] blender2.8: GPU: Cleanup: Replace glFlush by GPU_flush

Clément Foucault noreply at git.blender.org
Wed Dec 5 04:25:08 CET 2018


Commit: d59c4c9d61a1634f75369a02ff7f381612988c9f
Author: Clément Foucault
Date:   Wed Dec 5 04:23:45 2018 +0100
Branches: blender2.8
https://developer.blender.org/rBd59c4c9d61a1634f75369a02ff7f381612988c9f

GPU: Cleanup: Replace glFlush by GPU_flush

===================================================================

M	source/blender/draw/intern/draw_manager.c
M	source/blender/draw/intern/draw_manager_shader.c
M	source/blender/editors/screen/screen_draw.c

===================================================================

diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 265d33c8023..c744715ec6d 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1518,7 +1518,7 @@ void DRW_draw_render_loop_ex(
 
 #ifdef __APPLE__
 	/* Fix 3D view being "laggy" on macos. (See T56996) */
-	glFlush();
+	GPU_flush();
 #endif
 
 	/* annotations - temporary drawing buffer (3d space) */
@@ -2668,7 +2668,7 @@ void DRW_opengl_context_disable_ex(bool restore)
 #ifdef __APPLE__
 		/* Need to flush before disabling draw context, otherwise it does not
 		 * always finish drawing and viewport can be empty or partially drawn */
-		glFlush();
+		GPU_flush();
 #endif
 
 		if (BLI_thread_is_main() && restore) {
@@ -2705,7 +2705,7 @@ void DRW_opengl_render_context_enable(void *re_gl_context)
 
 void DRW_opengl_render_context_disable(void *re_gl_context)
 {
-	glFlush();
+	GPU_flush();
 	WM_opengl_context_release(re_gl_context);
 	/* TODO get rid of the blocking. */
 	BLI_ticket_mutex_unlock(DST.gl_context_mutex);
diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c
index bb580695865..a2583045ade 100644
--- a/source/blender/draw/intern/draw_manager_shader.c
+++ b/source/blender/draw/intern/draw_manager_shader.c
@@ -131,7 +131,7 @@ static void drw_deferred_shader_compilation_exec(void *custom_data, short *stop,
 		*progress = (float)comp->shaders_done / (float)total;
 		*do_update = true;
 
-		glFlush();
+		GPU_flush();
 		BLI_mutex_unlock(&comp->compilation_lock);
 
 		BLI_spin_lock(&comp->list_lock);
diff --git a/source/blender/editors/screen/screen_draw.c b/source/blender/editors/screen/screen_draw.c
index ee41f188481..c6e9340a54d 100644
--- a/source/blender/editors/screen/screen_draw.c
+++ b/source/blender/editors/screen/screen_draw.c
@@ -391,7 +391,7 @@ void ED_screen_draw_edges(wmWindow *win)
 	if (GPU_type_matches(GPU_DEVICE_INTEL_UHD, GPU_OS_UNIX, GPU_DRIVER_ANY)) {
 		/* For some reason, on linux + Intel UHD Graphics 620 the driver
 		 * hangs if we don't flush before this. (See T57455) */
-		glFlush();
+		GPU_flush();
 	}
 
 	GPU_scissor(scissor_rect.xmin,



More information about the Bf-blender-cvs mailing list