Reply – Re: Understanding issue with automatic buffer swapping
Your Name
or Cancel
In Reply To
Re: Understanding issue with automatic buffer swapping
— by Xerxes Rånby Xerxes Rånby
Xerxes Rånby wrote
I see the same issue that every second frame is using one un-cleared buffer when running the MultiViewportTest (AWT)
using Ubuntu 16.10 + AZUL 8 121 + OpenGL 4.5 compatible Mesa drivers for AMD

AsteroidSkyBoxTest and SpotLightTest is rendering fine using this setup, as well on the windows setup.
It is only the MultiViewportTest that is causing rendering on top of un-cleared buffer issues.
When you do manual buffer swapping I recommend looking into how to correctly handle framebuffers.

* make sure that you glClear to clear the buffers before rendering // clear depth/stencil/color contents
* make sure that you call glInvalidateFramebuffer after rendering before swapbuffers to improve performance and to prevent dirty buffers to  presistent before the next frame // avoid storing the depth/stencil contents

I expect the artifacts seen on some of my devices are caused by missing calls for both.