Преглед изворни кода

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.
jp9000 пре 10 година
родитељ
комит
05a191618f
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      libobs-opengl/gl-subsystem.c

+ 5 - 0
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);
 }