[Mesa-dev] [PATCH v2 13/18] anv: Implement VK_KHX_external_semaphore

Jason Ekstrand jason at jlekstrand.net
Tue Mar 14 02:26:15 UTC 2017


---
 src/intel/vulkan/anv_device.c           | 4 ++++
 src/intel/vulkan/anv_entrypoints_gen.py | 1 +
 src/intel/vulkan/anv_queue.c            | 8 ++++++++
 3 files changed, 13 insertions(+)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 3674029..e9d919d 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -327,6 +327,10 @@ static const VkExtensionProperties device_extensions[] = {
       .extensionName = VK_KHX_EXTERNAL_MEMORY_FD_EXTENSION_NAME,
       .specVersion = 1,
    },
+   {
+      .extensionName = VK_KHX_EXTERNAL_SEMAPHORE_EXTENSION_NAME,
+      .specVersion = 1,
+   },
 };
 
 static void *
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py b/src/intel/vulkan/anv_entrypoints_gen.py
index 562ee49..c463eff 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -42,6 +42,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',
 ]
 
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
index dfb54bc..fe640eb 100644
--- a/src/intel/vulkan/anv_queue.c
+++ b/src/intel/vulkan/anv_queue.c
@@ -463,6 +463,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.
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list