Bug 55783

Summary: glEnable(GL_FRAMEBUFFER_SRGB) has no effect on the backbuffer
Product: Mesa Reporter: Steinar H. Gunderson <sgunderson>
Component: Drivers/DRI/i965Assignee: Ian Romanick <idr>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: david
Version: 8.0   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Steinar H. Gunderson 2012-10-08 22:19:35 UTC
Hi,

I'm using Ubuntu 12.04 (so Mesa 8.0.2 with patches), on a Thinkpad x201 with Intel HD Graphics (Ironlake).

I'm trying to render to the backbuffer (ie. no FBOs) with hardware sRGB encode; that is, I've requested a visual with GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT=1, and I'm doing glEnable(GL_FRAMEBUFFER_SRGB). However, it simply has no effect; I can turn it on and off and it doesn't make any difference to my output. (On an nVidia machine with nVidia's proprietary drivers, there's a clear difference with the same code.) I'm not getting any errors from glGetError() either.

It should be said that if I use glGetIntegerv(GL_FRAMEBUFFER_SRGB_CAPABLE_EXT) (which, strangely enough, is not part of the ARB extension?), it returns 0, so in some way, the driver is correct, but surely the hardware supports this? I tried applying http://cgit.freedesktop.org/mesa/mesa/commit/?id=51e41a0d894109249448ecc6a6bfc09e095acada in the hopes that it might help, but seemingly it was not relevant here.
Comment 1 Kenneth Graunke 2012-10-09 21:18:55 UTC
Right, that patch only applies for Gallium drivers, not i965.
Comment 2 Eric Anholt 2013-02-16 07:21:03 UTC
*** Bug 60633 has been marked as a duplicate of this bug. ***
Comment 3 Eric Anholt 2013-02-22 20:02:05 UTC
Patch on the list:

http://lists.freedesktop.org/archives/mesa-dev/2013-February/035058.html
Comment 4 Eric Anholt 2013-03-01 20:29:39 UTC
commit e15c21a957b62ab856ab286e8253dd1151a3386e
Author: Eric Anholt <eric@anholt.net>
Date:   Fri Feb 15 07:41:42 2013 -0800

    i965: Make sRGB-capable framebuffers by default.
    
    The GLX extension lets you expose visuals that explicitly guarantee you
    that the GL_FRAMEBUFFER_SRGB_CAPABLE flag will be set, but we can set
    the flag even while the visual doesn't provide the guarantee.  This
    appears to be consistent with other implementations, as we've seen
    several apps now that don't require an srgb visual and assume sRGB will
    work without checking the GL_FRAMEBUFFER_SRGB_CAPABLE flag.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55783
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60633
    Reviewed-and-tested-by: Ian Romanick <ian.d.romanick@intel.com>

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.