15bd8deadSopenharmony_ciName 25bd8deadSopenharmony_ci 35bd8deadSopenharmony_ci NV_swap_group 45bd8deadSopenharmony_ci 55bd8deadSopenharmony_ciName Strings 65bd8deadSopenharmony_ci 75bd8deadSopenharmony_ci WGL_NV_swap_group 85bd8deadSopenharmony_ci 95bd8deadSopenharmony_ciNotice 105bd8deadSopenharmony_ci 115bd8deadSopenharmony_ci Copyright NVIDIA Corporation, 2003. 125bd8deadSopenharmony_ci 135bd8deadSopenharmony_ciStatus 145bd8deadSopenharmony_ci 155bd8deadSopenharmony_ci Shipping since 2003 on Quadro GPUs with framelock support 165bd8deadSopenharmony_ci 175bd8deadSopenharmony_ciVersion 185bd8deadSopenharmony_ci 195bd8deadSopenharmony_ci Date: 09/08/2009 Revision: 1.0 205bd8deadSopenharmony_ci 215bd8deadSopenharmony_ciNumber 225bd8deadSopenharmony_ci 235bd8deadSopenharmony_ci 351 245bd8deadSopenharmony_ci 255bd8deadSopenharmony_ciDependencies 265bd8deadSopenharmony_ci 275bd8deadSopenharmony_ci Written based on the wording of the GLX_SGIX_swap_group and 285bd8deadSopenharmony_ci GLX_SGIX_swap_barrier specifications. 295bd8deadSopenharmony_ci 305bd8deadSopenharmony_ci WGL_EXT_swap_control affects the definition of this extension. 315bd8deadSopenharmony_ci WGL_EXT_swap_frame_lock affects the definition of this extension. 325bd8deadSopenharmony_ci 335bd8deadSopenharmony_ciOverview 345bd8deadSopenharmony_ci 355bd8deadSopenharmony_ci This extension provides the capability to synchronize the buffer swaps 365bd8deadSopenharmony_ci of a group of OpenGL windows. A swap group is created, and windows are 375bd8deadSopenharmony_ci added as members to the swap group. Buffer swaps to members of the swap 385bd8deadSopenharmony_ci group will then take place concurrently. 395bd8deadSopenharmony_ci 405bd8deadSopenharmony_ci This extension also provides the capability to sychronize the buffer 415bd8deadSopenharmony_ci swaps of different swap groups, which may reside on distributed systems 425bd8deadSopenharmony_ci on a network. For this purpose swap groups can be bound to a swap barrier. 435bd8deadSopenharmony_ci 445bd8deadSopenharmony_ci This extension extends the set of conditions that must be met before 455bd8deadSopenharmony_ci a buffer swap can take place. 465bd8deadSopenharmony_ci 475bd8deadSopenharmony_ciIssues 485bd8deadSopenharmony_ci 495bd8deadSopenharmony_ci An implementation can not guarantee that the initialization of the swap 505bd8deadSopenharmony_ci groups or barriers will succeed because the state of the window system may 515bd8deadSopenharmony_ci restrict the usage of these features. Once a swap group or barrier has 525bd8deadSopenharmony_ci been sucessfully initialized, the implementation can only guarantee to 535bd8deadSopenharmony_ci sustain swap group functionality as long as the state of the window system 545bd8deadSopenharmony_ci does not restrict this. An example for a state that does typically not 555bd8deadSopenharmony_ci restrict swap group usage is the use of one fullscreen sized window per 565bd8deadSopenharmony_ci windows desktop. 575bd8deadSopenharmony_ci 585bd8deadSopenharmony_ciNew Procedures and Functions 595bd8deadSopenharmony_ci 605bd8deadSopenharmony_ci BOOL wglJoinSwapGroupNV(HDC hDC, 615bd8deadSopenharmony_ci GLuint group); 625bd8deadSopenharmony_ci 635bd8deadSopenharmony_ci BOOL wglBindSwapBarrierNV(GLuint group, 645bd8deadSopenharmony_ci GLuint barrier); 655bd8deadSopenharmony_ci 665bd8deadSopenharmony_ci BOOL wglQuerySwapGroupNV(HDC hDC, 675bd8deadSopenharmony_ci GLuint *group, 685bd8deadSopenharmony_ci GLuint *barrier); 695bd8deadSopenharmony_ci 705bd8deadSopenharmony_ci BOOL wglQueryMaxSwapGroupsNV(HDC hDC, 715bd8deadSopenharmony_ci GLuint *maxGroups, 725bd8deadSopenharmony_ci GLuint *maxBarriers); 735bd8deadSopenharmony_ci 745bd8deadSopenharmony_ci BOOL wglQueryFrameCountNV(HDC hDC, 755bd8deadSopenharmony_ci GLuint *count); 765bd8deadSopenharmony_ci 775bd8deadSopenharmony_ci BOOL wglResetFrameCountNV(HDC hDC); 785bd8deadSopenharmony_ci 795bd8deadSopenharmony_ciNew Tokens 805bd8deadSopenharmony_ci 815bd8deadSopenharmony_ci none 825bd8deadSopenharmony_ci 835bd8deadSopenharmony_ciAdditions to the WGL Specification 845bd8deadSopenharmony_ci 855bd8deadSopenharmony_ci Add to section 3.2.6, Double Buffering: 865bd8deadSopenharmony_ci 875bd8deadSopenharmony_ci wglJoinSwapGroupNV adds <hDC> to the swap group specified by <group>. 885bd8deadSopenharmony_ci If <hDC> is already a member of a different group, it is 895bd8deadSopenharmony_ci implicitly removed from that group first. A swap group is specified as 905bd8deadSopenharmony_ci an integer value between 0 and the value returned in <maxGroups> by 915bd8deadSopenharmony_ci wglQueryMaxSwapGroupsNV. If <group> is zero, the hDC is unbound from its 925bd8deadSopenharmony_ci current group, if any. If <group> is larger than <maxGroups>, 935bd8deadSopenharmony_ci wglJoinSwapGroupNV fails. 945bd8deadSopenharmony_ci 955bd8deadSopenharmony_ci wglJoinSwapGroupNV returns True if <hDC> has been successfully bound to 965bd8deadSopenharmony_ci <group> and False if it fails. 975bd8deadSopenharmony_ci 985bd8deadSopenharmony_ci wglBindSwapBarrierNV binds the swap group specified by <group> to <barrier>. 995bd8deadSopenharmony_ci <barrier> is an integer value between 0 and the value returned in 1005bd8deadSopenharmony_ci <maxBarriers> by wglQueryMaxSwapGroupsNV. If <barrier> is zero, the group is 1015bd8deadSopenharmony_ci unbound from its current barrier, if any. If <barrier> is larger than 1025bd8deadSopenharmony_ci <maxBarriers>, wglBindSwapBarrierNV fails. 1035bd8deadSopenharmony_ci Subsequent buffer swaps for that group will be subject to this binding, 1045bd8deadSopenharmony_ci until the group is unbound from <barrier>. 1055bd8deadSopenharmony_ci 1065bd8deadSopenharmony_ci wglBindSwapBarrierNV returns True if <group> has been successfully bound to 1075bd8deadSopenharmony_ci <barrier> and False if it fails. 1085bd8deadSopenharmony_ci 1095bd8deadSopenharmony_ci wglQuerySwapGroupNV returns in <group> and <barrier> the group and barrier 1105bd8deadSopenharmony_ci currently bound to hDC, if any. 1115bd8deadSopenharmony_ci 1125bd8deadSopenharmony_ci wglQuerySwapGroupNV returns True if <group> and <barrier> could be successfully 1135bd8deadSopenharmony_ci queried for <hDC> and False if it fails. 1145bd8deadSopenharmony_ci If it fails, the values of <group> and <barrier> are undefined. 1155bd8deadSopenharmony_ci 1165bd8deadSopenharmony_ci wglQueryMaxSwapGroupsNV returns in <maxGroups> and <maxBarriers> the maximum 1175bd8deadSopenharmony_ci number of swap groups and barriers supported by an implementation which 1185bd8deadSopenharmony_ci drives window <hDC>. 1195bd8deadSopenharmony_ci 1205bd8deadSopenharmony_ci wglQueryMaxSwapGroupsNV returns True if <maxGroups> and <maxBarriers> could be 1215bd8deadSopenharmony_ci successfully queried for <hDC> and False if it fails. 1225bd8deadSopenharmony_ci If it fails, the values of <maxGroups> and <maxBarriers> are undefined. 1235bd8deadSopenharmony_ci 1245bd8deadSopenharmony_ci Before a buffer swap can take place, a set of conditions must be 1255bd8deadSopenharmony_ci satisfied. The conditions are defined in terms of the notions of when 1265bd8deadSopenharmony_ci a window is ready to swap and when a group is ready to swap. 1275bd8deadSopenharmony_ci 1285bd8deadSopenharmony_ci Any hDC that is not a window (i.e. a non-visible rendering buffer) is always 1295bd8deadSopenharmony_ci ready. 1305bd8deadSopenharmony_ci 1315bd8deadSopenharmony_ci A window is ready when all of the following are true: 1325bd8deadSopenharmony_ci 1335bd8deadSopenharmony_ci 1. A buffer swap command has been issued for it. 1345bd8deadSopenharmony_ci 1355bd8deadSopenharmony_ci 2. Its swap interval has elapsed. 1365bd8deadSopenharmony_ci 1375bd8deadSopenharmony_ci A group is ready when the following is true: 1385bd8deadSopenharmony_ci 1395bd8deadSopenharmony_ci 1. All windows in the group are ready. 1405bd8deadSopenharmony_ci 1415bd8deadSopenharmony_ci All of the following must be satisfied before a buffer swap for a window 1425bd8deadSopenharmony_ci can take place: 1435bd8deadSopenharmony_ci 1445bd8deadSopenharmony_ci 1. The window is ready. 1455bd8deadSopenharmony_ci 1465bd8deadSopenharmony_ci 2. If the window belongs to a group, the group is ready. 1475bd8deadSopenharmony_ci 1485bd8deadSopenharmony_ci 3. If the window belongs to a group and that group is bound to a 1495bd8deadSopenharmony_ci barrier, all groups using that barrier are ready. 1505bd8deadSopenharmony_ci 1515bd8deadSopenharmony_ci Buffer swaps for all windows in a swap group will take place concurrently 1525bd8deadSopenharmony_ci after the conditions are satisfied for every window in the group. 1535bd8deadSopenharmony_ci 1545bd8deadSopenharmony_ci Buffer swaps for all groups using a barrier will take place concurrently 1555bd8deadSopenharmony_ci after the conditions are satisfied for every window of every group using 1565bd8deadSopenharmony_ci the barrier, if and only if the vertical retraces of the screens of all 1575bd8deadSopenharmony_ci the groups are synchronized. If they are not synchronized, there is no 1585bd8deadSopenharmony_ci guarantee of concurrency between groups. 1595bd8deadSopenharmony_ci 1605bd8deadSopenharmony_ci An implementation may support a limited number of swap groups and barriers, 1615bd8deadSopenharmony_ci and may have restrictions on where the users of a barrier can reside. 1625bd8deadSopenharmony_ci For example, an implementation may allow the users to reside on different 1635bd8deadSopenharmony_ci display devices or even hosts. 1645bd8deadSopenharmony_ci An implementation may return zero for any of <maxGroups> and <maxBarriers> 1655bd8deadSopenharmony_ci returned by wglQueryMaxSwapGroupsNV if swap groups or barriers are not 1665bd8deadSopenharmony_ci available in that implementation or on that host. 1675bd8deadSopenharmony_ci 1685bd8deadSopenharmony_ci The implementation provides a universal counter, the so called frame counter, 1695bd8deadSopenharmony_ci among all systems that are locked together by swap groups/barriers. It is 1705bd8deadSopenharmony_ci based on the internal synchronization signal which triggers the buffer swap. 1715bd8deadSopenharmony_ci 1725bd8deadSopenharmony_ci wglQueryFrameCountNV returns in <count> the current frame counter for 1735bd8deadSopenharmony_ci <swapGroup>. 1745bd8deadSopenharmony_ci 1755bd8deadSopenharmony_ci wglQueryFrameCountNV returns TRUE if the frame counter could be successfully 1765bd8deadSopenharmony_ci retrieved. Otherwise it returns FALSE. 1775bd8deadSopenharmony_ci 1785bd8deadSopenharmony_ci wglResetFrameCountNV resets the frame counter of <swapGroup> to zero. 1795bd8deadSopenharmony_ci 1805bd8deadSopenharmony_ci wglResetFrameCountNV returns TRUE if the frame counter could be successfully 1815bd8deadSopenharmony_ci reset, otherwise it returns FALSE. In a system that has an NVIDIA framelock 1825bd8deadSopenharmony_ci add-on adapter installed and enabled, wglResetFrameCountNV will only succeed when 1835bd8deadSopenharmony_ci the framelock is configured as a Master system. 1845bd8deadSopenharmony_ci 1855bd8deadSopenharmony_ciErrors 1865bd8deadSopenharmony_ci 1875bd8deadSopenharmony_ci wglJoinSwapGroupNV, wglQuerySwapGroupNV and wglQueryMaxSwapGroupsNV generate 1885bd8deadSopenharmony_ci ERROR_DC_NOT_FOUND if <hDC> is not a valid HDC. 1895bd8deadSopenharmony_ci 1905bd8deadSopenharmony_ciNew State 1915bd8deadSopenharmony_ci 1925bd8deadSopenharmony_ci None 1935bd8deadSopenharmony_ci 1945bd8deadSopenharmony_ciNew Implementation Dependent State 1955bd8deadSopenharmony_ci 1965bd8deadSopenharmony_ci None 197