meta: Make MESA_META_DRAW_BUFFERS restore properly
authorKristian Høgsberg <krh@bitplanet.net>
Sat, 16 Aug 2014 06:19:52 +0000 (23:19 -0700)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 2 Sep 2014 17:33:13 +0000 (10:33 -0700)
commit8f55174fbdc27076f310c4dfb1f87072588b8b0b
tree7566b6e4114a55391dfff8bf8c5596813e806a2c
parent5a4e0f3873657d874eb5ff52819f42ea38d54b91
meta: Make MESA_META_DRAW_BUFFERS restore properly

A meta begin/end pair with MESA_META_DRAW_BUFFERS will change visible GL
state.  We recreate the draw buffer enums from the buffer bitfield, which
changes GL_BACK to GL_BACK_LEFT (and GL_FRONT to GL_FRONT_LEFT).

This commit modifes the save/restore logic to instead copy the buffer enums
from the gl_framebuffer and then set them on restore using
_mesa_drawbuffers().

It's not clear how this breaks the benchmark in 82796, but fixing meta to not
leak the state change fixes the regression.

No piglit regressions.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=82796
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: mesa-stable@lists.freedesktop.org
src/mesa/drivers/common/meta.c