From 21b0996dfcbe62c55dd31cc316cd47f2b8531d2e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Sun, 6 Feb 2011 19:01:58 +1000 Subject: mesa/st: enable GL_EXT_framebuffer_sRGB If the formats don't match we need to update the surface with the new format. if we can render to SRGB formats, enable the extension Signed-off-by: Dave Airlie --- src/mesa/state_tracker/st_extensions.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/mesa/state_tracker/st_extensions.c') diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index a81cbe85d34..d600edc48be 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -390,6 +390,15 @@ void st_init_extensions(struct st_context *st) PIPE_BIND_SAMPLER_VIEW, 0)) { ctx->Extensions.EXT_texture_sRGB = GL_TRUE; ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE; + if (screen->is_format_supported(screen, PIPE_FORMAT_A8B8G8R8_SRGB, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET, 0) || + screen->is_format_supported(screen, PIPE_FORMAT_B8G8R8A8_SRGB, + PIPE_TEXTURE_2D, 0, + PIPE_BIND_RENDER_TARGET, 0)) { + ctx->Extensions.EXT_framebuffer_sRGB = GL_TRUE; + ctx->Const.sRGBCapable = GL_TRUE; + } } if (screen->is_format_supported(screen, PIPE_FORMAT_R8G8_UNORM, -- cgit v1.2.3