[Bug 91213] GLSL sine and cosine of argument larger than 4096*pi give wrong results

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 3 05:59:41 PDT 2015


https://bugs.freedesktop.org/show_bug.cgi?id=91213

            Bug ID: 91213
           Summary: GLSL sine and cosine of argument larger than 4096*pi
                    give wrong results
           Product: Mesa
           Version: 10.5
          Hardware: Other
                OS: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/DRI/i965
          Assignee: idr at freedesktop.org
          Reporter: b7.10110111 at gmail.com
        QA Contact: intel-3d-bugs at lists.freedesktop.org

Created attachment 116915
  --> https://bugs.freedesktop.org/attachment.cgi?id=116915&action=edit
Plot of per-channel values in a scanline of the resulting image

The following fragment shader gives me wrong results for red and blue channels,
while the green channel can taken as a reference:

#version 120
float SinGood(float x)
{
    if(x>12866)
        x=mod(x,6.283185307);
    return sin(x);
}
void main()
{
    const float pi=3.14159265;
    gl_FragColor=vec4(0.5+0.5*sin(3.14159265/256*gl_FragCoord.x+4096*pi),
                      0.5+0.5*SinGood(3.14159265/256*gl_FragCoord.x+4096*pi),
                      0.5+0.5*sin(3.14159265/256*gl_FragCoord.x+2*4096*pi),
                      1);
}

I've tested on Intel Corporation Xeon E3-1200 v3 Processor Integrated Graphics
Controller (rev 06), as well as on HD Graphics 4600 on Kubuntu 14.04 and LFS.

If I set LIBGL_ALWAYS_SOFTWARE=1, then I get all three channels with identical
results (visually in the resulting image and on the channels plot), i.e. the
problem only appears when HW acceleration is enabled.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20150703/fd970620/attachment.html>


More information about the intel-3d-bugs mailing list