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

Henry (Yu) Song - SISA henry.song at samsung.com
Thu Aug 29 13:57:30 PDT 2013

Hi, Chris

There is no indication there are many frames (e.g, in cairo micro per test).  I can either interpret the test as one drawing per frame, or many drawings per frame.  In the former case, then after each loop, a glFlush () should be called, or the later case, a glFlush () should be called after all loops.

Essentially, I found ,at least micro tests, do not model real performance accurately.



From: Chris Wilson [chris at chris-wilson.co.uk]
Sent: Thursday, August 29, 2013 1:50 PM
To: Henry (Yu) Song - SISA
Cc: cairo at cairographics.org
Subject: Re: [cairo] [patch] boilerplate/gl: use glFlush instead of glFinish

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 Wilson, Intel Open Source Technology Centre

More information about the cairo mailing list