[PATCH 05/10] winex11: Add initial vkEnumerateInstanceExtensionProperties implementation.

Roderick Colenbrander <[email protected]>
Newsgroups gmane.comp.emulators.wine.patches
Message-ID <[email protected]>
Signed-off-by: Roderick Colenbrander <[email protected]>
---
 dlls/winex11.drv/vulkan.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)

diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
index cff474190a..e0e45d47ce 100644
--- a/dlls/winex11.drv/vulkan.c
+++ b/dlls/winex11.drv/vulkan.c
@@ -63,8 +63,31 @@ VkResult WINAPI X11DRV_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo,
 VkResult WINAPI X11DRV_vkEnumerateInstanceExtensionProperties(const char *pLayerName, uint32_t *pPropertyCount,
         VkExtensionProperties* pProperties)
 {
-    FIXME("stub: %p, %p, %p\n", pLayerName, pPropertyCount, pProperties);
-    return VK_ERROR_OUT_OF_HOST_MEMORY;
+    TRACE("pLayerName %p, pPropertyCount %p, pProperties %p\n", pLayerName, pPropertyCount, pProperties);
+
+    /* This shouldn't get called with pLayerName set, the ICD loader prevents it. */
+    if (pLayerName)
+    {
+        ERR("Layer enumeration not supported from ICD.\n");
+        return VK_ERROR_LAYER_NOT_PRESENT;
+    }
+
+    if (!pProperties)
+    {
+        /* When pProperties 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.
+         */
+        *pPropertyCount = 0;
+        return VK_SUCCESS;
+    }
+
+    /* When pProperties is not NULL, we copy the extensions over and set pPropertyCount to
+     * the number of copied extensions. For now we don't have much to do.
+     */
+    *pPropertyCount = 0;
+    return VK_SUCCESS;
 }
 
 PFN_vkVoidFunction WINAPI X11DRV_vkGetInstanceProcAddr(VkInstance instance, const char* pName)
-- 
2.13.6
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.