From: Henri Verbeet Subject: Re: [PATCH 03/10] winevulkan: Implement vk_icdNegotiateICDInterfaceVersion. Message-Id: Date: Wed, 21 Feb 2018 15:51:58 +0330 In-Reply-To: <20180220062947.4192-4-thunderbird2k@gmail.com> References: <20180220062947.4192-1-thunderbird2k@gmail.com> <20180220062947.4192-4-thunderbird2k@gmail.com> On 20 February 2018 at 09:59, Roderick Colenbrander 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.