PDA

View Full Version : nvidia: wglSwapInterval ignored when FBO is bound



muhkuh
09-01-2010, 02:48 AM
Platforms:
Vista 64 bit, GeForce 8800 GTX, 197.45
FreeBSD 32 bit, GeForce FX 5200, 173.14.12
FreeBSD 32 bit, GeForce EMP 8, 185.18.29

When calling wglSwapInterval while an FBO is bound this call doesn't seem to have any effect. The same happens on X11 with glxSwapIntervalSGI. The workaround is easy but I think it's a bug, isn't it?

randall
09-01-2010, 10:02 AM
This is not a bug. wglSwapInterval instructs _default_ framebuffer (swap chain) not to wait for vsync. It has no effect on FBO.

mfort
09-01-2010, 12:15 PM
The specification says:
"wglSwapIntervalEXT specifies the minimum number of video frame periods per buffer swap for the window associated with the current context."

So having FBO or not, this API should change swap interval for associated window. FBO extension came after swap interval and they kept the wording intact.

Alfonse Reinheart
09-01-2010, 05:59 PM
So having FBO or not, this API should change swap interval for associated window. FBO extension came after swap interval and they kept the wording intact.

FBO cannot extend WGL/GLX, so it cannot modify the wording without being an explicit WGL/GLX extension.

The meaning of these functions is not clear when an FBO is bound, so it's best not to leave yourself open to such things. It may in fact be something NVIDIA wants to correct, but it's probably cleaner code to just bind the default framebuffer when you try to do these kinds of things.

muhkuh
09-02-2010, 01:27 AM
Yes. As I wrote it's easy to avoid this but it took me several hours until I realized what the problem was. SwapInterval should not care about FBOs (as SwapBuffers already does). But even if this is never fixed this thread can be helpful for others haveing the same problem.

mfort
09-02-2010, 12:35 PM
FBO cannot extend WGL/GLX, so it cannot modify the wording without being an explicit WGL/GLX extension.

Of course not. But every vivid extension undergoes some maintenance. It has revision history. They can clarify things. I also feel that this issue on the edge. I am OK if they add note that the extension only works when FBO is not bound.

Thanks to muhkuh we can avoid this trap (at least on NV).