<html>
    <head>
      <base href="https://bugs.freedesktop.org/" />
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Incorrect results with dFdx / dFdy"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=94341">94341</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Incorrect results with dFdx / dFdy
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>Mesa
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>11.1
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux (All)
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>medium
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Mesa core
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ikerr@box.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>mesa-dev@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=122036" name="attach_122036" title="Correct result (left) and incorrect result (right)">attachment 122036</a> <a href="attachment.cgi?id=122036&action=edit" title="Correct result (left) and incorrect result (right)">[details]</a></span>
Correct result (left) and incorrect result (right)

Context: I am using Chrome and osmesa to perform "headless" WebGL rendering.
Many of the Three.js examples (<a href="http://threejs.org/examples/">http://threejs.org/examples/</a>) do not render
correctly. I think I have narrowed the problem down to incorrect results
produced by dFdx / dFdy. Three.js uses these functions for several things
including: flat-shading and bump / normal mapping.

I have created a JSFiddle that demonstrates the problem:

<a href="https://jsfiddle.net/iangkerr/08x72ge9/">https://jsfiddle.net/iangkerr/08x72ge9/</a>

The fiddle renders two triangles, rotated 45 degrees, with a perspective
projection. The fragment shader attempts to compute the surface normal and
assigns the result to gl_FragColor. I expect a purplish colour, due to the
normal having positive X and Z components (R and B), and I get this result on
my Mac. However, when running Chrome + osmesa on Ubuntu, I get a bluish colour
(positive Z component). I have attached a screenshot of the correct result and
the incorrect result.</pre>
        </div>
      </p>
      <hr>
      <span>You are receiving this mail because:</span>
      
      <ul>
          <li>You are the QA Contact for the bug.</li>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>