Roderick Colenbrander : winevulkan: Implement vk_icdNegotiateICDInterfaceVersion.
Alexandre Julliard
julliard at winehq.org
Tue Feb 27 17:29:33 CST 2018
Module: wine
Branch: master
Commit: 112e6835bbe7c3a0ff9eea51ed558fa53b177878
URL: https://source.winehq.org/git/wine.git/?a=commit;h=112e6835bbe7c3a0ff9eea51ed558fa53b177878
Author: Roderick Colenbrander <thunderbird2k at gmail.com>
Date: Mon Feb 26 19:42:13 2018 +0100
winevulkan: Implement vk_icdNegotiateICDInterfaceVersion.
Signed-off-by: Roderick Colenbrander <thunderbird2k at gmail.com>
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/winevulkan/vulkan.c | 24 ++++++++++++++++++++++--
1 file changed, 22 insertions(+), 2 deletions(-)
diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c
index cac907c..ef22a45 100644
--- a/dlls/winevulkan/vulkan.c
+++ b/dlls/winevulkan/vulkan.c
@@ -27,6 +27,13 @@
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
+/* For now default to 4 as it felt like a reasonable version feature wise to support.
+ * Don't support the optional vk_icdGetPhysicalDeviceProcAddr introduced in this version
+ * as it is unlikely we will implement physical device extensions, which the loader is not
+ * aware off. Version 5 adds more extensive version checks. Something to tackle later.
+ */
+#define WINE_VULKAN_ICD_VERSION 4
+
void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *name)
{
FIXME("stub: %p %s\n", instance, debugstr_a(name));
@@ -35,8 +42,21 @@ void * WINAPI wine_vk_icdGetInstanceProcAddr(VkInstance instance, const char *na
VkResult WINAPI wine_vk_icdNegotiateLoaderICDInterfaceVersion(uint32_t *supported_version)
{
- FIXME("stub: %p\n", supported_version);
- return VK_ERROR_INCOMPATIBLE_DRIVER;
+ uint32_t req_version;
+
+ TRACE("%p\n", supported_version);
+
+ /* 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 (!supported_version)
+ return VK_INCOMPLETE;
+
+ req_version = *supported_version;
+ *supported_version = min(req_version, WINE_VULKAN_ICD_VERSION);
+ TRACE("Loader requested ICD version %u, returning %u\n", req_version, *supported_version);
+
+ return VK_SUCCESS;
}
BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved)
More information about the wine-cvs
mailing list