meta: Properly save/restore GL_FRAMEBUFFER_SRGB in Meta.
authorPaul Berry <stereotype441@gmail.com>
Mon, 24 Sep 2012 21:38:19 +0000 (14:38 -0700)
committerPaul Berry <stereotype441@gmail.com>
Tue, 25 Sep 2012 22:01:13 +0000 (15:01 -0700)
commit414f69aaad442abfce506323d0f0640139928898
treed26a1bfb926115a53545a2ce322b58a21b7e56ca
parent8faa79764c394ce5ec87c5376afb5643f99c53e7
meta: Properly save/restore GL_FRAMEBUFFER_SRGB in Meta.

Previously, meta logic was saving and restoring the value of
GL_FRAMEBUFFER_SRGB in an ad-hoc fashion.  As a result, it was not
properly disabled and/or restored for some meta operations.

This patch causes GL_FRAMEBUFFER_SRGB to be saved/restored in the
conventional way of meta-ops (using _mesa_meta_begin() and
_mesa_meta_end()).  It is now reliably saved/restored for
_mesa_meta_BlitFramebuffer, _mesa_meta_GenerateMipmap, and
decompress_texture_image, and preserved for all other meta ops.

Fixes piglit tests "ARB_framebuffer_sRGB/blit renderbuffer
{linear_to_srgb,srgb} scaled {disabled,enabled}".

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
src/mesa/drivers/common/meta.c
src/mesa/drivers/common/meta.h