<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 - Crash in getPhysicalDeviceFeatures/Properties2KHR"
   href="https://bugs.freedesktop.org/show_bug.cgi?id=101183">101183</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Crash in getPhysicalDeviceFeatures/Properties2KHR
          </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/Vulkan/intel
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>webmaster@saschawillems.de
          </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>I'm preparing a new release of my Vulkan Hardware Capability viewer that uses
vkGetPhysicalDeviceFeatures/Properties2KHR to read out additional features and
properties for new extensions (when available) and on my Intel Haswell with a
recent MESA version (os is Ubuntu 16.04) calling one of these functions always
crashes. 

The function pointers are valid, and running these on other devices/operating
systems works fine so this may be a driver related problem.

To support the new feature and property functions I do the following:
- Enable "VK_KHR_get_physical_device_properties2" at instance level
- Get function pointers for both functions:

        pfnGetPhysicalDeviceFeatures2KHR =
reinterpret_cast<PFN_vkGetPhysicalDeviceFeatures2KHR>(vkGetInstanceProcAddr(vkInstance,
"vkGetPhysicalDeviceFeatures2KHR"));
        pfnGetPhysicalDeviceProperties2KHR =
reinterpret_cast<PFN_vkGetPhysicalDeviceProperties2KHR>(vkGetInstanceProcAddr(vkInstance,
"vkGetPhysicalDeviceProperties2KHR"));

- Both function pointers are valid
- Read out an extension specific feature/property like this:

        if (extensionSupported(VK_KHX_MULTIVIEW_EXTENSION_NAME)) {
                VkPhysicalDeviceFeatures2KHR deviceFeatures2{};
                VkPhysicalDeviceMultiviewFeaturesKHX multiViewFeatures{};
                multiViewFeatures.sType =
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MULTIVIEW_FEATURES_KHX;
                deviceFeatures2.sType =
VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
                deviceFeatures2.pNext = &multiViewFeatures;
                pfnGetPhysicalDeviceFeatures2KHR(device, &deviceFeatures2);
                features2.push_back(Feature2("multiview",
multiViewFeatures.multiview, VK_KHX_MULTIVIEW_EXTENSION_NAME));
                features2.push_back(Feature2("multiviewGeometryShader",
multiViewFeatures.multiviewGeometryShader, VK_KHX_MULTIVIEW_EXTENSION_NAME));
                features2.push_back(Feature2("multiviewTessellationShader",
multiViewFeatures.multiviewTessellationShader,
VK_KHX_MULTIVIEW_EXTENSION_NAME));
        }

This will always crash at pfnGetPhysicalDeviceFeatures2KHR, same for
pfnGetPhysicalDeviceProperties2KHR.</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>