Module: Mesa
Branch: master
Commit: 975c0f339f1122c578a33d36afedd0f7fef59fc4
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=975c0f339f1122c578a33d36afedd0f7fef59fc4

Author: Jason Ekstrand <[email protected]>
Date:   Wed Feb 15 16:06:42 2017 -0800

anv: Implement VK_KHX_external_semaphore

Reviewed-by: Chad Versace <[email protected]>

---

 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 639c7456c3..e73140b23f 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -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,
    },
diff --git a/src/intel/vulkan/anv_entrypoints_gen.py 
b/src/intel/vulkan/anv_entrypoints_gen.py
index fe95397d65..cebbad037b 100644
--- a/src/intel/vulkan/anv_entrypoints_gen.py
+++ b/src/intel/vulkan/anv_entrypoints_gen.py
@@ -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',
 ]
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
index 906eb25af0..64c59006ca 100644
--- a/src/intel/vulkan/anv_queue.c
+++ b/src/intel/vulkan/anv_queue.c
@@ -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.

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to