Fix the initial value of glDrawBuffers for GLES
authorNeil Roberts <neil@linux.intel.com>
Fri, 7 Mar 2014 18:05:45 +0000 (18:05 +0000)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 12 Mar 2014 21:40:47 +0000 (14:40 -0700)
commit4954518125d6cc61af3302c0db7487025e0e37e6
treec8609f1122db3567cf629a1f1d21e6cfef8bfd17
parent0c58c96e540c86bdac52e8c61823bf14f4cd1fa0
Fix the initial value of glDrawBuffers for GLES

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.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
src/mesa/main/blend.c