Jump to content
  • Advertisement
Sign in to follow this  
Shannon Barber

OpenGL Khronos, y u no triple buffer?

This topic is 1189 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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?

Edited by Shannon Barber

Share this post


Link to post
Share on other sites
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).

Edited by Ashaman73

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!