Commit graph

19 commits

Author SHA1 Message Date
Bryce Harrington
402b456a32 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>
2014-09-19 17:23:50 -07:00
Chris Wilson
f50ced2e7b gl: Fix typo s/bool/cairo_bool_t/
One quickly gets used to having stdbool.h available.
2013-03-08 14:25:26 +00:00
Henry Song
524e6fd3e8 gl: Export query for EGLContext and EGLDisplay from device
Similar to glx, add query for the EGLContext and EGLDisplay to egl-based
cairo devices.
2013-03-08 11:43:39 +00:00
Henry Song
7054c9969c gl: Don't query the display when checking if the context changed
If display has changed, the associated context must change. A
context is tied a display so we can avoid this check, eliminating
unnecessary work during context acquisition and release.
2013-01-23 16:55:38 -08:00
Martin Robinson
d1184b69e8 gl: Do less work when acquiring and releasing devices
After acquiring a GL device and the same GL context, surface, and
display combination is already active outside of Cairo, do not ask EGL
or GLX to change the current context as that may cause a flush on some
drivers. Also do not unset the context when releasing the device for the
same reason.
2013-01-08 15:09:33 -08:00
Martin Robinson
5c4087af81 gl: Add a non-thread-aware mode for GL devices
GLX and EGL devices are thread-aware currently. This
is safe, but on certain GPUs can be very expensive. In
this patch, we expose a new API which turns off the
safety feature in cases where performance is a priority.
2012-08-22 13:49:14 -07:00
Chris Wilson
f59b0914f4 egl: s/EGL_KHR_surfaceless_opengl/EGL_KHR_surfaceless_context/
Mesa changed the name of the extension it invented, so check for the
real name and the old name before falling back to pbuffers which are not
supported by most EGL implementations.

References: https://bugs.freedesktop.org/show_bug.cgi?id=53361
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2012-08-11 17:42:17 +01:00
Pekka Paalanen
4c3276e94f egl: do not destroy dummy_surface if it does not exist
On deleting an EGL device, it is possible that
cairo_egl_context_t::dummy_surface is EGL_NO_SURFACE. In that case
calling eglDestroySurface() on it will lead to EGL_BAD_SURFACE error.

Check dummy_surface before destroying it.

Signed-off-by: Pekka Paalanen <ppaalanen@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-16 16:30:12 +00:00
Chris Wilson
d7dcf9d28f gl: Check against user-provided invalid sizes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2011-12-05 17:17:26 +00:00
Alexandros Frantzis
2181a53f61 egl: Ensure that the dummy pbuffer surface is compatible with the supplied context
In order to be able to make an egl context current when using a
pbuffer surface, that surface must have been created with a config
that is compatible with the context config. For Mesa, this means that
the configs must be the same.
2011-02-18 09:45:00 -05:00
Benjamin Franzke
3245d6e120 egl: Fix eglMakeCurrent for egl surfaces 2011-02-18 09:45:00 -05:00
Alexandros Frantzis
e0ab932c61 gl: Embed the GL dispatch table in the cairo-gl context and initialize it. 2010-12-15 15:32:20 +00:00
Kristian Høgsberg
14639e6b85 egl: Use EGL_KHR_surfaceless_opengl extension when available
This lets us avoid creating a throwaway pbuffer just to make the
context current.
2010-07-28 23:17:42 -04:00
Benjamin Otte
faa4e6761c egl: Copy glx code to detect the proper surface in acquire 2010-06-22 20:21:15 +02:00
Benjamin Otte
76a721f7e9 egl: Remove unused prev_foo usage 2010-06-22 20:21:15 +02:00
Kristian Høgsberg
67e84d6123 egl: Implement acquire and release for EGL backend 2010-06-18 10:12:06 -04:00
Andrea Canciani
b8a7f8621a Update FSF address
I updated the Free Software Foundation address using the following script.

for i in $(git grep Temple | cut -d: -f1 )
do
  sed -e 's/59 Temple Place[, -]* Suite 330, Boston, MA *02111-1307[, ]* USA/51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA/' -i "$i"
done

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=21356
2010-04-27 11:13:38 +02:00
Benjamin Otte
712919223d gl: Make code safe for multithreaded access
The code callss the gl device's acquire/release in
cairo_device_acquire/release(). This way, external APIs can use these
functions to prepare for rendering GL.

Also adds code to unset the glx context if it wasn't set when acquiring
the device. This allows multithreaded apps to work fine with just using
cairo APIs, but might introduce penalties in single-threaded
applications.
2010-04-15 18:30:54 +02:00
Chris Wilson
b101c7dab8 gl: Add EGL interface
Enable the EGL backend for GL.
2010-03-11 01:49:18 +00:00