[Mesa-dev] [Bug 94882] Incorrect texture filtering when using GL_LINEAR_MIPMAP_LINEAR

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Apr 10 13:43:43 UTC 2016


            Bug ID: 94882
           Summary: Incorrect texture filtering when using
           Product: Mesa
           Version: 11.2
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Mesa core
          Assignee: mesa-dev at lists.freedesktop.org
          Reporter: peter.fiss at gmx.de
        QA Contact: mesa-dev at lists.freedesktop.org

Created attachment 122847
  --> https://bugs.freedesktop.org/attachment.cgi?id=122847&action=edit
source code

I had an issue with texture filtering in one of my apps. So I decided to write
a minimal sample program, which can reproduce the issue. You can find it in the
tar.xz archive attached to this bug report.

The program creates a 512x512 texture which is completely white, except for the
outermost 8 pixels, which are black. The fragment shader renders the texture as
if a light was projecting it from the side (see attached screenshots).

The resulting picture is different depending on the graphics driver and
glTexParameter settings. If GL_TEXTURE_MIN_FILTER is set to GL_LINEAR or
GL_NEAREST, everything looks fine, no matter which driver is used. The
resulting picture looks like nvidia.png.

However, when using GL_LINEAR_MIPMAP_LINEAR, there is a ~1 pixel wide border
around the projected texture. This happens on all tested drivers except the
proprietary nvidia driver on Windows. This is actually strong evidence that
there's something wrong with my program instead of the drivers, but I really
couldn't figure it out and the program is not that complicated.

The white border gets smaller when GL_TEXTURE_WRAP_* is set to
GL_CLAMP_TO_BORDER instead of GL_CLAMP_TO_EDGE or GL_REPEAT. It's still wrong
though. Make sure to view the screenshots unscaled and unfiltered, otherwise
you might not see it.

Tested platforms:
- Intel HD 4000 (Ivy Bridge Mobile) with Mesa 11.2.0-1 on Arch
- GeForce GT 640M with Mesa 11.2.0-1 on Arch
- Radeon HD 5670 with Mesa 11.1.2-1 on Manjaro
- the same 3 GPUs with their proprietary drivers on Windows 7

Since all tested Mesa drivers have the issue, I decided to post this in the
mesa core section. I hope this is correct. If you can confirm, that this is a
driver bug, I will write bug reports to the closed-source teams of AMD and
Intel as well.

You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20160410/34310e93/attachment.html>

More information about the mesa-dev mailing list