https://bugs.freedesktop.org/show_bug.cgi?id=36965
Summary: GL_EXT_texture_sRGB (included in OpenGL 2.1) is broken Product: Mesa Version: 7.10 Platform: All OS/Version: Linux (All) Status: NEW Severity: normal Priority: medium Component: Drivers/Gallium/r600 AssignedTo: dri-devel@lists.freedesktop.org ReportedBy: marlam@marlam.de
The GL extension GL_EXT_texture_sRGB (which is in OpenGL 2.1 core) defines the texture formats GL_SRGB and friends and specifies that sampling such a texture automatically converts the values from non-linear RGB (sRGB) to linear RGB.
However, this conversion is not performed; the textures are sampled as if they were normal GL_RGB textures. This results in wrong colors (e.g. in the Bino 3D video player: far too bright).
I'm running Ubuntu 11.04 on x86_64 and get the following version info from GL: OpenGL version: 2.1 Mesa 7.10.2 OpenGL renderer: Gallium 0.4 on AMD RV710 OpenGL vendor: X.Org
If you need more information, please let me know.
[This is the same as bug 32323, but re-reported for newer Mesa versions]
https://bugs.freedesktop.org/show_bug.cgi?id=36965
--- Comment #1 from Pavel Ondračka pavel.ondracka@email.cz 2011-05-12 09:11:08 PDT --- I see similar problems in Starcraft 2, there are also over bright textures which go away when MESA_EXTENSION_OVERRIDE="-GL_EXT_texture_sRGB_decode" is set. OpenGL renderer string: Gallium 0.4 on ATI RV530 OpenGL version string: 2.1 Mesa 7.11-devel (git-32a95cb)
https://bugs.freedesktop.org/show_bug.cgi?id=36965
--- Comment #2 from Pavel Ondračka pavel.ondracka@email.cz 2011-05-12 09:18:11 PDT --- BTW this should be probably a mesa core bug, right?
https://bugs.freedesktop.org/show_bug.cgi?id=36965
--- Comment #3 from Martin Lambers marlam@marlam.de 2011-05-12 10:20:51 PDT --- (In reply to comment #2)
BTW this should be probably a mesa core bug, right?
There is code in Mesa to handle SRGB textures correctly, see http://cgit.freedesktop.org/mesa/mesa/tree/src/mesa/main/texgetimage.c lines 223-301.
I guess drivers can override this, but I don't know the internal structure of Mesa.
https://bugs.freedesktop.org/show_bug.cgi?id=36965
Marek Olšák maraeo@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Summary|GL_EXT_texture_sRGB |GL_EXT_texture_sRGB |(included in OpenGL 2.1) is |(included in OpenGL 2.1) is |broken |broken (glean/texture_srgb | |broken too)
--- Comment #4 from Marek Olšák maraeo@gmail.com 2011-05-12 12:50:02 PDT --- There is a lot of other code which plays role in handling sRGB textures. I don't think getteximage.c is relevant to this issue(s).
Nevertheless, it looks like Pavel's and Martin's issues are different bugs.
Pavel reported that GL_EXT_texture_sRGB_decode, which is only in 7.11, is broken specifically on r300g, but other drivers might be affected as well and it definitely looks like a Mesa core bug. Pavel, could you please add it as a new bug against Mesa core?
Martin's issue is likely related to the fact that piglit/glean/texture_srgb fails on r600g. Taking a look at it might be a good start.
https://bugs.freedesktop.org/show_bug.cgi?id=36965
--- Comment #5 from Pavel Ondračka pavel.ondracka@email.cz 2011-05-12 14:07:59 PDT --- (In reply to comment #4)
There is a lot of other code which plays role in handling sRGB textures. I don't think getteximage.c is relevant to this issue(s).
Nevertheless, it looks like Pavel's and Martin's issues are different bugs.
Pavel reported that GL_EXT_texture_sRGB_decode, which is only in 7.11, is broken specifically on r300g, but other drivers might be affected as well and it definitely looks like a Mesa core bug. Pavel, could you please add it as a new bug against Mesa core?
Reported against mesa core as bug 37150.
https://bugs.freedesktop.org/show_bug.cgi?id=36965
--- Comment #6 from Andreas Boll andreas.boll.dev@gmail.com --- (In reply to comment #4)
There is a lot of other code which plays role in handling sRGB textures. I don't think getteximage.c is relevant to this issue(s).
Nevertheless, it looks like Pavel's and Martin's issues are different bugs.
Pavel reported that GL_EXT_texture_sRGB_decode, which is only in 7.11, is broken specifically on r300g, but other drivers might be affected as well and it definitely looks like a Mesa core bug. Pavel, could you please add it as a new bug against Mesa core?
Martin's issue is likely related to the fact that piglit/glean/texture_srgb fails on r600g. Taking a look at it might be a good start.
the piglit passes for me on my rv770 with mesa from git (470952f)
@Martin: Can you test with a newer version of mesa (9.0 or mesa from git)?
https://bugs.freedesktop.org/show_bug.cgi?id=36965
--- Comment #7 from Martin Lambers marlam@marlam.de --- I don't have access anymore to the AMD graphics card that originally exposed the problem for me.
I can only confirm that the problem does not exist with Mesa 9.0 (from Ubuntu 12.10) with an Intel Sandybridge GPU: OpenGL Version: 3.0 Mesa 9.0 OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Mobile OpenGL Vendor: Intel Open Source Technology Center
Thanks for your work.
Martin
https://bugs.freedesktop.org/show_bug.cgi?id=36965
Andreas Boll andreas.boll.dev@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |FIXED
dri-devel@lists.freedesktop.org