<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 - SPIR-V OpSwitch with int64 not supported even though shaderInt64 is true"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101560">101560</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>SPIR-V OpSwitch with int64 not supported even though shaderInt64 is true
          </td>
        </tr>

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

        <tr>
          <th>Version</th>
          <td>unspecified
          </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>programmerjake@gmail.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=132150" name="attach_132150" title="SPIR-V vertex shader that uses OpSwitch on a uint64_t (may be incorrect)">attachment 132150</a> <a href="attachment.cgi?id=132150&action=edit" title="SPIR-V vertex shader that uses OpSwitch on a uint64_t (may be incorrect)">[details]</a></span>
SPIR-V vertex shader that uses OpSwitch on a uint64_t (may be incorrect)

I noticed that even though shaderInt64 is true on gen 8 and above, the SPIR-V
to NIR translator code doesn't support OpSwitch on 64-bit integers.

Supporting 64-bit integers in OpSwitch requires parsing 2 for each switch
value, with the target block id, it requires 3 words for each switch case.

The latest commit on master when I checked is
e558a7a9888ee56863f11e7ede387689626f6ea9.

see OpSwitch translation code:
<a href="https://github.com/mesa3d/mesa/blob/master/src/compiler/spirv/vtn_cfg.c#L400">https://github.com/mesa3d/mesa/blob/master/src/compiler/spirv/vtn_cfg.c#L400</a>

code that enables shaderInt64:
<a href="https://github.com/mesa3d/mesa/blob/master/src/intel/vulkan/anv_device.c#L720">https://github.com/mesa3d/mesa/blob/master/src/intel/vulkan/anv_device.c#L720</a>

Note: from what I can tell, glslang doesn't currently allow creating OpSwitch
on a int64, so programs that use OpSwitch this way are probably non-existant.</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>