<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 - Query buffer object support is broken on r600."
   href="https://bugs.freedesktop.org/show_bug.cgi?id=108311">108311</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Query buffer object support is broken on r600.
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>git
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>x86-64 (AMD64)
          </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>Drivers/Gallium/r600
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>dri-devel@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>awesie@gmail.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>dri-devel@lists.freedesktop.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=141970" name="attach_141970" title="Patch">attachment 141970</a> <a href="attachment.cgi?id=141970&action=edit" title="Patch">[details]</a></span> <a href='page.cgi?id=splinter.html&bug=108311&attachment=141970'>[review]</a>
Patch

After implementing support for query buffer objects in Wine, I got a bug report
about a regression on older AMD hardware
(<a href="https://bugs.winehq.org/show_bug.cgi?id=45946">https://bugs.winehq.org/show_bug.cgi?id=45946</a>). The root cause was a bug in
the query buffer object support for r600 in Mesa.

As mentioned in the commit message for
1c9ea24a19a28e87f6038281c516287f25ad88b5, the r600 shader cannot address
non-256 aligned ssbos. While that commit fixed most buffer accesses, it failed
to fix ssbo[1], e.g. tmp_buffer. This led to random failures of the query
buffer shader depending on whether we got lucky (e.g. tmp_buffer_offset was a
multiple of 256) or not.

The fix is easy. Mask tmp_buffer_offset and add another constant for when we
access the tmp_buffer in the shader. Patch is attached.</pre>
        </div>
      </p>


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

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