st/mesa: Make Gallium's BlitFramebuffer follow the GL 4.4 sRGB rules.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 3 Aug 2016 18:39:18 +0000 (11:39 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Mon, 8 Aug 2016 21:04:18 +0000 (14:04 -0700)
commit3190c7ee9727161d627f107c2e7f8ec3a11941c1
tree9f0cc3d04b0eeafbaee5e1d35341b0744f0f9c08
parentf6dc71483abb876386824ba97097089cc0b8f454
st/mesa: Make Gallium's BlitFramebuffer follow the GL 4.4 sRGB rules.

OpenGL 4.4 specifies that BlitFramebuffer should perform sRGB encode
and decode like ES 3.x does, but only when GL_FRAMEBUFFER_SRGB is
enabled.  This is technically incompatible in certain cases, but is
more consistent across GL, ES, and WebGL, and more flexible.

The NVIDIA 367.35 drivers appear to follow this behavior.

For the awful spec analysis, please read Piglit's
tests/spec/arb_framebuffer_srgb/blit.c, which explains the differences
between GL 4.1, 4.2, 4.3 (2012), 4.3 (2013), and 4.4, and why this
is the right rule to implement.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/state_tracker/st_cb_blit.c