[Cogl] [PATCH 0/7] Quad-buffer stereo support

otaylor at redhat.com otaylor at redhat.com
Thu Jun 12 11:11:37 PDT 2014


From: "Owen W. Taylor" <otaylor at fishsoup.net>

This patchset adds support for quad-buffer stereo. There are basically three
pieces to this:

 1. Configuring the creation of a CoglOnscreen with the right fbconfig
 2. Controlling whether drawing is going to the right or left framebuffer
 3. Supporting drawing from the left or right buffer for CoglTexturePixmap

Of these 1. is the part I'm least certain about in this patchset - I made
the stereo selection part of the CoglOnscreenTemplate and made it "best
effort" - if stereo support isn't available, it falls back to non-stereo.

This isn't in agreement with how alpha is handled - where it is part of the
CoglSwapChain and initialization fails if alpha isn't supported. I think
the approach of cogl_renderer_check_onscreen_template() is rather awkward -
if you look at https://git.gnome.org/browse/clutter/tree/clutter/x11/clutter-backend-x11.c#n728
extending that to alpha and stereo would be really ugly - it would have
to try all the different combinations.

Is there a direction here to allow for sharing a single GL context across
different fbconfigs in the style of EGL_MESA_configless_context? I'm guessing
since Neil wrote that extension there is some plan to support it in Cogl.
My current need is to support stereo with GLX, where I don't think we'll
get away from the need for a different GL context, but eventually there will
presumably be stereo support for EGL as well.

I certainly would appreciate feedback about whether there is some better
way to set things up than what I did here.

Thanks,
Owen

Owen W. Taylor (7):
  Add support for setting up stereo CoglOnscreens
  Add a simple example of stereo drawing
  CoglTexturePixmapX11: add support for stereo content
  examples/cogl-x11-tfp.c: Wait for the window to be mapped
  examples/cogl-x11-tfp.c: Handle WM_DELETE_WINDOW
  examples/cogl-x11-tfp: Add a --gears option to run glxgears
  examples/cogl-texture-pixmap-x11: Add a --stereo command line option

 cogl/Makefile.am                                |   1 +
 cogl/cogl-context-private.h                     |   1 +
 cogl/cogl-framebuffer-private.h                 |   9 +-
 cogl/cogl-framebuffer.c                         |  46 ++++
 cogl/cogl-framebuffer.h                         |  52 ++++
 cogl/cogl-glx-display-private.h                 |   3 +-
 cogl/cogl-onscreen-template.c                   |   8 +
 cogl/cogl-onscreen-template.h                   |  19 ++
 cogl/cogl-types.h                               |  15 ++
 cogl/driver/gl/cogl-framebuffer-gl.c            |  29 +++
 cogl/winsys/cogl-texture-pixmap-x11-private.h   |  43 ++++
 cogl/winsys/cogl-texture-pixmap-x11-right.c     | 324 ++++++++++++++++++++++++
 cogl/winsys/cogl-texture-pixmap-x11.c           | 122 ++++++---
 cogl/winsys/cogl-texture-pixmap-x11.h           |  59 ++++-
 cogl/winsys/cogl-winsys-egl-x11.c               |   4 +-
 cogl/winsys/cogl-winsys-glx-feature-functions.h |   5 +
 cogl/winsys/cogl-winsys-glx.c                   | 135 +++++++---
 cogl/winsys/cogl-winsys-private.h               |   4 +-
 examples/Makefile.am                            |   4 +-
 examples/cogl-stereo.c                          | 155 ++++++++++++
 examples/cogl-x11-tfp.c                         | 215 ++++++++++++++--
 21 files changed, 1159 insertions(+), 94 deletions(-)
 create mode 100644 cogl/winsys/cogl-texture-pixmap-x11-right.c
 create mode 100644 examples/cogl-stereo.c

-- 
1.9.3



More information about the Cogl mailing list