<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 - Decreasing for loops over shared arrays hang the GPU (GEN9)"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=100134">100134</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Decreasing for loops over shared arrays hang the GPU (GEN9)
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>13.0
          </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>Drivers/Vulkan/intel
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>freiling@google.com
          </td>
        </tr>

        <tr>
          <th>QA Contact</th>
          <td>intel-3d-bugs@lists.freedesktop.org
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>jason@jlekstrand.net
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=130135" name="attach_130135" title="Offending SPIR-V">attachment 130135</a> <a href="attachment.cgi?id=130135&action=edit" title="Offending SPIR-V">[details]</a></span>
Offending SPIR-V

We have a very simple glsl compute shader which hangs gen9

#version 450
#extension GL_ARB_separate_shader_objects : enable

shared int roi[8];

void main() {
  for (uint i = 7; i >= 0; i--) {
    roi[i] = 1;
  }
}

Heres some things we know about it

-changing the loop condition to "for (uint i = 0; i < 8; i++)" fixes the
problem
-making roi a function scoped "local" variable fixes the problem
-the spir-v we get out of GLSLang looks legit afaict (attached for your
reference)
-the same spir-v works on nvidia

Let us know if you have any questions.


Forrest</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>