anv: Implement VK_KHX_external_semaphore
authorJason Ekstrand <jason.ekstrand@intel.com>
Thu, 16 Feb 2017 00:06:42 +0000 (16:06 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Wed, 3 May 2017 22:09:46 +0000 (15:09 -0700)
Reviewed-by: Chad Versace <chadversary@chromium.org>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_entrypoints_gen.py
src/intel/vulkan/anv_queue.c

index 639c745..e73140b 100644 (file)
@@ -375,6 +375,10 @@ static const VkExtensionProperties device_extensions[] = {
       .specVersion = 1,
    },
    {
+      .extensionName = VK_KHX_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
+      .specVersion = 1,
+   },
+   {
       .extensionName = VK_KHX_MULTIVIEW_EXTENSION_NAME,
       .specVersion = 1,
    },
index fe95397..cebbad0 100644 (file)
@@ -48,6 +48,7 @@ SUPPORTED_EXTENSIONS = [
     'VK_KHX_external_memory',
     'VK_KHX_external_memory_capabilities',
     'VK_KHX_external_memory_fd',
+    'VK_KHX_external_semaphore',
     'VK_KHX_external_semaphore_capabilities',
     'VK_KHX_multiview',
 ]
index 906eb25..64c5900 100644 (file)
@@ -508,6 +508,14 @@ VkResult anv_CreateSemaphore(
    if (semaphore == NULL)
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
+   const VkExportSemaphoreCreateInfoKHX *export =
+      vk_find_struct_const(pCreateInfo->pNext, EXPORT_SEMAPHORE_CREATE_INFO_KHX);
+    VkExternalSemaphoreHandleTypeFlagsKHX handleTypes =
+      export ? export->handleTypes : 0;
+
+   /* External semaphores are not yet supported */
+   assert(handleTypes == 0);
+
    /* The DRM execbuffer ioctl always execute in-oder, even between
     * different rings. As such, a dummy no-op semaphore is a perfectly
     * valid implementation.