15bd8deadSopenharmony_ciXXX - Not complete yet!!!
25bd8deadSopenharmony_ci
35bd8deadSopenharmony_ciName
45bd8deadSopenharmony_ci
55bd8deadSopenharmony_ci    SGI_cushion
65bd8deadSopenharmony_ci
75bd8deadSopenharmony_ciName Strings
85bd8deadSopenharmony_ci
95bd8deadSopenharmony_ci    GLX_SGI_cushion
105bd8deadSopenharmony_ci
115bd8deadSopenharmony_ciVersion
125bd8deadSopenharmony_ci
135bd8deadSopenharmony_ci    $Date: 1997/10/13 21:16:02 $ $Revision: 1.3 $
145bd8deadSopenharmony_ci
155bd8deadSopenharmony_ciNumber
165bd8deadSopenharmony_ci
175bd8deadSopenharmony_ci    62
185bd8deadSopenharmony_ci
195bd8deadSopenharmony_ciDependencies
205bd8deadSopenharmony_ci
215bd8deadSopenharmony_ci    SGI_swap_control is required
225bd8deadSopenharmony_ci    SGIX_fbconfig affects the definition of this extension
235bd8deadSopenharmony_ci
245bd8deadSopenharmony_ciOverview
255bd8deadSopenharmony_ci
265bd8deadSopenharmony_ci    This extension is directed at constant frame-rate applications.  Such
275bd8deadSopenharmony_ci    applications are written to ensure that a new image is generated every
285bd8deadSopenharmony_ci    N video frame periods, where N is itself a small constant integer.
295bd8deadSopenharmony_ci    If the application is unable to generate a frame within N video frame
305bd8deadSopenharmony_ci    periods, it is said to have dropped a frame.  Dropping a frame is a
315bd8deadSopenharmony_ci    *bad thing*.
325bd8deadSopenharmony_ci
335bd8deadSopenharmony_ci    Constant frame-rate applications make every effort to avoid dropping
345bd8deadSopenharmony_ci    frames.  In particular, they monitor the utilization of graphics
355bd8deadSopenharmony_ci    resources during the rendering of the current frame in order to predict
365bd8deadSopenharmony_ci    the behavior of subsequent frames.  If such prediction indicates that
375bd8deadSopenharmony_ci    a frame may be dropped, the rendering complexity of the frame is
385bd8deadSopenharmony_ci    reduced (e.g. by using models of lower geometric resolution) so as to
395bd8deadSopenharmony_ci    avoid the overload condition.
405bd8deadSopenharmony_ci
415bd8deadSopenharmony_ci    Unfortunately, because exact prediction is not possible, and because
425bd8deadSopenharmony_ci    there is no elasticity in the buffering of images, it is necessary
435bd8deadSopenharmony_ci    for constant frame-rate applications to under utilize the graphics
445bd8deadSopenharmony_ci    hardware.  This extension adds elasticity to the buffering of completed
455bd8deadSopenharmony_ci    images, in order to allow constant frame-rate applications to make full
465bd8deadSopenharmony_ci    use of the available graphics computation without dropping frames.
475bd8deadSopenharmony_ci    It further allows this elasticity to be controlled by the application in
485bd8deadSopenharmony_ci    order to minimize the introduction of latency that could otherwise
495bd8deadSopenharmony_ci    occur.
505bd8deadSopenharmony_ci
515bd8deadSopenharmony_ci    Applications that will benefit from this extension include simulation,
525bd8deadSopenharmony_ci    walk-through, and multimedia playback.
535bd8deadSopenharmony_ci
545bd8deadSopenharmony_ci    WARNING - Silicon Graphics has filed for patent protection for some
555bd8deadSopenharmony_ci	      of the techniques described in this extension document.
565bd8deadSopenharmony_ci
575bd8deadSopenharmony_ciIssues
585bd8deadSopenharmony_ci
595bd8deadSopenharmony_ci    *	This spec should talk about the vertical retrace interrupt, but I
605bd8deadSopenharmony_ci	can't find any mention of it in any other extension.  Where is such
615bd8deadSopenharmony_ci	an interrupt specified?
625bd8deadSopenharmony_ci
635bd8deadSopenharmony_ci    *	Are additional queries of rendering performance required to make
645bd8deadSopenharmony_ci	extension useful?
655bd8deadSopenharmony_ci
665bd8deadSopenharmony_ci    *	How should this extension interact with SGI_video_sync?
675bd8deadSopenharmony_ci
685bd8deadSopenharmony_ci    *	How is the cushion value queried?
695bd8deadSopenharmony_ci
705bd8deadSopenharmony_ci    *	Can this be implemented efficiently on current hardware systems?
715bd8deadSopenharmony_ci
725bd8deadSopenharmony_ciNew Procedures and Functions
735bd8deadSopenharmony_ci
745bd8deadSopenharmony_ci    void glXCushionSGI(Display *dpy, Window window, float cushion);
755bd8deadSopenharmony_ci
765bd8deadSopenharmony_ciNew Tokens
775bd8deadSopenharmony_ci
785bd8deadSopenharmony_ci    Accepted by the <attribList> parameter of glXChooseVisual, and by the
795bd8deadSopenharmony_ci    <attrib> parameter of glXGetConfig:
805bd8deadSopenharmony_ci
815bd8deadSopenharmony_ci	GLX_CUSHION_BUFFERS_SGI
825bd8deadSopenharmony_ci
835bd8deadSopenharmony_ciAdditions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
845bd8deadSopenharmony_ci
855bd8deadSopenharmony_ci    None
865bd8deadSopenharmony_ci
875bd8deadSopenharmony_ciAdditions to Chapter 3 of the 1.0 Specification (Rasterization)
885bd8deadSopenharmony_ci
895bd8deadSopenharmony_ci    None
905bd8deadSopenharmony_ci
915bd8deadSopenharmony_ciAdditions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
925bd8deadSopenharmony_ciand the Frame Buffer)
935bd8deadSopenharmony_ci
945bd8deadSopenharmony_ci    None
955bd8deadSopenharmony_ci
965bd8deadSopenharmony_ciAdditions to Chapter 5 of the 1.0 Specification (Special Functions)
975bd8deadSopenharmony_ci
985bd8deadSopenharmony_ci    None
995bd8deadSopenharmony_ci
1005bd8deadSopenharmony_ciAdditions to Chapter 6 of the 1.0 Specification (State and State Requests)
1015bd8deadSopenharmony_ci
1025bd8deadSopenharmony_ci    None
1035bd8deadSopenharmony_ci
1045bd8deadSopenharmony_ciAdditions to the GLX Specification
1055bd8deadSopenharmony_ci
1065bd8deadSopenharmony_ci    This extension increases the number of color buffers of a double
1075bd8deadSopenharmony_ci    buffered visual.  The additional buffers are referred to as cushion
1085bd8deadSopenharmony_ci    buffers.  It is not possible for an application to directly access
1095bd8deadSopenharmony_ci    a cushion buffer -- access is provided only to the front and back
1105bd8deadSopenharmony_ci    buffers (as before).
1115bd8deadSopenharmony_ci
1125bd8deadSopenharmony_ci    When glXSwapBuffers is executed, the contents of the back buffer are
1135bd8deadSopenharmony_ci    transferred to the front buffer, which is itself appended onto a queue
1145bd8deadSopenharmony_ci    of displayable buffers.  However, the contents of the front buffer
1155bd8deadSopenharmony_ci    will not typically be transferred to the back buffer.  Instead, the
1165bd8deadSopenharmony_ci    contents of the back buffer are undefined.  Said another way, the
1175bd8deadSopenharmony_ci    front buffer is the color buffer most recently appended to the queue
1185bd8deadSopenharmony_ci    of displayable buffers, and the back buffer is the color buffer that
1195bd8deadSopenharmony_ci    will next be appended to this queue.
1205bd8deadSopenharmony_ci
1215bd8deadSopenharmony_ci    When a buffer is appended onto the queue of displayable buffers, the
1225bd8deadSopenharmony_ci    current value of the swap interval (specified by glXSwapIntervalSGI) is
1235bd8deadSopenharmony_ci    stored with it.  The display is always driven by the oldest displayable
1245bd8deadSopenharmony_ci    buffer in the queue of displayable buffers.  After the oldest buffer in
1255bd8deadSopenharmony_ci    the queue has been displayed for its specified number of video frame
1265bd8deadSopenharmony_ci    periods, it is removed from the queue, exposing the next-to-oldest
1275bd8deadSopenharmony_ci    buffer for display.  If there is only one buffer in the queue of
1285bd8deadSopenharmony_ci    displayable buffers, the removal is deferred until another buffer
1295bd8deadSopenharmony_ci    becomes displayable, and then until the next video frame boundary.
1305bd8deadSopenharmony_ci
1315bd8deadSopenharmony_ci    Cushion buffers are used to store displayable buffers on the queue.
1325bd8deadSopenharmony_ci    There can be at most N+1 buffers in the queue of displayable buffers,
1335bd8deadSopenharmony_ci    where N is the number of cushion buffers.  N is queried by calling
1345bd8deadSopenharmony_ci    glXGetConfig with <attrib> set to GLX_CUSHION_BUFFERS_SGI.
1355bd8deadSopenharmony_ci
1365bd8deadSopenharmony_ci    The new command
1375bd8deadSopenharmony_ci
1385bd8deadSopenharmony_ci	voidglXCushionSGI(Display *dpy, Window window, float cushion)
1395bd8deadSopenharmony_ci
1405bd8deadSopenharmony_ci    specifies a cushion value for a window.  This value is silently clamped
1415bd8deadSopenharmony_ci    to the continuous range [0,N], where N is the number of cushion buffers.
1425bd8deadSopenharmony_ci    When a window is created, the cushion value is initialized to zero.
1435bd8deadSopenharmony_ci
1445bd8deadSopenharmony_ci    Let the remaining display time T for a buffer in the queue of
1455bd8deadSopenharmony_ci    displayable buffers be the swap interval value for that buffer, minus
1465bd8deadSopenharmony_ci    the (fractional) number of video periods that the buffer has already
1475bd8deadSopenharmony_ci    been displayed.  If T thus defined would be negative, then let T be
1485bd8deadSopenharmony_ci    the fraction of the current video display period that remains.  (During
1495bd8deadSopenharmony_ci    the "vertical retrace period" this fraction is zero.)  Let Q be the sum
1505bd8deadSopenharmony_ci    of the remaining display times T for each buffer in the queue of
1515bd8deadSopenharmony_ci    displayable buffers.  If Q is greater than the product of the current
1525bd8deadSopenharmony_ci    cushion value and the current swap interval, then glXSwapBuffers stalls
1535bd8deadSopenharmony_ci    until at least the moment that Q becomes less than this product.  While
1545bd8deadSopenharmony_ci    glXSwapBuffers is stalled, the queueing of the back buffer as the next
1555bd8deadSopenharmony_ci    displayable buffer is deferred, and the calling process is either not
1565bd8deadSopenharmony_ci    allowed to proceed (glXSwapBuffers doesn't return) or the subsequent GL
1575bd8deadSopenharmony_ci    command is not allowed to be issued.
1585bd8deadSopenharmony_ci    
1595bd8deadSopenharmony_ci    (An interrupt could be generated at the moment that Q becomes equal to
1605bd8deadSopenharmony_ci    the product of the current cushion value and the current swap interval.)
1615bd8deadSopenharmony_ci
1625bd8deadSopenharmony_ci    The <attribList> parameter of glXChooseVisual may include
1635bd8deadSopenharmony_ci    GLX_CUSHION_BUFFERS_SGI, followed by an integer specifying the minimum
1645bd8deadSopenharmony_ci    number of cushion buffers.  (If GLX_CUSHION_BUFFERS_SGI is not included
1655bd8deadSopenharmony_ci    in the attribute list, then the minimum is zero.)  glXChooseVisual gives
1665bd8deadSopenharmony_ci    preference to the conforming visual with the smallest number of cushion
1675bd8deadSopenharmony_ci    buffers that is greater than or equal to the specified minimum.
1685bd8deadSopenharmony_ci
1695bd8deadSopenharmony_ci    Notes
1705bd8deadSopenharmony_ci    -----
1715bd8deadSopenharmony_ci
1725bd8deadSopenharmony_ci	*   This extension is designed so that cushion buffers can be added
1735bd8deadSopenharmony_ci	    to existing visuals.  It is intended that the semantics of this
1745bd8deadSopenharmony_ci	    extension be identical to the pre-extension semantics while the
1755bd8deadSopenharmony_ci	    cushion value is zero.  Cushion buffers need not be allocated
1765bd8deadSopenharmony_ci	    until the cushion is set greater than zero.
1775bd8deadSopenharmony_ci
1785bd8deadSopenharmony_ci	*   The extension can be implemented with data copies, in which case
1795bd8deadSopenharmony_ci	    a potentially large number of cushion buffers can be supported.
1805bd8deadSopenharmony_ci	    Or it can be implemented using the 4 stereo buffers (and while
1815bd8deadSopenharmony_ci	    holding the left/right signal constant at right).  Using the
1825bd8deadSopenharmony_ci	    stereo buffers eliminates the need for data copies, thus
1835bd8deadSopenharmony_ci	    increasing the performance.
1845bd8deadSopenharmony_ci
1855bd8deadSopenharmony_ci	*   This specification applies to both mono and stereo visuals,
1865bd8deadSopenharmony_ci	    but implementations will probably not support stereo visuals.
1875bd8deadSopenharmony_ci
1885bd8deadSopenharmony_ci	*   An implementation can support the extension without providing
1895bd8deadSopenharmony_ci	    any cushion buffer visuals.
1905bd8deadSopenharmony_ci
1915bd8deadSopenharmony_ciGLX Protocol
1925bd8deadSopenharmony_ci
1935bd8deadSopenharmony_ci    XXX - not done yet
1945bd8deadSopenharmony_ci
1955bd8deadSopenharmony_ciDependencies on SGI_swap_control
1965bd8deadSopenharmony_ci
1975bd8deadSopenharmony_ci    This extension requires SGI_swap_control.
1985bd8deadSopenharmony_ci
1995bd8deadSopenharmony_ciDependencies on SGI_video_sync
2005bd8deadSopenharmony_ci
2015bd8deadSopenharmony_ci    XXX - not done yet
2025bd8deadSopenharmony_ci
2035bd8deadSopenharmony_ciDependencies on SGIX_fbconfig
2045bd8deadSopenharmony_ci
2055bd8deadSopenharmony_ci    XXX - not done yet
2065bd8deadSopenharmony_ci
2075bd8deadSopenharmony_ciErrors
2085bd8deadSopenharmony_ci
2095bd8deadSopenharmony_ci    XXX - not done yet
2105bd8deadSopenharmony_ci
2115bd8deadSopenharmony_ciNew State
2125bd8deadSopenharmony_ci						Initial
2135bd8deadSopenharmony_ci    Get Value		Get Command	Type	Value	Attrib
2145bd8deadSopenharmony_ci    ---------		-----------	----	-------	------
2155bd8deadSopenharmony_ci    GLX_CUSHION_SGI	?		Z+	0.0	window state
2165bd8deadSopenharmony_ci
2175bd8deadSopenharmony_ciNew Implementation Dependent State
2185bd8deadSopenharmony_ci
2195bd8deadSopenharmony_ci    None
220