After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 733277 - Add support for quad-buffer stereo
Add support for quad-buffer stereo
Status: RESOLVED OBSOLETE
Product: mutter
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: mutter-maint
mutter-maint
Depends on:
Blocks:
 
 
Reported: 2014-07-16 19:21 UTC by Owen Taylor
Modified: 2021-07-05 13:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Add support for quad-buffer stereo (31.73 KB, patch)
2014-07-16 19:21 UTC, Owen Taylor
none Details | Review
Add support for quad-buffer stereo (34.54 KB, patch)
2017-02-21 21:30 UTC, Owen Taylor
accepted-commit_now Details | Review

Description Owen Taylor 2014-07-16 19:21:02 UTC
Track the stereo status of windows using the new EXT_stereo_tree
GLX extension.

When stereo is enabled or disabled, a restart is triggered via
meta_restart() after a timeout, setting a _META_ENABLE_STEREO
property on the root window to indicate whether we should
turn on a stereo stage for clutter. The property avoids a loop,
since we need to enable stereo *before* initializing Clutter and GL,
but we need GL to figure out whether we have stereo windows.

Stereo windows are drawn to the stage using new functionality
in Cogl to setup a stereo context, select which buffer to draw
to, and draw either the left or right buffer of a stereo
texture_from_pixmap.
Comment 1 Owen Taylor 2014-07-16 19:21:05 UTC
Created attachment 280886 [details] [review]
Add support for quad-buffer stereo
Comment 2 drago01 2014-07-21 13:09:16 UTC
Review of attachment 280886 [details] [review]:

Code looks good to me but a) I have no way of actually testing it and b) I am not sure I like the "_right" naming (does not mean anything on its own but have no better suggestion that aren't just too long).
Comment 3 Owen Taylor 2017-02-21 21:30:48 UTC
Created attachment 346408 [details] [review]
Add support for quad-buffer stereo

[ Rebased to current master, I also have a very slightly different
  version for gnome-3-22 ]

Track the stereo status of windows using the new EXT_stereo_tree
GLX extension.

When stereo is enabled or disabled, a restart is triggered via
meta_restart() after a timeout, setting a _META_ENABLE_STEREO
property on the root window to indicate whether we should
turn on a stereo stage for clutter. The property avoids a loop,
since we need to enable stereo *before* initializing Clutter and GL,
but we need GL to figure out whether we have stereo windows.

Stereo windows are drawn to the stage using new functionality
in Cogl to setup a stereo context, select which buffer to draw
to, and draw either the left or right buffer of a stereo
texture_from_pixmap.
Comment 4 Rui Matos 2017-02-22 17:49:43 UTC
Review of attachment 346408 [details] [review]:

some nitpicks you can ignore. overall looks fine

::: src/compositor/compositor.c
@@ +482,3 @@
+#define GLX_STEREO_TREE_EXT        0x20F5
+#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001
+#define GLX_STEREO_NOTIFY_EXT      0x00000000

I see these defined in GL/glxext.h but they won't ever change so, ok

@@ +493,3 @@
+  Drawable window;
+  Bool stereo_tree;
+} StereoNotifyEvent;

otoh, this doesn't seem to be defined on any headers I have

@@ +508,3 @@
+    query_extensions_string =
+      (const char * (*) (Display *, int))
+      cogl_get_proc_address ("glXQueryExtensionsString");

would be nice to have this kind of code in mutter consolidated but i guess this will be the last addition we need of direct gl/glx API usage

@@ +516,3 @@
+}
+
+#include <GL/gl.h>

don't think we need this include

@@ +567,3 @@
+          cogl_get_proc_address ("glXSelectEvent");
+
+      select_event (xdisplay, xwindow, GLX_STEREO_NOTIFY_MASK_EXT);

I suppose this is safe since nothing else in mutter/clutter/cogl selects for other glx events but a comment would be nice
Comment 5 GNOME Infrastructure Team 2021-07-05 13:45:14 UTC
GNOME is going to shut down bugzilla.gnome.org in favor of gitlab.gnome.org.
As part of that, we are mass-closing older open tickets in bugzilla.gnome.org
which have not seen updates for a longer time (resources are unfortunately
quite limited so not every ticket can get handled).

If you can still reproduce the situation described in this ticket in a recent
and supported software version, then please follow
  https://wiki.gnome.org/GettingInTouch/BugReportingGuidelines
and create a new ticket at
  https://gitlab.gnome.org/GNOME/mutter/-/issues/

Thank you for your understanding and your help.