How to enable triple-buffering?

Direct3D has a mechanism for explicitly enabling triple-buffering.

I have heard that it is possible to enable hardware triple-buffering in OpenGL, but I cannot seem to find this documented anywhere. Could anyone point me to the appropriate specification, or explain the process?

thanks
chris

Where did you hear that?

Someone said that gl doesn’t support triple buffering due to something in the specification.
I think that some drivers use it if they really want to.

Head on over to the registry page and see if you find something.

I don’t think that’s the case, the tripple buffer can be fairly transparent.

I don’t think it matters when you aren’t syncing your swap to vertical retrace though since the effect would be negligible. You need vsync on for tripple buffering to make a difference so it hardly matters when it comes to benchmarketing I’d have thought, makes me wonder why the mainstream cares, unless maybe the swap itself is slow, which being a copy it might have been. Rendering during a swap copy seems like a negligible benefit, that’s if it’s even possible.

There was some talk of explicitly stopping tripple buffering in the ARB, but OpenGL has never guaranteed that the contents of your backbuffer = front buffer after swap and copy on swap is just as big an issue for anyone making this assumption. I dunno the outcome of that discussion.

There may be other issues I’m unaware of, I’d like to hear them.

FYI - SGI at one point considered an explicit exposed GLX tripple buffer extension, the idea was to avoid pipeline stalls while waiting on vertical retrace. The price you pay is additional latency for the image to appear.

A FIFO after geometry and non blocking first swap (block on second) looks like a tripple buffer now IMHO, the difference is that rasterization must block on swap unless you have a tripple buffer, but I don’t think it makes a difference conceptually to the application. A read on the frontbuffer would read the middle buffer, and therefore block on it’s completion, but if it ain’t complete then you won’t have three buffers yet, i.e. it’s the same as a double buffer scenario, so a read on the frontbuffer would be a big win for tripple buffering.

[This message has been edited by dorbie (edited 03-10-2003).]

It looks like wgl_pixel_format has a WGL_SWAP_METHOD_EXT flag that allows you to control the swapping behavior; perhaps this makes a difference?

Originally posted by dorbie:
[b]

There was some talk of explicitly stopping tripple buffering in the ARB, but OpenGL has never guaranteed that the contents of your backbuffer = front buffer after swap and copy on swap is just as big an issue for anyone making this assumption. I dunno the outcome of that discussion.

[/b]