1Name 2 3 NV_swap_group 4 5Name Strings 6 7 WGL_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: 09/08/2009 Revision: 1.0 20 21Number 22 23 351 24 25Dependencies 26 27 Written based on the wording of the GLX_SGIX_swap_group and 28 GLX_SGIX_swap_barrier specifications. 29 30 WGL_EXT_swap_control affects the definition of this extension. 31 WGL_EXT_swap_frame_lock affects the definition of this extension. 32 33Overview 34 35 This extension provides the capability to synchronize the buffer swaps 36 of a group of OpenGL windows. A swap group is created, and windows are 37 added as members to the swap group. Buffer swaps to members of the swap 38 group will then take place concurrently. 39 40 This extension also provides the capability to sychronize the buffer 41 swaps of different swap groups, which may reside on distributed systems 42 on a network. For this purpose swap groups can be bound to 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 windows desktop. 57 58New Procedures and Functions 59 60 BOOL wglJoinSwapGroupNV(HDC hDC, 61 GLuint group); 62 63 BOOL wglBindSwapBarrierNV(GLuint group, 64 GLuint barrier); 65 66 BOOL wglQuerySwapGroupNV(HDC hDC, 67 GLuint *group, 68 GLuint *barrier); 69 70 BOOL wglQueryMaxSwapGroupsNV(HDC hDC, 71 GLuint *maxGroups, 72 GLuint *maxBarriers); 73 74 BOOL wglQueryFrameCountNV(HDC hDC, 75 GLuint *count); 76 77 BOOL wglResetFrameCountNV(HDC hDC); 78 79New Tokens 80 81 none 82 83Additions to the WGL Specification 84 85 Add to section 3.2.6, Double Buffering: 86 87 wglJoinSwapGroupNV adds <hDC> to the swap group specified by <group>. 88 If <hDC> is already a member of a different group, it is 89 implicitly removed from that group first. A swap group is specified as 90 an integer value between 0 and the value returned in <maxGroups> by 91 wglQueryMaxSwapGroupsNV. If <group> is zero, the hDC is unbound from its 92 current group, if any. If <group> is larger than <maxGroups>, 93 wglJoinSwapGroupNV fails. 94 95 wglJoinSwapGroupNV returns True if <hDC> has been successfully bound to 96 <group> and False if it fails. 97 98 wglBindSwapBarrierNV binds the swap group specified by <group> to <barrier>. 99 <barrier> is an integer value between 0 and the value returned in 100 <maxBarriers> by wglQueryMaxSwapGroupsNV. If <barrier> is zero, the group is 101 unbound from its current barrier, if any. If <barrier> is larger than 102 <maxBarriers>, wglBindSwapBarrierNV fails. 103 Subsequent buffer swaps for that group will be subject to this binding, 104 until the group is unbound from <barrier>. 105 106 wglBindSwapBarrierNV returns True if <group> has been successfully bound to 107 <barrier> and False if it fails. 108 109 wglQuerySwapGroupNV returns in <group> and <barrier> the group and barrier 110 currently bound to hDC, if any. 111 112 wglQuerySwapGroupNV returns True if <group> and <barrier> could be successfully 113 queried for <hDC> and False if it fails. 114 If it fails, the values of <group> and <barrier> are undefined. 115 116 wglQueryMaxSwapGroupsNV returns in <maxGroups> and <maxBarriers> the maximum 117 number of swap groups and barriers supported by an implementation which 118 drives window <hDC>. 119 120 wglQueryMaxSwapGroupsNV returns True if <maxGroups> and <maxBarriers> could be 121 successfully queried for <hDC> and False if it fails. 122 If it fails, the values of <maxGroups> and <maxBarriers> are undefined. 123 124 Before a buffer swap can take place, a set of conditions must be 125 satisfied. The conditions are defined in terms of the notions of when 126 a window is ready to swap and when a group is ready to swap. 127 128 Any hDC that is not a window (i.e. a non-visible rendering buffer) is always 129 ready. 130 131 A window is ready when all of the following are true: 132 133 1. A buffer swap command has been issued for it. 134 135 2. Its swap interval has elapsed. 136 137 A group is ready when the following is true: 138 139 1. All windows in the group are ready. 140 141 All of the following must be satisfied before a buffer swap for a window 142 can take place: 143 144 1. The window is ready. 145 146 2. If the window belongs to a group, the group is ready. 147 148 3. If the window belongs to a group and that group is bound to a 149 barrier, all groups using that barrier are ready. 150 151 Buffer swaps for all windows in a swap group will take place concurrently 152 after the conditions are satisfied for every window in the group. 153 154 Buffer swaps for all groups using a barrier will take place concurrently 155 after the conditions are satisfied for every window of every group using 156 the barrier, if and only if the vertical retraces of the screens of all 157 the groups are synchronized. If they are not synchronized, there is no 158 guarantee of concurrency between groups. 159 160 An implementation may support a limited number of swap groups and barriers, 161 and may have restrictions on where the users of a barrier can reside. 162 For example, an implementation may allow the users to reside on different 163 display devices or even hosts. 164 An implementation may return zero for any of <maxGroups> and <maxBarriers> 165 returned by wglQueryMaxSwapGroupsNV if swap groups or barriers are not 166 available in that implementation or on that host. 167 168 The implementation provides a universal counter, the so called frame counter, 169 among all systems that are locked together by swap groups/barriers. It is 170 based on the internal synchronization signal which triggers the buffer swap. 171 172 wglQueryFrameCountNV returns in <count> the current frame counter for 173 <swapGroup>. 174 175 wglQueryFrameCountNV returns TRUE if the frame counter could be successfully 176 retrieved. Otherwise it returns FALSE. 177 178 wglResetFrameCountNV resets the frame counter of <swapGroup> to zero. 179 180 wglResetFrameCountNV returns TRUE if the frame counter could be successfully 181 reset, otherwise it returns FALSE. In a system that has an NVIDIA framelock 182 add-on adapter installed and enabled, wglResetFrameCountNV will only succeed when 183 the framelock is configured as a Master system. 184 185Errors 186 187 wglJoinSwapGroupNV, wglQuerySwapGroupNV and wglQueryMaxSwapGroupsNV generate 188 ERROR_DC_NOT_FOUND if <hDC> is not a valid HDC. 189 190New State 191 192 None 193 194New Implementation Dependent State 195 196 None 197