15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci EXT_stereo_tree 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci GLX_EXT_stereo_tree 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciContributors 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Andy Ritger 125bd8deadSopenharmony_ci Arthur Huillet 135bd8deadSopenharmony_ci Owen Taylor 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ciContact 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ci James Jones, NVIDIA, jajones at nvidia.com 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ciStatus 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ci Complete 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ciVersion 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ci 1 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ciNumber 285bd8deadSopenharmony_ci 295bd8deadSopenharmony_ci OpenGL Extension #452 305bd8deadSopenharmony_ci 315bd8deadSopenharmony_ciDependencies 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ci This specification is written against the wording of the GLX 1.4 345bd8deadSopenharmony_ci Specification. 355bd8deadSopenharmony_ci 365bd8deadSopenharmony_ci A minimum of GLX 1.3, or GLX 1.2 with the GLX_SGIX_pbuffer 375bd8deadSopenharmony_ci extension is required. 385bd8deadSopenharmony_ci 395bd8deadSopenharmony_ci GLX_SGIX_pbuffer affects the definition of this extension. 405bd8deadSopenharmony_ci 415bd8deadSopenharmony_ci The X Generic Event extension affects the definition of this 425bd8deadSopenharmony_ci extension. 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ciOverview 455bd8deadSopenharmony_ci 465bd8deadSopenharmony_ci When using stereoscopic rendering with the X composite extension, 475bd8deadSopenharmony_ci a stereo-aware GLX composite manager can be used to composite both 485bd8deadSopenharmony_ci the left and right buffers of a window's backing pixmap to 495bd8deadSopenharmony_ci the left and right buffers of the root or composite overlay window 505bd8deadSopenharmony_ci to preserve the stereo effect of a redirected window or any of its 515bd8deadSopenharmony_ci child windows. However, to do this, the composite manager needs a 525bd8deadSopenharmony_ci method to determine which windows have both left and right buffers 535bd8deadSopenharmony_ci available without needing to walk entire window trees or be aware 545bd8deadSopenharmony_ci of other clients' GLX drawables. 555bd8deadSopenharmony_ci 565bd8deadSopenharmony_ci This extension provides a new drawable tree query, which can be 575bd8deadSopenharmony_ci used by the composite manager when it begins tracking a window, 585bd8deadSopenharmony_ci and an event, which can be used to listen for updates to a tracked 595bd8deadSopenharmony_ci window. This query and event provide the composite manager with a 605bd8deadSopenharmony_ci boolean value representing the stereo status of an entire 615bd8deadSopenharmony_ci redirected window tree. With this information, the composite 625bd8deadSopenharmony_ci manager is able to properly choose between a stereoscopic or 635bd8deadSopenharmony_ci monoscopic format when creating a GLXPixmap for a given window 645bd8deadSopenharmony_ci tree's backing pixmap. 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ciIP Status 675bd8deadSopenharmony_ci 685bd8deadSopenharmony_ci There are no known IP issues. 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ciNew Types 715bd8deadSopenharmony_ci 725bd8deadSopenharmony_ci typedef struct { 735bd8deadSopenharmony_ci int type; 745bd8deadSopenharmony_ci unsigned long serial; 755bd8deadSopenharmony_ci Bool send_event; 765bd8deadSopenharmony_ci Display *display; 775bd8deadSopenharmony_ci int extension; 785bd8deadSopenharmony_ci int evtype; 795bd8deadSopenharmony_ci GLXDrawable window; 805bd8deadSopenharmony_ci Bool stereo_tree; 815bd8deadSopenharmony_ci } GLXStereoNotifyEventEXT; 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ciNew Procedures and Functions 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci None 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ciNew Tokens 885bd8deadSopenharmony_ci 895bd8deadSopenharmony_ci Accepted by the <attribute> parameter of glXQueryDrawable and 905bd8deadSopenharmony_ci glXQueryGLXPbufferSGIX: 915bd8deadSopenharmony_ci 925bd8deadSopenharmony_ci GLX_STEREO_TREE_EXT 0x20F5 935bd8deadSopenharmony_ci 945bd8deadSopenharmony_ci Accepted in the <event_mask> parameter of glXSelectEvent and 955bd8deadSopenharmony_ci glXSelectEventSGIX, and returned in the <event_mask> parameter 965bd8deadSopenharmony_ci of glXGetSelectedEvent and glXGetSelectedEventSGIX: 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci GLX_STEREO_NOTIFY_MASK_EXT 0x00000001 995bd8deadSopenharmony_ci 1005bd8deadSopenharmony_ci Returned in the <evtype> field of XGenericEventCookie events: 1015bd8deadSopenharmony_ci 1025bd8deadSopenharmony_ci GLX_STEREO_NOTIFY_EXT 0x00000000 1035bd8deadSopenharmony_ci 1045bd8deadSopenharmony_ciAdditions to the GLX 1.4 Specification 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci [Modify Section 3.3.6, Querying Attributes] 1075bd8deadSopenharmony_ci 1085bd8deadSopenharmony_ci [Replace the 2nd sentence of the 1st paragraph with the following] 1095bd8deadSopenharmony_ci 1105bd8deadSopenharmony_ci "<attribute> must be set to one of GLX_WIDTH, GLX_HEIGHT, 1115bd8deadSopenharmony_ci GLX_PRESERVED_CONTENTS, GLX_LARGEST_PBUFFER, GLX_FBCONFIG_ID, or 1125bd8deadSopenharmony_ci GLX_STEREO_TREE_EXT" 1135bd8deadSopenharmony_ci 1145bd8deadSopenharmony_ci [Add the following paragraph just before the last of the section] 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci "If <attribute> is GLX_STEREO_TREE_EXT and <draw> is an X Window 1175bd8deadSopenharmony_ci or a GLXWindow, <value> will be True if <draw> is the top-level 1185bd8deadSopenharmony_ci window of a redirected window tree and one or more windows in the 1195bd8deadSopenharmony_ci tree are associated with a stereo GLXFBConfig. Otherwise, <value> 1205bd8deadSopenharmony_ci will be False." 1215bd8deadSopenharmony_ci 1225bd8deadSopenharmony_ci [Add the following to the end of the section] 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci "If <draw> is not a GLXWindow or X Window and <attribute> is set 1255bd8deadSopenharmony_ci to GLX_STEREO_TREE_EXT, then the contents of <value> are 1265bd8deadSopenharmony_ci undefined." 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci [Modify Section 3.3.8, Events] 1295bd8deadSopenharmony_ci 1305bd8deadSopenharmony_ci [Replace the 3rd-5th paragraphs with the following] 1315bd8deadSopenharmony_ci 1325bd8deadSopenharmony_ci "If <draw> is not a valid GLXPbuffer, GLXWindow, or X Window, a 1335bd8deadSopenharmony_ci GLXBadDrawable error is generated. 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci "To find out which GLX events are selected for a GLXWindow, 1365bd8deadSopenharmony_ci GLXPbuffer, or X Window call 1375bd8deadSopenharmony_ci 1385bd8deadSopenharmony_ci void glXGetSelectedEvent(Display *dpy, GLXDrawable draw, 1395bd8deadSopenharmony_ci unsigned long *event_mask); 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci "If <draw> is not a GLX window or pbuffer, or an X window, 1425bd8deadSopenharmony_ci GLXBadDrawable is generated. 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci "Currently there are two GLX events that can be selected, by 1455bd8deadSopenharmony_ci setting <event_mask> to GLX_PBUFFER_CLOBBER_MASK or 1465bd8deadSopenharmony_ci GLX_STEREO_NOTIFY_MASK_EXT. The data structure describing a 1475bd8deadSopenharmony_ci pbuffer clobber event is:" 1485bd8deadSopenharmony_ci 1495bd8deadSopenharmony_ci [Add the following at the end of the section] 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci "stereo notify events are delivered using the generic event 1525bd8deadSopenharmony_ci extension when a redirected window or one of its children sharing 1535bd8deadSopenharmony_ci the same backing pixmap is associated or disassociated with a 1545bd8deadSopenharmony_ci stereo GLXFBConfig. The data structure describing a stereo notify 1555bd8deadSopenharmony_ci event is: 1565bd8deadSopenharmony_ci 1575bd8deadSopenharmony_ci typedef struct { 1585bd8deadSopenharmony_ci int type; /* GenericEvent */ 1595bd8deadSopenharmony_ci unsigned long serial; /* # of last request server processed */ 1605bd8deadSopenharmony_ci Bool send_event; /* True if generated by SendEvent request */ 1615bd8deadSopenharmony_ci Display *display; /* display the event was read from */ 1625bd8deadSopenharmony_ci int extension; /* GLX major opcode, from XQueryExtension */ 1635bd8deadSopenharmony_ci int evtype; /* always GLX_STEREO_NOTIFY_EXT */ 1645bd8deadSopenharmony_ci GLXDrawable window; /* XID of the X window affected */ 1655bd8deadSopenharmony_ci Bool stereo_tree; /* True if tree contains stereo windows */ 1665bd8deadSopenharmony_ci } GLXStereoNotifyEventEXT; 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci "If an implementation doesn't support stereo rendering with the 1695bd8deadSopenharmony_ci X composite extension, then it does not need to support the 1705bd8deadSopenharmony_ci generation of GLXStereoNotifyEventEXT events. 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci "If <stereo_tree> is True, <window> is the top-level window in a 1735bd8deadSopenharmony_ci redirected window tree that contains at least one stereo GLX 1745bd8deadSopenharmony_ci window drawable. Otherwise, <stereo_tree> will be False. 1755bd8deadSopenharmony_ci 1765bd8deadSopenharmony_ci "No GLXStereoNotifyEventEXT events will be generated for the root 1775bd8deadSopenharmony_ci window or composite overlay window, since they can not be 1785bd8deadSopenharmony_ci redirected. 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci "The value of <window> will refer to an X window, regardless of 1815bd8deadSopenharmony_ci whether a GLXWindow or an X window id was passed to 1825bd8deadSopenharmony_ci glXSelectEvent" 1835bd8deadSopenharmony_ci 1845bd8deadSopenharmony_ciGLX Protocol 1855bd8deadSopenharmony_ci 1865bd8deadSopenharmony_ci One new generic event is added: 1875bd8deadSopenharmony_ci 1885bd8deadSopenharmony_ci MOC is the major opcode for the extension, as returned by 1895bd8deadSopenharmony_ci XQueryExtension. 1905bd8deadSopenharmony_ci 1915bd8deadSopenharmony_ci GLX_STEREO_NOTIFY_EXT 1925bd8deadSopenharmony_ci 1 35 (GenericEvent) type 1935bd8deadSopenharmony_ci 1 MOC extension 1945bd8deadSopenharmony_ci 2 CARD16 sequence_number 1955bd8deadSopenharmony_ci 4 0 length 1965bd8deadSopenharmony_ci 2 CARD16 evtype 1975bd8deadSopenharmony_ci 0x00000000 GLX_STEREO_NOTIFY_EXT 1985bd8deadSopenharmony_ci 1 BYTE stereo_tree 1995bd8deadSopenharmony_ci 1 unused 2005bd8deadSopenharmony_ci 4 GLX_DRAWABLE window 2015bd8deadSopenharmony_ci 16 unused 2025bd8deadSopenharmony_ci 2035bd8deadSopenharmony_ciDependencies on GLX_SGIX_pbuffer 2045bd8deadSopenharmony_ci 2055bd8deadSopenharmony_ci If GLX_SGIX_pbuffer is not present, the references to 2065bd8deadSopenharmony_ci glXSelectEventSGIX and glXGetSelectedEventSGIX are removed. 2075bd8deadSopenharmony_ci 2085bd8deadSopenharmony_ciDependencies on the X Generic Event extension 2095bd8deadSopenharmony_ci 2105bd8deadSopenharmony_ci If the generic event extension is not present, the events 2115bd8deadSopenharmony_ci specified here will not be delivered. 2125bd8deadSopenharmony_ci 2135bd8deadSopenharmony_ciErrors 2145bd8deadSopenharmony_ci 2155bd8deadSopenharmony_ci None 2165bd8deadSopenharmony_ci 2175bd8deadSopenharmony_ciIssues 2185bd8deadSopenharmony_ci 2195bd8deadSopenharmony_ci 1) Does the language describing which drawable types 2205bd8deadSopenharmony_ci glXQueryDrawable accepts need to be extended to include X 2215bd8deadSopenharmony_ci windows? 2225bd8deadSopenharmony_ci 2235bd8deadSopenharmony_ci RESOLVED: No. GLXDrawable is already defined to include X 2245bd8deadSopenharmony_ci windows by the GLX protocol specification. 2255bd8deadSopenharmony_ci 2265bd8deadSopenharmony_ci 2) Should the events and queries added here work on non- 2275bd8deadSopenharmony_ci redirected window trees, or the root window as well? 2285bd8deadSopenharmony_ci 2295bd8deadSopenharmony_ci RESOLVED: No. Implementations may not need to track such 2305bd8deadSopenharmony_ci information for these types of windows, so it would add burden 2315bd8deadSopenharmony_ci with no apparent benefit to applications. Consequently, the 2325bd8deadSopenharmony_ci queries will always return False and no events will be 2335bd8deadSopenharmony_ci generated for these windows. 2345bd8deadSopenharmony_ci 2355bd8deadSopenharmony_ci 3) Should a GLX extension event or a generic event be used for 2365bd8deadSopenharmony_ci the new stereo notification mechanism? 2375bd8deadSopenharmony_ci 2385bd8deadSopenharmony_ci RESOLVED: A generic event should be used. Adding extension 2395bd8deadSopenharmony_ci events to existing extensions has been shown to be problematic 2405bd8deadSopenharmony_ci when updated servers are mixed with older clients, and modern 2415bd8deadSopenharmony_ci X server implementations are running out of extension event 2425bd8deadSopenharmony_ci slots. 2435bd8deadSopenharmony_ci 2445bd8deadSopenharmony_ciVersion History 2455bd8deadSopenharmony_ci 2465bd8deadSopenharmony_ci 1. 06 Mar 2014 2475bd8deadSopenharmony_ci - Initial Draft 248