Bug 97322

Summary: GenerateMipmap creates wrong mipmap for sRGB texture
Product: Mesa Reporter: Qiankun Miao <qiankun.miao>
Component: Drivers/DRI/i965Assignee: Kenneth Graunke <kenneth>
Status: RESOLVED FIXED QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:

Description Qiankun Miao 2016-08-12 08:43:29 UTC
When generating mipmap for texture, bi-linear interpolation is used to get the next mip level. If the texture is in sRGB format, we should decode sRGB to linear before the interpolation, and then re-encode it to sRGB after interpolation. Mesa doesn't follow such rules.


Steps to reproduce this bug:
1. Run latest "google-chrome-unstable" on Skylake Linux with option "--enable-unsafe-es3-apis" to enable WebGL 2.0 support.
2. open https://www.khronos.org/registry/webgl/sdk/tests/conformance2/textures/misc/tex-srgb-mipmap.html?webglVersion=2
3. You will see the test fails due to some result pixles are different with the reference.
Comment 1 Kenneth Graunke 2016-08-14 21:23:45 UTC
Patch awaiting review:
https://lists.freedesktop.org/archives/mesa-dev/2016-August/125887.html
Comment 2 Matt Turner 2016-11-02 23:33:58 UTC
This was fixed by

commit 6cf8708ce55fb38c400c8f005e55170f54241187
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Fri Aug 12 14:48:54 2016 -0700

    meta: Always do GenerateMipmaps in linear colorspace.

and is part of mesa-13.0.0.

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.