<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 - glReadPixels returns black pixels on first display in software mode"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=96872">96872</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>glReadPixels returns black pixels on first display in software mode
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>10.5
          </td>
        </tr>

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

        <tr>
          <th>OS</th>
          <td>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>b7.10110111@gmail.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=124967" name="attach_124967" title="Test program">attachment 124967</a> <a href="attachment.cgi?id=124967&action=edit" title="Test program">[details]</a></span>
Test program

The attached program uses glReadPixels after glClear and glFinish. On normal
HW-accelerated Mesa, this gives the expected result: the data defined by
glClearColor are received (the program just prints "Test passed"). This also
works normally if e.g. NVIDIA proprietary driver is in use, but Mesa libGL is
used to draw things. Similarly for Xephyr, where software rendering is the only
possible option.

But if I use e.g. intel driver but set LIBGL_ALWAYS_SOFTWARE=1 environment
variable for the test program, I get the following output:

Wrong data received from glReadPixels(): expected ff ff ff ff, got 00 00 00 00
Test passed

I.e. on first call to runTest() (which is a GLUT display function)
glReadPixels() returns black transparent pixels, and only on the second it
works as expected.

Was testing this on Intel Atom N550. The same result is observable on i915G
graphics.
The OS I tested this on is Kubuntu 14.04 with LTS enablement stack (packages
with "-vivid" suffix in names).</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
          <li>You are the QA Contact for the bug.</li>
      </ul>
    </body>
</html>