mesa/st: rework support for sRGB framebuffer attachements
authorGert Wollny <gert.wollny@collabora.com>
Tue, 13 Nov 2018 11:18:27 +0000 (12:18 +0100)
committerGert Wollny <gert.wollny@collabora.com>
Mon, 28 Jan 2019 11:18:40 +0000 (12:18 +0100)
commit8f9dfb7d8812a045a38b1740e90f43a585aec58e
treec24974e37a1a64589fdfc13bb2cd2f1311f95f19
parent385081cd17705a2581a6325ac668d2d6fae19e7d
mesa/st: rework support for sRGB framebuffer attachements

For GLES sRGB framebuffer attachemnt support is provided in two steps:
sRGB attachments like described in EXT_sRGB (and GLES 3.0) that enable
linear to sRGB color space transformation automatically, and the ability
to switch formats of the render target surface between sRGB and linear
that introduces full support for EXT_framebuffer_sRGB.
Set the according flags to reflect these two levels of sRGB support.

As a difference between desktopm GL and GLES, on desktop GL for a sRGB
framebuffer attachment the linear-sRGB conversion is turned off by default,
and for GLES it is turned on. This needs to be taken into account when
initally creating a surface, i.e. on desktop GL creation of a sRGB surface
is preferred, but on GLES sRGB surfaces are only created when explicitely
requested.

v2: - Use the new CAPS name

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/mesa/state_tracker/st_cb_fbo.c
src/mesa/state_tracker/st_extensions.c
src/mesa/state_tracker/st_format.c
src/mesa/state_tracker/st_manager.c