gl: Increase default VBO size on GL to 1M

The default VBO size was reduced from 256k to 16k because embedded
devices had trouble with the larger memory demands of a big VBO.  My
testing[1] indicates this incurred a 5% performance loss on at least one
of Cairo's performance tests.  Further testing showed that with
late-model graphics cards, further performance benefits can be seen with
even larger VBO sizes, up to 8.3% at 1M for Intel.

Now that we can set the vbo size differently for different backends, set
it to the lower value (16k) for EGL, and higher (1M) for GL.

1: http://www.bryceharrington.org/wordpress/2013/08/vbo-size/

Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
This commit is contained in:
Bryce Harrington 2014-07-31 17:58:15 -07:00
parent aa820c13d7
commit 402b456a32
2 changed files with 7 additions and 1 deletions

View file

@ -244,6 +244,12 @@ cairo_egl_device_create (EGLDisplay dpy, EGLContext egl)
return _cairo_gl_context_create_in_error (status);
}
/* Tune the default VBO size to reduce overhead on embedded devices.
* This smaller size means that flushing needs to be done more often,
* but it is less demanding of scarce memory on embedded devices.
*/
ctx->base.vbo_size = 16*1024;
eglMakeCurrent (dpy, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
return &ctx->base.base;

View file

@ -95,7 +95,7 @@
* but larger means hogging more memory and can cause trouble for drivers
* (especially on embedded devices). Use the CAIRO_GL_VBO_SIZE environment
* variable to set this to a different size. */
#define CAIRO_GL_VBO_SIZE_DEFAULT (16*1024)
#define CAIRO_GL_VBO_SIZE_DEFAULT (1024*1024)
typedef struct _cairo_gl_surface cairo_gl_surface_t;