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

Józef Kucia joseph.kucia at gmail.com
Wed Nov 1 05:10:58 CDT 2017


On Tue, Oct 31, 2017 at 6:24 PM, Roderick Colenbrander
<thunderbird2k at gmail.com> wrote:
> Signed-off-by: Roderick Colenbrander <thunderbird2k at gmail.com>
> ---
>  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);
> +}

I guess that "%s" doesn't work very well for NULL. We should probably
use debugstr_a().

> +
> +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);

pApplicationInfo can be NULL.

> +
> +    /* 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
>
>
>



More information about the wine-devel mailing list