On Wed, Dec 18, 2002 at 09:28:24AM -0800, Sottek, Matthew J wrote: > Does OpenGL make any requirements on the atomic-ness (atomicity?) of > a buffer flip? If so, I would assert that allowing part of a flip to > be visible on one frame and the rest visible on the next is not > a valid implementation and therefore the non-tearing implementation is > a requirement not a feature.
Brian may know better, but I believe that core OpenGL makes no claims about the timing of buffer swap operations. I believe that is completely in the domain of the windowing interface layer. In terms of WGL and GLX, I believe that, without GLX_SGI_swap_control, GLX_SGI_video_sync, or GLX_OML_sync_control (or the WGL synonyms), there is no guarantee either. With GLX_SGI_swap_control, there is a guarantee of at least N (where N is 1 at context creation) vertical refereshes between buffer swaps. N can be set using glXSwapIntervalSGI. http://oss.sgi.com/projects/ogl-sample/registry/SGI/swap_control.txt With GLX_OML_sync_control, the application has even more control. The function glXSwapBuffersMscOML allows the application to specify that the swap happen when a specific refresh has happened or when the refresh number satisfies the equation ((frame % D) == R). http://oss.sgi.com/projects/ogl-sample/registry/OML/glx_sync_control.txt That said, neither of these extensions is /currently/ supported by DRI. I emphasise currently because I'm done implementing the device independent parts of both extensions, and I'm about 90% complete implementing the device dependent parts for the Radeon and MGA drivers. Hopefully, all of that code will be commited to the texmem-0-0-1 branch by the end of the year. Hopefully. If async (wrt to code execution, not wrt to vertical retrace) swaps are to be done in the i8xx drivers (which is a VERY GOOD idea), you will NEED a mechanism to know when the swap has happened. One part of the OML extension is the ability to query the number of buffer swap operations that have COMPLETED. The other extension that is interesting and is related to this is WGL_I3D_swap_frame_usage. http://oss.sgi.com/projects/ogl-sample/registry/I3D/wgl_swap_frame_usage.txt As long as the i8xx drivers can be made to support GLX_SGI_swap_control, GLX_OML_sync_control, and GLX_SGI_video_sync (really just a subset of GLX_OML_sync_control), go nuts! :) > On the other hand, if everyone is used to having no guarantee of > non-tearing behavior then they would likely not welcome the change. > Things like running gears at X FPS would certainly be slowed down. > > BTW: Did you go with "wait for scanline" or "wait for vblank"? The > latter is more invasive... if you were doing multiple windowed > clients there would only be ONE buffer flip per retrace to be shared > between the clients. Doing some sort of syncing to prevent tearing is a Good Thing(tm). The other drivers that implement this sort of functionality control it with environment variables. Look at radeonWaitForVBlank in lib/GL/mesa/src/drv/radeon/radeon_ioctl.c. It would probably be a good idea to do so here as well. -- Smile! http://antwrp.gsfc.nasa.gov/apod/ap990315.html ------------------------------------------------------- This SF.NET email is sponsored by: Order your Holiday Geek Presents Now! Green Lasers, Hip Geek T-Shirts, Remote Control Tanks, Caffeinated Soap, MP3 Players, XBox Games, Flying Saucers, WebCams, Smart Putty. T H I N K G E E K . C O M http://www.thinkgeek.com/sf/ _______________________________________________ Dri-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/dri-devel