From 5be428f5604065d993d71f743c21718e524345a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B3zef=20Kucia?= Date: Mon, 16 Jul 2018 15:18:20 +0200 Subject: [PATCH] winevulkan: Remove vkEnumerateInstanceVersion() from Vulkan driver functions. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Józef Kucia Signed-off-by: Alexandre Julliard --- dlls/winevulkan/make_vulkan | 4 ++-- dlls/winevulkan/vulkan.c | 16 +++++++++++++++- dlls/winex11.drv/vulkan.c | 18 ------------------ include/wine/vulkan_driver.h | 3 +-- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/dlls/winevulkan/make_vulkan b/dlls/winevulkan/make_vulkan index e922203ef40..3432e4f3b36 100755 --- a/dlls/winevulkan/make_vulkan +++ b/dlls/winevulkan/make_vulkan @@ -130,7 +130,7 @@ CORE_EXTENSIONS = [ # Functions part of our winevulkan graphics driver interface. # DRIVER_VERSION should be bumped on any change to driver interface # in FUNCTION_OVERRIDES -DRIVER_VERSION = 5 +DRIVER_VERSION = 6 # Table of functions for which we have a special implementation. # These are regular device / instance functions for which we need @@ -144,7 +144,7 @@ FUNCTION_OVERRIDES = { # Global functions "vkCreateInstance" : {"dispatch" : False, "driver" : True, "thunk" : False}, "vkEnumerateInstanceExtensionProperties" : {"dispatch" : False, "driver" : True, "thunk" : False}, - "vkEnumerateInstanceVersion": {"dispatch" : False, "driver" : True, "thunk" : False}, + "vkEnumerateInstanceVersion": {"dispatch" : False, "driver" : False, "thunk" : False}, "vkGetInstanceProcAddr": {"dispatch" : False, "driver" : True, "thunk" : False}, # Instance functions diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index b07025a2b22..5c156c125c6 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -58,6 +58,7 @@ static void *wine_vk_find_struct_(void *s, VkStructureType t) static void *wine_vk_get_global_proc_addr(const char *name); static const struct vulkan_funcs *vk_funcs; +static VkResult (*p_vkEnumerateInstanceVersion)(uint32_t *version); static void wine_vk_physical_device_free(struct VkPhysicalDevice_T *phys_dev) { @@ -322,6 +323,8 @@ static BOOL wine_vk_init(void) return FALSE; } + p_vkEnumerateInstanceVersion = vk_funcs->p_vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion"); + return TRUE; } @@ -849,7 +852,16 @@ VkResult WINAPI wine_vkEnumerateInstanceVersion(uint32_t *version) TRACE("%p\n", version); - res = vk_funcs->p_vkEnumerateInstanceVersion(version); + if (p_vkEnumerateInstanceVersion) + { + res = p_vkEnumerateInstanceVersion(version); + } + else + { + *version = VK_API_VERSION_1_0; + res = VK_SUCCESS; + } + TRACE("API version %u.%u.%u.\n", VK_VERSION_MAJOR(*version), VK_VERSION_MINOR(*version), VK_VERSION_PATCH(*version)); *version = min(WINE_VK_VERSION, *version); @@ -1117,6 +1129,8 @@ VkResult WINAPI wine_vkEnumeratePhysicalDeviceGroupsKHR(VkInstance instance, BOOL WINAPI DllMain(HINSTANCE hinst, DWORD reason, void *reserved) { + TRACE("%p, %u, %p\n", hinst, reason, reserved); + switch (reason) { case DLL_PROCESS_ATTACH: diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c index 58c08ad8180..93c3065c059 100644 --- a/dlls/winex11.drv/vulkan.c +++ b/dlls/winex11.drv/vulkan.c @@ -82,7 +82,6 @@ static void (*pvkDestroyInstance)(VkInstance, const VkAllocationCallbacks *); static void (*pvkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); static void (*pvkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); static VkResult (*pvkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *); -static VkResult (*pvkEnumerateInstanceVersion)(uint32_t *); static VkResult (*pvkGetDeviceGroupSurfacePresentModesKHR)(VkDevice, VkSurfaceKHR, VkDeviceGroupPresentModeFlagsKHR *); static void * (*pvkGetDeviceProcAddr)(VkDevice, const char *); static void * (*pvkGetInstanceProcAddr)(VkInstance, const char *); @@ -132,7 +131,6 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context) LOAD_FUNCPTR(vkGetPhysicalDeviceXlibPresentationSupportKHR) LOAD_FUNCPTR(vkGetSwapchainImagesKHR) LOAD_FUNCPTR(vkQueuePresentKHR) - LOAD_OPTIONAL_FUNCPTR(vkEnumerateInstanceVersion) LOAD_OPTIONAL_FUNCPTR(vkGetDeviceGroupSurfacePresentModesKHR) LOAD_OPTIONAL_FUNCPTR(vkGetPhysicalDevicePresentRectanglesKHR) #undef LOAD_FUNCPTR @@ -426,19 +424,6 @@ static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_ return res; } -static VkResult X11DRV_vkEnumerateInstanceVersion(uint32_t *version) -{ - TRACE("%p\n", version); - - if (!pvkEnumerateInstanceVersion) - { - *version = VK_API_VERSION_1_0; - return VK_SUCCESS; - } - - return pvkEnumerateInstanceVersion(version); -} - static VkResult X11DRV_vkGetDeviceGroupSurfacePresentModesKHR(VkDevice device, VkSurfaceKHR surface, VkDeviceGroupPresentModeFlagsKHR *flags) { @@ -555,7 +540,6 @@ static const struct vulkan_funcs vulkan_funcs = X11DRV_vkDestroySurfaceKHR, X11DRV_vkDestroySwapchainKHR, X11DRV_vkEnumerateInstanceExtensionProperties, - X11DRV_vkEnumerateInstanceVersion, X11DRV_vkGetDeviceGroupSurfacePresentModesKHR, X11DRV_vkGetDeviceProcAddr, X11DRV_vkGetInstanceProcAddr, @@ -612,8 +596,6 @@ static void *get_vulkan_driver_instance_proc_addr(const struct vulkan_funcs *vul return vulkan_funcs->p_vkCreateInstance; if (!strcmp(name, "EnumerateInstanceExtensionProperties")) return vulkan_funcs->p_vkEnumerateInstanceExtensionProperties; - if (!strcmp(name, "EnumerateInstanceVersion")) - return vulkan_funcs->p_vkEnumerateInstanceVersion; if (!instance) return NULL; diff --git a/include/wine/vulkan_driver.h b/include/wine/vulkan_driver.h index 37fe9ad3066..790d63076d3 100644 --- a/include/wine/vulkan_driver.h +++ b/include/wine/vulkan_driver.h @@ -39,7 +39,7 @@ #define __WINE_VULKAN_DRIVER_H /* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */ -#define WINE_VULKAN_DRIVER_VERSION 5 +#define WINE_VULKAN_DRIVER_VERSION 6 struct vulkan_funcs { @@ -55,7 +55,6 @@ struct vulkan_funcs void (*p_vkDestroySurfaceKHR)(VkInstance, VkSurfaceKHR, const VkAllocationCallbacks *); void (*p_vkDestroySwapchainKHR)(VkDevice, VkSwapchainKHR, const VkAllocationCallbacks *); VkResult (*p_vkEnumerateInstanceExtensionProperties)(const char *, uint32_t *, VkExtensionProperties *); - VkResult (*p_vkEnumerateInstanceVersion)(uint32_t *); VkResult (*p_vkGetDeviceGroupSurfacePresentModesKHR)(VkDevice, VkSurfaceKHR, VkDeviceGroupPresentModeFlagsKHR *); void * (*p_vkGetDeviceProcAddr)(VkDevice, const char *); void * (*p_vkGetInstanceProcAddr)(VkInstance, const char *);