[PATCH 03/10] winevulkan: Implement vk_icdNegotiateICDInterfaceVersion.

Henri Verbeet hverbeet at gmail.com
Wed Feb 21 06:21:58 CST 2018


On 20 February 2018 at 09:59, Roderick Colenbrander
<thunderbird2k at gmail.com> wrote:
>  VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *pSupportedVersion)
>  {
> -    FIXME("stub: %p\n", pSupportedVersion);
> -    return VK_ERROR_INCOMPATIBLE_DRIVER;
> +    uint32_t req_version;
> +    TRACE("%p\n", pSupportedVersion);
> +
> +    /* The spec is not clear how to handle this. Mesa drivers don't check, but it
> +     * is probably best to not explode. VK_INCOMPLETE seems to be the closest value.
> +     */
> +    if (!pSupportedVersion)
> +        return VK_INCOMPLETE;
> +
> +    req_version = *pSupportedVersion;
> +    *pSupportedVersion = min(req_version, WINE_VULKAN_ICD_VERSION);
> +    TRACE("Loader requested ICD version=%d, returning %d\n", req_version, *pSupportedVersion);
It probably won't matter for the values you'll see here in practice,
but note that %u would be more appropriate than %d for unsigned
values.

Also, I'm not going to ask you to change them unless you want to, but
note that in general we're not huge proponents of the "line noise"
naming convention. E.g., we'd probably prefer "supported_version" over
"pSupportedVersion", etc.



More information about the wine-devel mailing list