1Name 2 3 NV_swap_group 4 5Name Strings 6 7 GLX_NV_swap_group 8 9Notice 10 11 Copyright NVIDIA Corporation, 2003. 12 13Status 14 15 Shipping since 2003 on Quadro GPUs with framelock support 16 17Version 18 19 Date: 02/20/2008 Revision: 1.0 20 21Number 22 23 350 24 25Dependencies 26 27 Written based on the wording of the GLX_SGIX_swap_group and 28 GLX_SGIX_swap_barrier specifications. 29 30 SGIX_swap_control affects the definition of this extension 31 32Overview 33 34 This extension provides the capability to synchronize the buffer 35 swaps of a group of OpenGL windows. A swap group is created, and 36 windows are added as members to the swap group. Buffer swaps to 37 members of the swap group will then take place concurrently. 38 39 This extension also provides the capability to sychronize the buffer 40 swaps of different swap groups, which may reside on distributed 41 systems on a network. For this purpose swap groups can be bound to 42 a swap barrier. 43 44 This extension extends the set of conditions that must be met before 45 a buffer swap can take place. 46 47Issues 48 49 An implementation can not guarantee that the initialization of the swap 50 groups or barriers will succeed because the state of the window system may 51 restrict the usage of these features. Once a swap group or barrier has 52 been sucessfully initialized, the implementation can only guarantee to 53 sustain swap group functionality as long as the state of the window system 54 does not restrict this. An example for a state that does typically not 55 restrict swap group usage is the use of one fullscreen sized window per 56 desktop. 57 58New Procedures and Functions 59 60 Bool glXJoinSwapGroupNV(Display *dpy, 61 GLXDrawable drawable, 62 GLuint group); 63 64 Bool glXBindSwapBarrierNV(Display *dpy, 65 GLuint group, 66 GLuint barrier); 67 68 Bool glXQuerySwapGroupNV(Display *dpy, 69 GLXDrawable drawable, 70 GLuint *group, 71 GLuint *barrier); 72 73 Bool glXQueryMaxSwapGroupsNV(Display *dpy, 74 int screen, 75 GLuint *maxGroups, 76 GLuint *maxBarriers); 77 78 Bool glXQueryFrameCountNV(Display *dpy, 79 int screen, 80 GLuint *count); 81 82 Bool glXResetFrameCountNV(Display *dpy, 83 int screen); 84 85New Tokens 86 87 none 88 89Additions to the GLX Specification 90 91 Add to section 3.2.6, Double Buffering: 92 93 glXJoinSwapGroupNV adds <drawable> to the swap group specified by 94 <group>. If <drawable> is already a member of a different group, 95 it is implicitly removed from that group first. A swap group is 96 specified as an integer value between 0 and the value returned in 97 <maxGroups> by glXQueryMaxSwapGroupsNV. If <group> is zero, the 98 drawable is unbound from its current group, if any. If <group> is 99 larger than <maxGroups>, glXJoinSwapGroupNV fails. 100 101 glXJoinSwapGroupNV returns True if <drawable> has been 102 successfully bound to <group> and False if it fails. 103 104 glXBindSwapBarrierNV binds the swap group specified by <group> to 105 <barrier>. <barrier> is an integer value between 0 and the value 106 returned in <maxBarriers> by glXQueryMaxSwapGroupsNV. If <barrier> 107 is zero, the group is unbound from its current barrier, if any. If 108 <barrier> is larger than <maxBarriers>, glXBindSwapBarrierNV 109 fails. Subsequent buffer swaps for that group will be subject to 110 this binding, until the group is unbound from <barrier>. 111 112 glXBindSwapBarrierNV returns True if <group> has been successfully 113 bound to <barrier> and False if it fails. 114 115 glXQuerySwapGroupNV returns in <group> and <barrier> the group and 116 barrier currently bound to <drawable,>, if any. 117 118 glXQuerySwapGroupNV returns True if <group> and <barrier> could be 119 successfully queried for <drawable> and False if it fails. If it 120 fails, the values of <group> and <barrier> are undefined. 121 122 glXQueryMaxSwapGroupsNV returns in <maxGroups> and <maxBarriers> 123 the maximum number of swap groups and barriers supported by an 124 implementation which drives <screen> and <dpy>. 125 126 glXQueryMaxSwapGroupsNV returns True if <maxGroups> and <maxBarriers> 127 could be successfully queried for <screen> and <dpy>, and False if 128 it fails. If it fails, the values of <maxGroups> and <maxBarriers> 129 are undefined. 130 131 Before a buffer swap can take place, a set of conditions must be 132 satisfied. The conditions are defined in terms of the notions of 133 when a drawable is ready to swap and when a group is ready to swap. 134 135 GLX drawables except windows are always ready to swap. 136 137 When a window is unmapped, it is always ready. 138 139 A window is ready when all of the following are true: 140 141 1. A buffer swap command has been issued for it. 142 143 2. Its swap interval has elapsed. 144 145 A group is ready when the following is true: 146 147 1. All windows in the group are ready. 148 149 All of the following must be satisfied before a buffer swap for a 150 window can take place: 151 152 1. The window is ready. 153 154 2. If the window belongs to a group, the group is ready. 155 156 3. If the window belongs to a group and that group is bound to a 157 barrier, all groups using that barrier are ready. 158 159 Buffer swaps for all windows in a swap group will take place 160 concurrently after the conditions are satisfied for every window in 161 the group. 162 163 Buffer swaps for all groups using a barrier will take place 164 concurrently after the conditions are satisfied for every window of 165 every group using the barrier, if and only if the vertical retraces 166 of the screens of all the groups are synchronized. If they are not 167 synchronized, there is no guarantee of concurrency between groups. 168 169 An implementation may support a limited number of swap groups and 170 barriers, and may have restrictions on where the users of a barrier 171 can reside. For example, an implementation may allow the users to 172 reside on different display devices or even hosts. 173 174 An implementation may return zero for any of <maxGroups> and 175 <maxBarriers> returned by glXQueryMaxSwapGroupsNV if swap groups or 176 barriers are not available in that implementation or on that host. 177 178 The implementation provides a universal counter, the so called 179 frame counter, among all systems that are locked together by swap 180 groups/barriers. It is based on the internal synchronization 181 signal which triggers the buffer swap. 182 183 glXQueryFrameCountNV returns in <count> the current frame counter 184 for <swapGroup>. 185 186 glXQueryFrameCountNV returns TRUE if the frame counter could be 187 successfully retrieved. Otherwise it returns FALSE. 188 189 glXResetFrameCountNV resets the frame counter of <swapGroup> to zero. 190 191 glXResetFrameCountNV returns TRUE if the frame counter could be 192 successfully reset, otherwise it returns FALSE. In a system that 193 has an NVIDIA framelock add-on adapter installed and enabled, 194 glXResetFrameCountNV will only succeed when the framelock is 195 configured as a Master system. 196 197 glXJoinSwapGroupNV, glXBindSwapBarrierNV, glXQuerySwapGroupNV, 198 glXQueryMaxSwapGroupsNV, glXQueryFrameCountNV and 199 glXResetFrameCountNV are part of the X stream. 200 201Errors 202 203 glXJoinSwapGroupNV, glXQuerySwapGroupNV and glXQueryMaxSwapGroupsNV 204 generate GLXBadDrawable if <drawable> is an invalid GLX drawable. 205 206New State 207 208 None 209 210New Implementation Dependent State 211 212 None 213