Roderick Colenbrander : winex11: Implement vkEnumerateInstanceExtensionProperties.

Alexandre Julliard julliard at winehq.org
Tue Feb 27 17:29:34 CST 2018


Module: wine
Branch: master
Commit: 0c87c1c4b70d26af0427686e05617f3a5ec8f720
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=0c87c1c4b70d26af0427686e05617f3a5ec8f720

Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date:   Mon Feb 26 19:42:17 2018 +0100

winex11: Implement vkEnumerateInstanceExtensionProperties.

Signed-off-by: Roderick Colenbrander <thunderbird2k at gmail.com>
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/winex11.drv/vulkan.c | 28 ++++++++++++++++++++++++++--
 1 file changed, 26 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
index b73f379..92f8a0e 100644
--- a/dlls/winex11.drv/vulkan.c
+++ b/dlls/winex11.drv/vulkan.c
@@ -41,8 +41,32 @@ static void X11DRV_vkDestroyInstance(VkInstance instance, const VkAllocationCall
 static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_name,
         uint32_t *count, VkExtensionProperties* properties)
 {
-    FIXME("stub: %s %p %p\n", debugstr_a(layer_name), count, properties);
-    return VK_ERROR_OUT_OF_HOST_MEMORY;
+    TRACE("layer_name %s, count %p, properties %p\n", debugstr_a(layer_name), count, properties);
+
+    /* This shouldn't get called with layer_name set, the ICD loader prevents it. */
+    if (layer_name)
+    {
+        ERR("Layer enumeration not supported from ICD.\n");
+        return VK_ERROR_LAYER_NOT_PRESENT;
+    }
+
+    if (!properties)
+    {
+        /* When properties is NULL, we need to return the number of extensions
+         * supported. For now report 0 until we add some e.g.
+         * VK_KHR_win32_surface. Long-term this needs to be an intersection
+         * between what the native library supports and what thunks we have.
+         */
+        *count = 0;
+        return VK_SUCCESS;
+    }
+
+    /* When properties is not NULL, we copy the extensions over and set count
+     * to the number of copied extensions. For now we don't have much to do as
+     * we don't support any extensions yet.
+     */
+    *count = 0;
+    return VK_SUCCESS;
 }
 
 static void * X11DRV_vkGetInstanceProcAddr(VkInstance instance, const char *name)




More information about the wine-cvs mailing list