[cairo] [patch] boilerplate/gl: use glFlush instead of glFinish

Chris Wilson chris at chris-wilson.co.uk
Thu Aug 29 13:50:56 PDT 2013


On Thu, Aug 29, 2013 at 08:41:57PM +0000, Henry (Yu) Song - SISA wrote:
> From 73c77248ed95b3f9f6a777d86c368e464f3b49bb Mon Sep 17 00:00:00 2001
> From: Henry Song <henry.song at samsung.com>
> Date: Thu, 29 Aug 2013 13:35:11 -0700
> Subject: [PATCH] boilerplate/gl: use glFlush instead of glFinish for
>  synchronization
> 
> Use glFlush () is a proper way to indicate a surface/frame finish
> instead of a glFinish. Applications very rarely use glFinish ().
> For offscreen, a glFlush () should be used to indicate finish drawings
> onto a surface.  For onscreen, an eglSwapBuffers/glXSwapBuffers should
> be used (internal, it calls glFlush).
> 
> Using glFlush () computes performance more accurately folllowing app
> usage model.

glFinish is required for an accurate timing here of the complete
rendering (which is many, many, many frames long). The readback overhead
should be insignificant, just the cost of serialisation which is exactly
the amount of time it takes to finish the rendering.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the cairo mailing list