OSDN Git Service

Use the magic behaviour of GL_BACK in GLES 1 and 2 as well as 3
authorNeil Roberts <neil@linux.intel.com>
Fri, 7 Mar 2014 18:05:44 +0000 (18:05 +0000)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 12 Mar 2014 21:40:46 +0000 (14:40 -0700)
commit0c58c96e540c86bdac52e8c61823bf14f4cd1fa0
treefbab567524bd64e0e4f257e1056d1daec3e51c05
parent87c66a4ff7d9f1849648080faf456d3b54c44d0a
Use the magic behaviour of GL_BACK in GLES 1 and 2 as well as 3

In GLES 3 it is not possible to select rendering to the front buffer and
instead selecting GL_BACK has the magic interpretation that it is either the
front buffer on single-buffered configs or the back buffer on double-buffered.
GLES 1 and 2 have no way of selecting the draw buffer at all. In that case we
were initialising the draw buffer to either GL_FRONT or GL_BACK depending on
the context's config and then leaving it at that.

When we switch to having configless contexts we ideally want Mesa to
automatically switch between the front and back buffer whenever a double-
or single-buffered surface is bound. To make this happen we can just allow
the magic behaviour from GLES 3 in GLES 1 and 2 as well. It shouldn't matter
what the internal value of the draw buffer is in GLES 1 and 2 because there
is no way to query it from the external API.

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