<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 - Anv crashes when using 64-bit vertex inputs"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=103241">103241</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Anv crashes when using 64-bit vertex inputs
          </td>
        </tr>

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

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

        <tr>
          <th>Hardware</th>
          <td>All
          </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>joseph.kucia@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>"elem_count" isn't calculated correctly for 64bit vertex inputs in
emit_vertex_input(). This leads to crash/assert() in the driver code.

The problem is that vs_prog_data->inputs_read may contain only parts of
varyings mark as used (see try_mask_partial_io() in
src/compiler/nir/nir_gather_info.c). On the other hand, for
vs_prog_data->double_inputs_read whole variables are always marked as used. The
element count is computed as _builtin_popcount(elements) -
_builtin_popcount(elements_double) / 2, but popcount(elements_double) / 2 >
popcount(elements) when only portions of double variables are mark as used.     

This can be reproduced using the
VkPositiveLayerTest.CreatePipeline64BitAttributesPositive test from
Vulkan-LoaderAndValidationLayers: 

./vk_layer_validation_tests
--gtest_filter='VkPositiveLayerTest.CreatePipeline64BitAttributesPositive'
Note: Google Test filter =
VkPositiveLayerTest.CreatePipeline64BitAttributesPositive
[==========] Running 1 test from 1 test case.
[----------] Global test environment set-up.
[----------] 1 test from VkPositiveLayerTest
[ RUN      ] VkPositiveLayerTest.CreatePipeline64BitAttributesPositive
vk_layer_validation_tests: ./genxml/gen9_pack.h:66: __gen_uint: Assertion `v <=
max' failed.
Aborted</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>