For Blender 2.8 we had to be compatible with very old OpenGL versions, and
triple buffer was designed to work without offscreen rendering, by copying
the the backbuffer to a texture right before swapping. This way we could
avoid redrawing unchanged regions by copying them from this texture on the
next redraws. Triple buffer used to suffer from poor performance and driver
bugs on specific cards, so alternative draw methods remained available.
Now that we require newer OpenGL, we can have just a single draw method
that draws into offscreen buffers, and then draws those to the screen.
This has some advantages:
- Poor 3D view performance when using Region Overlap should be solved now, since we can also cache overlapping regions in offscreen buffers.
- Page flip, anaglyph and interlace stereo drawing can be a little faster by avoiding a copy to an intermediate texture.
- The new 3D view drawing already writes to an offscreen buffer, which we can draw from directly instead of duplicating it to another buffer.
- We can remove depth and multisample buffers from the window, and instead only allocate them for the 3D view offscreen buffer. This will save some memory as well.
- Windows have different OpenGL contexts, and we can't share everything between them (VAOs). With this change only minimal drawing will happen directly to the screen (cursors, gestures, borders), and so all other drawing can then happen with a single OpenGL context, see D3057.
This is a work in progress (see TODO's in the code), but posting it now
so you know this is being worked on.