[PATCH 07/10] winex11: add logging functions for vkCreateInstance

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 | 44 ++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 44 insertions(+)

diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c
index 4171ee0fd6..8632c46010 100644
--- a/dlls/winex11.drv/vulkan.c
+++ b/dlls/winex11.drv/vulkan.c
@@ -39,6 +39,13 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
 
 void* WINAPI X11DRV_vk_icdGetInstanceProcAddr(VkInstance instance, const char* pName);
 
+/* All Vulkan structures use this structure for the first elements. */
+struct wine_vk_structure_header
+{
+    VkStructureType sType;
+    const void *pNext;
+};
+
 
 static BOOL wine_vk_init(void)
 {
@@ -67,10 +74,47 @@ static void *wine_vk_get_global_proc_addr(const char* name)
     return NULL;
 }
 
+static void wine_vk_application_dump_info(const VkApplicationInfo *info)
+{
+    TRACE("pApplicationName \"%s\", applicationVersion %d\n", info->pApplicationName, info->applicationVersion);
+    TRACE("pEngineName \"%s\", engineVersion %d\n", info->pEngineName, info->engineVersion);
+    TRACE("apiVersion %#x\n", info->apiVersion);
+}
+
+static void wine_vk_instance_dump_create_info(const VkInstanceCreateInfo *info)
+{
+    int i, num_extensions, num_layers;
+    const struct wine_vk_structure_header *header;
+
+    wine_vk_application_dump_info(info->pApplicationInfo);
+
+    /* Should be 0, loader should have filtered this out. */
+    num_layers = info->enabledLayerCount;
+    TRACE("Enabled layers: %d\n", num_layers);
+    for (i = 0; i < num_layers; i++)
+    {
+        TRACE("Layer %d: %s\n", i, info->ppEnabledLayerNames[i]);
+    }
+
+    num_extensions = info->enabledExtensionCount;
+    TRACE("Enabled extensions: %d\n", num_extensions);
+    for (i = 0; i < num_extensions; i++)
+    {
+        TRACE("Extension %d: %s\n", i, info->ppEnabledExtensionNames[i]);
+    }
+
+    for (header = info->pNext; header; header = header->pNext)
+    {
+        TRACE("pNext: %p sType:%d\n", header, header->sType);
+    }
+}
+
 VkResult WINAPI X11DRV_vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo, const VkAllocationCallbacks *pAllocator,
         VkInstance *pInstance)
 {
     FIXME("stub: %p, %p, %p\n", pCreateInfo, pAllocator, pInstance);
+
+    wine_vk_instance_dump_create_info(pCreateInfo);
     return VK_ERROR_INCOMPATIBLE_DRIVER;
 }
 
-- 
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.