Bug 97322 - GenerateMipmap creates wrong mipmap for sRGB texture
Summary: GenerateMipmap creates wrong mipmap for sRGB texture
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: unspecified
Hardware: Other Linux (All)
: medium normal
Assignee: Kenneth Graunke
QA Contact: Intel 3D Bugs Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-12 08:43 UTC by Qiankun Miao
Modified: 2016-11-02 23:33 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

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.