diff --git a/dlls/winevulkan/vulkan.c b/dlls/winevulkan/vulkan.c index cfd67cfe8bb..e6c77cab325 100644 --- a/dlls/winevulkan/vulkan.c +++ b/dlls/winevulkan/vulkan.c @@ -69,15 +69,15 @@ static BOOL wine_vk_init(void) static VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info, const VkAllocationCallbacks *allocator, VkInstance *instance) { - FIXME("stub: %p %p %p\n", create_info, allocator, instance); - return VK_ERROR_INCOMPATIBLE_DRIVER; + TRACE("%p %p %p\n", create_info, allocator, instance); + return vk_funcs->p_vkCreateInstance(create_info, allocator, instance); } static VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name, uint32_t *count, VkExtensionProperties *properties) { - FIXME("stub: %p %p %p\n", layer_name, count, properties); - return VK_ERROR_OUT_OF_HOST_MEMORY; + TRACE("%p %p %p\n", layer_name, count, properties); + return vk_funcs->p_vkEnumerateInstanceExtensionProperties(layer_name, count, properties); } static PFN_vkVoidFunction WINAPI wine_vkGetInstanceProcAddr(VkInstance instance, const char *name) diff --git a/dlls/winex11.drv/Makefile.in b/dlls/winex11.drv/Makefile.in index 463eefdcfb7..747f509b44d 100644 --- a/dlls/winex11.drv/Makefile.in +++ b/dlls/winex11.drv/Makefile.in @@ -20,6 +20,7 @@ C_SRCS = \ pen.c \ settings.c \ systray.c \ + vulkan.c \ window.c \ wintab.c \ x11drv_main.c \ diff --git a/dlls/winex11.drv/init.c b/dlls/winex11.drv/init.c index 24ed656405a..be5537127a2 100644 --- a/dlls/winex11.drv/init.c +++ b/dlls/winex11.drv/init.c @@ -345,6 +345,21 @@ static struct opengl_funcs * X11DRV_wine_get_wgl_driver( PHYSDEV dev, UINT versi return ret; } +/********************************************************************** + * X11DRV_wine_get_vulkan_driver + */ +static const struct vulkan_funcs * X11DRV_wine_get_vulkan_driver( PHYSDEV dev, UINT version ) +{ + const struct vulkan_funcs *ret; + + if (!(ret = get_vulkan_driver( version ))) + { + dev = GET_NEXT_PHYSDEV( dev, wine_get_vulkan_driver ); + ret = dev->funcs->wine_get_vulkan_driver( dev, version ); + } + return ret; +} + static const struct gdi_dc_funcs x11drv_funcs = { @@ -475,7 +490,7 @@ static const struct gdi_dc_funcs x11drv_funcs = X11DRV_UnrealizePalette, /* pUnrealizePalette */ NULL, /* pWidenPath */ X11DRV_wine_get_wgl_driver, /* wine_get_wgl_driver */ - NULL, /* wine_get_vulkan_driver */ + X11DRV_wine_get_vulkan_driver, /* wine_get_vulkan_driver */ GDI_PRIORITY_GRAPHICS_DRV /* priority */ }; diff --git a/dlls/winex11.drv/vulkan.c b/dlls/winex11.drv/vulkan.c new file mode 100644 index 00000000000..b73f3798462 --- /dev/null +++ b/dlls/winex11.drv/vulkan.c @@ -0,0 +1,71 @@ +/* X11DRV Vulkan implementation + * + * Copyright 2017 Roderick Colenbrander + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" +#include "wine/port.h" + +#include "wine/debug.h" +#include "wine/vulkan.h" +#include "wine/vulkan_driver.h" + +WINE_DEFAULT_DEBUG_CHANNEL(vulkan); + +static VkResult X11DRV_vkCreateInstance(const VkInstanceCreateInfo *create_info, + const VkAllocationCallbacks *allocator, VkInstance *instance) +{ + FIXME("stub: %p %p %p\n", create_info, allocator, instance); + return VK_ERROR_INCOMPATIBLE_DRIVER; +} + +static void X11DRV_vkDestroyInstance(VkInstance instance, const VkAllocationCallbacks *allocator) +{ + FIXME("stub: %p %p\n", instance, allocator); +} + +static VkResult X11DRV_vkEnumerateInstanceExtensionProperties(const char *layer_name, + uint32_t *count, VkExtensionProperties* properties) +{ + FIXME("stub: %s %p %p\n", debugstr_a(layer_name), count, properties); + return VK_ERROR_OUT_OF_HOST_MEMORY; +} + +static void * X11DRV_vkGetInstanceProcAddr(VkInstance instance, const char *name) +{ + FIXME("stub: %p, %s\n", instance, debugstr_a(name)); + return NULL; +} + +static struct vulkan_funcs vulkan_funcs = +{ + X11DRV_vkCreateInstance, + X11DRV_vkDestroyInstance, + X11DRV_vkEnumerateInstanceExtensionProperties, + X11DRV_vkGetInstanceProcAddr +}; + +const struct vulkan_funcs *get_vulkan_driver(UINT version) +{ + if (version != WINE_VULKAN_DRIVER_VERSION) + { + ERR("version mismatch, vulkan wants %u but driver has %u\n", version, WINE_VULKAN_DRIVER_VERSION); + return NULL; + } + + return &vulkan_funcs; +} diff --git a/dlls/winex11.drv/x11drv.h b/dlls/winex11.drv/x11drv.h index 72036279c60..abd069e1b42 100644 --- a/dlls/winex11.drv/x11drv.h +++ b/dlls/winex11.drv/x11drv.h @@ -223,6 +223,7 @@ extern BOOL shape_layered_windows DECLSPEC_HIDDEN; extern const struct gdi_dc_funcs *X11DRV_XRender_Init(void) DECLSPEC_HIDDEN; extern struct opengl_funcs *get_glx_driver(UINT) DECLSPEC_HIDDEN; +extern const struct vulkan_funcs *get_vulkan_driver(UINT) DECLSPEC_HIDDEN; /* IME support */ extern void IME_SetOpenStatus(BOOL fOpen) DECLSPEC_HIDDEN;