winex11: Add Vulkan stubs.

Signed-off-by: Roderick Colenbrander <thunderbird2k@gmail.com>
Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Roderick Colenbrander 2018-02-26 19:42:16 +01:00 committed by Alexandre Julliard
parent 3de61a9dd9
commit 6a5c85564c
5 changed files with 93 additions and 5 deletions

View File

@ -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)

View File

@ -20,6 +20,7 @@ C_SRCS = \
pen.c \
settings.c \
systray.c \
vulkan.c \
window.c \
wintab.c \
x11drv_main.c \

View File

@ -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 */
};

71
dlls/winex11.drv/vulkan.c Normal file
View File

@ -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;
}

View File

@ -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;