From 05a191618fe540a2f033d920aebb246a7f323b47 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Thu, 30 Jul 2015 17:59:34 -0700 Subject: [PATCH] libobs-opengl: Only flush if no active swap on OSX glFlush is somewhat implementation-specific; on OSX for example, it is additionally used to draw to a view. However, we're already using the Objective-C function flushBuffer, which apparently calls glFlush internally anyway to draw to views. That means that we're superfluously calling glFlush most of the time if there's an active swap chain. So instead, only call glFlush when there are no active swap chains on OSX. --- libobs-opengl/gl-subsystem.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libobs-opengl/gl-subsystem.c b/libobs-opengl/gl-subsystem.c index 94a4f804f..416528304 100644 --- a/libobs-opengl/gl-subsystem.c +++ b/libobs-opengl/gl-subsystem.c @@ -1051,7 +1051,12 @@ void device_clear(gs_device_t *device, uint32_t clear_flags, void device_flush(gs_device_t *device) { +#ifdef __APPLE__ + if (!device->cur_swap) + glFlush(); +#else glFlush(); +#endif UNUSED_PARAMETER(device); }