Commit f6e80017 authored by Alexandros Frantzis's avatar Alexandros Frantzis Committed by Alexandre Julliard

winewayland.drv: Add skeleton Vulkan driver.

parent a85055ee
......@@ -8,6 +8,7 @@ SOURCES = \
dllmain.c \
version.rc \
viewporter.xml \
vulkan.c \
wayland.c \
wayland_keyboard.c \
wayland_output.c \
......
/* WAYLANDDRV Vulkan implementation
*
* Copyright 2017 Roderick Colenbrander
* Copyright 2021 Alexandros Frantzis
*
* 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
*/
#if 0
#pragma makedep unix
#endif
#include "config.h"
#include <dlfcn.h>
#include "waylanddrv.h"
#include "wine/debug.h"
#define VK_NO_PROTOTYPES
#define WINE_VK_HOST
#include "wine/vulkan.h"
#include "wine/vulkan_driver.h"
WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
#ifdef SONAME_LIBVULKAN
static void *vulkan_handle;
static void wine_vk_init(void)
{
if (!(vulkan_handle = dlopen(SONAME_LIBVULKAN, RTLD_NOW)))
ERR("Failed to load %s.\n", SONAME_LIBVULKAN);
}
static const struct vulkan_funcs vulkan_funcs;
/**********************************************************************
* WAYLAND_wine_get_vulkan_driver
*/
const struct vulkan_funcs *WAYLAND_wine_get_vulkan_driver(UINT version)
{
static pthread_once_t init_once = PTHREAD_ONCE_INIT;
if (version != WINE_VULKAN_DRIVER_VERSION)
{
ERR("version mismatch, vulkan wants %u but driver has %u\n", version, WINE_VULKAN_DRIVER_VERSION);
return NULL;
}
pthread_once(&init_once, wine_vk_init);
if (vulkan_handle)
return &vulkan_funcs;
return NULL;
}
#else /* No vulkan */
const struct vulkan_funcs *WAYLAND_wine_get_vulkan_driver(UINT version)
{
ERR("Wine was built without Vulkan support.\n");
return NULL;
}
#endif /* SONAME_LIBVULKAN */
......@@ -297,5 +297,6 @@ void WAYLAND_WindowPosChanged(HWND hwnd, HWND insert_after, UINT swp_flags,
BOOL WAYLAND_WindowPosChanging(HWND hwnd, HWND insert_after, UINT swp_flags,
const RECT *window_rect, const RECT *client_rect,
RECT *visible_rect, struct window_surface **surface) DECLSPEC_HIDDEN;
const struct vulkan_funcs *WAYLAND_wine_get_vulkan_driver(UINT version) DECLSPEC_HIDDEN;
#endif /* __WINE_WAYLANDDRV_H */
......@@ -38,7 +38,8 @@ static const struct user_driver_funcs waylanddrv_funcs =
.pUpdateDisplayDevices = WAYLAND_UpdateDisplayDevices,
.pWindowMessage = WAYLAND_WindowMessage,
.pWindowPosChanged = WAYLAND_WindowPosChanged,
.pWindowPosChanging = WAYLAND_WindowPosChanging
.pWindowPosChanging = WAYLAND_WindowPosChanging,
.pwine_get_vulkan_driver = WAYLAND_wine_get_vulkan_driver,
};
static NTSTATUS waylanddrv_unix_init(void *arg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment