1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgName
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    MESA_swap_control
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgName Strings
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    GLX_MESA_swap_control
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgContact
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    Ian Romanick, IBM, idr at us.ibm.com
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgStatus
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    Deployed in DRI drivers post-XFree86 4.3.
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgVersion
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    Date: 5/1/2003   Revision: 1.1
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgNumber
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    ???
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgDependencies
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    Based on GLX_SGI_swap_control version 1.9 and WGL_EXT_swap_control
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    version 1.5.
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgOverview
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    This extension allows an application to specify a minimum periodicity
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    of color buffer swaps, measured in video frame periods.
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgIssues
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * Should implementations that export GLX_MESA_swap_control also export
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org      GL_EXT_swap_control for compatibility with WGL_EXT_swap_control?
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    UNRESOLVED.
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgNew Procedures and Functions
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    int glXSwapIntervalMESA(unsigned int interval)
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    int glXGetSwapIntervalMESA(void)
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgNew Tokens
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgAdditions to Chapter 2 of the 1.4 GL Specification (OpenGL Operation)
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgAdditions to Chapter 3 of the 1.4 GL Specification (Rasterization)
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgAdditions to Chapter 4 of the 1.4 GL Specification (Per-Fragment Operations
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.organd the Framebuffer)
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgAdditions to Chapter 5 of the 1.4 GL Specification (Special Functions)
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgAdditions to Chapter 6 of the 1.4 GL Specification (State and State Requests)
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgAdditions to the GLX 1.3 Specification
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    [Add the following to Section 3.3.10 of the GLX Specification (Double
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org     Buffering)]
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    glXSwapIntervalMESA specifies the minimum number of video frame periods
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    per buffer swap.  (e.g. a value of two means that the color buffers
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    will be swapped at most every other video frame.)  A return value
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    of zero indicates success; otherwise an error occurred.  The interval
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    takes effect when glXSwapBuffers is first called subsequent to the
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    glXSwapIntervalMESA call.
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    A video frame period is the time required by the monitor to display a 
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    full frame of video data.  In the case of an interlaced monitor,
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    this is typically the time required to display both the even and odd 
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    fields of a frame of video data.
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    If <interval> is set to a value of 0, buffer swaps are not synchro-
92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    nized to a video frame.  The <interval> value is silently clamped to
93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    the maximum implementation-dependent value supported before being
94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    stored.
95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    The swap interval is not part of the render context state.  It cannot
97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    be pushed or popped.  The current swap interval for the window
98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    associated with the current context can be obtained by calling
99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    glXGetSwapIntervalMESA.  The default swap interval is 0.
100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    On XFree86, setting the environment variable LIBGL_THROTTLE_REFRESH sets
102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    the swap interval to 1.
103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgErrors
105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    glXSwapIntervalMESA returns GLX_BAD_CONTEXT if there is no current
107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    GLXContext or if the current context is not a direct rendering context.
108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgGLX Protocol
110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None.  This extension only extends to direct rendering contexts.
112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgNew State
114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    Get Value		Get Command	Type	    Initial Value
116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    ---------		-----------	----	    -------------
117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    [swap interval]	GetSwapInterval	Z+	    0
118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgNew Implementation Dependent State
120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    None
122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgRevision History
125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    1.1,  5/1/03   Added the issues section and contact information.
127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    	  	   Changed the default swap interval to 0.
128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    1.0,  3/17/03  Initial version based on GLX_SGI_swap_control and
129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                   WGL_EXT_swap_control.
130