GPU: Cleanup: Replace glFlush by GPU_flush
authorClément Foucault <foucault.clem@gmail.com>
Wed, 5 Dec 2018 03:23:45 +0000 (04:23 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Wed, 5 Dec 2018 03:23:45 +0000 (04:23 +0100)
source/blender/draw/intern/draw_manager.c
source/blender/draw/intern/draw_manager_shader.c
source/blender/editors/screen/screen_draw.c

index 265d33c8023fb343498f7230e1d0b57c7830f198..c744715ec6d00d67913d097ce61c3eec3c0898be 100644 (file)
@@ -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);
index bb580695865cbb505c62a063624d637d021781c0..a2583045adea5ffd1e4cc9531da664925787beb7 100644 (file)
@@ -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);
index ee41f1884813952ff066eee8e930bb9bca4f4f96..c6e9340a54d72b37a7985defb9ef60231f349447 100644 (file)
@@ -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,