Fix the initial value of glDrawBuffers for GLES

Graphics / Mesa 3D Graphics Library / Mesa - Neil Roberts [linux.intel.com] - 12 March 2014 16:40 UTC

Under GLES 3 it is not valid to pass GL_FRONT to glDrawBuffers. Instead, GL_BACK has a magic interpretation which means it will render to the front buffer on single-buffered contexts and the back buffer on double-buffered. We were incorrectly setting the initial value to GL_FRONT for single-buffered contexts. This probably doesn't really matter at the moment except that presumably it would be exposed in the API via glGetIntegerv.

When we switch to configless contexts this is more important because in that case we always want to rely on the magic interpretation of GL_BACK in order to automatically switch between the front and back buffer when a new surface with a different number of buffers is bound. We also do this for GLES 1 and 2 because the internal value doesn't matter in that case and it is convenient to use the same code to have the magic interpretation of GL_BACK.

4954518 Fix the initial value of glDrawBuffers for GLES
src/mesa/main/blend.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

Upstream: cgit.freedesktop.org


  • Share