Khronos, y u no triple buffer?

Started by
3 comments, last by Hodgman 8 years, 7 months ago

I'm working on some ES 2 code and setup is done using EGL and I want to enable triple buffering.

Is this not handled by OpenGL at all? Not in EGL or any other spec?

Is it implied in the eglSwapInterval API?

- The trade-off between price and quality does not exist in Japan. Rather, the idea that high quality brings on cost reduction is widely accepted.-- Tajima & Matsubara
Advertisement

Double buffering is a feature of the underlying OS (wglSwapBuffer etc.) and it seems that triple buffering is not really supported. Thought you can always implement it yourself, something like this (pseudo-code idea, looks more like quad-buffering wink.png ):


Display: Front
Ready for swap: Back
Render to: my_own_framebuffer (based on internal double buffering my_buffer1,my_buffer2)

...
render scene
...
wglSwapBuffers(); // back->front
copyBuffer(my_own_framebuffer,back);
my_own_framebuffer = my_own_framebuffer==my_buffer1 ? my_buffer2 : my_buffer1;

 

When you already have a more complex post-processing chain, then the final post-processing step could directly render to the back buffer, saving a copy operation (thought copy should be really fast and should not block other buffers).

As mentioned this is up to the device vendor.
As far as I know, all smart phones use triple-buffering and there is no way to disable or change it. At the very least that is the case with all iOS devices.
As mentioned above, if you believe you need an extra buffer, you can just add one manually.


L. Spiro

I restore Nintendo 64 video-game OST’s into HD! https://www.youtube.com/channel/UCCtX_wedtZ5BoyQBXEhnVZw/playlists?view=1&sort=lad&flow=grid

Like L.Spiro mention. You can create an aditional FrameBuffer object and use those as your extra buffers.

Adding an extra buffer manually won't achieve the benefits of driver-magic triple buffering, it will only let you suffer the additional input->visual latency from an extra frame's worth of delay ;)

Genuine driver-magic triple buffering has the benefit of reducing the CPU-side impact of vsync, reducing the time spent blocked in glSwapBuffers/etc.

This topic is closed to new replies.

Advertisement