1Name 2 3 EXT_swap_control_tear 4 5Name Strings 6 7 GLX_EXT_swap_control_tear 8 9Contributors 10 11 Brian Nguyen, NVIDIA, brnguyen at nvidia.com 12 13Contact 14 15 Brian Nguyen, NVIDIA, brnguyen at nvidia.com 16 17Status 18 19 Complete. 20 21Version 22 23 Version 1 (November 4, 2011) 24 25Number 26 27 414 28 29Dependencies 30 31 This specification is written against the GLX 1.4 specification, but 32 only GLX 1.1 or greater with the ARB_get_proc_address extension is 33 required, for glXQueryExtensionString and glXGetProcAddressARB 34 respectively. 35 36 GLX_EXT_swap_control is required. 37 38 Based on WGL_EXT_swap_control_tear version 1. 39 40 This extension affects GLX_NV_swap_group. 41 42Overview 43 44 This extension extends the existing GLX_EXT_swap_control extension by 45 allowing a negative <interval> parameter to glXSwapIntervalEXT. The 46 negative <interval> allows late swaps to occur without synchronization 47 to the video frame. This reduces the visual stutter on late frames and 48 reduces the stall on subsequent frames. 49 50IP Status 51 52 There are no known IP issues. 53 54Issues 55 56 This extension is incompatible with GLX_NV_swap_group. If a drawable is 57 currently part of a swap group, late unsynchronized swaps will implicitly be 58 disabled for that drawable. 59 60New Procedures and Functions 61 62 None 63 64New Tokens 65 66 GLX_LATE_SWAPS_TEAR_EXT 0x20F3 67 68Additions to Chapter 2 of the OpenGL 1.2.1 Specification (OpenGL 69Operation) 70 71 None. 72 73Additions to Chapter 3 of the OpenGL 1.2.1 Specification (Rasterization) 74 75 None. 76 77Additions to Chapter 4 of the OpenGL 1.2.1 Specification (Per-Fragment 78Operations and the Frame Buffer) 79 80 None. 81 82Additions to Chapter 5 of the OpenGL 1.2.1 Specification (Special 83Functions) 84 85 None. 86 87Additions to Chapter 6 of the OpenGL 1.2.1 Specification (State and 88State Requests) 89 90 None. 91 92Additions to the GLX 1.4 Specification 93 94 In Section 3.3.10 of the GLX specification (Double 95 Buffering), after the following paragraph: 96 97 "If <interval> is set to a value of 0, buffer swaps are not 98 synchronized to a video frame. The <interval> value is silently 99 clamped to the maximum implementation-dependent value supported 100 before being stored." 101 102 Add the following paragraph: 103 104 "If <interval> is negative, the minimum number of video frames between 105 buffer swaps is the absolute value of <interval>. In this case, if 106 abs(<interval>) video frames have already passed from the previous swap 107 when the swap is ready to be performed, the swap will occur without 108 synchronization to a video frame. When an unsynchronized swap happens, 109 the missed frame will count towards the minimum number of video frames 110 for the next swap." 111 112 In Section 3.3.10 of the GLX specification (Double 113 Buffering), modify the paragraph beginning: 114 115 "The current swap interval and implementation-dependent max swap 116 interval for a particular drawable..." 117 118 To read: 119 120 "The current swap interval and implementation-dependent max swap 121 interval for a particular drawable can be obtained by calling 122 glXQueryDrawable with the attributes GLX_SWAP_INTERVAL_EXT and 123 GLX_MAX_SWAP_INTERVAL_EXT respectively. The application can also 124 determine whether a particular drawable allows late unsynchronized 125 swaps to occur by calling glXQueryDrawable with the attribute 126 GLX_LATE_SWAPS_TEAR_EXT. If late swaps are enabled, <value> will 127 be set to 1; otherwise, it will be set to 0. The value returned by 128 glXQueryDrawable is undefined if the drawable is not a GLXWindow 129 and these attributes are given." 130 131Errors 132 133 Remove the following error from GLX_EXT_swap_control: 134 135 "glXSwapIntervalEXT generates BadValue if parameter <interval> is 136 less than zero." 137 138Usage Examples 139 140 Example 1: Set swap interval for the current drawable 141 142 Display *dpy = glXGetCurrentDisplay(); 143 GLXDrawable drawable = glXGetCurrentDrawable(); 144 const int interval = -1; 145 146 glXSwapIntervalEXT(dpy, drawable, interval); 147 148Version History 149 150 1. 04 Nov 2011 - BrianN 151 -Initial version 152