Commit eb062df5 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

winevulkan: Use separated implementations for all 32-bit Unix calls.

parent 46f84ea2
......@@ -35,7 +35,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
DEFINE_DEVPROPKEY(DEVPROPKEY_GPU_LUID, 0x60b193cb, 0x5276, 0x4d0f, 0x96, 0xfc, 0xf1, 0x73, 0xab, 0xad, 0x3e, 0xc6, 2);
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_GPU_VULKAN_UUID, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5c, 2);
NTSTATUS (WINAPI *p_vk_direct_unix_call)(unixlib_handle_t handle, unsigned int code, void *args);
NTSTATUS (WINAPI *p_vk_direct_unix_call)(unixlib_handle_t handle, unsigned int code, void *args) = __wine_unix_call;
unixlib_handle_t unix_handle;
static HINSTANCE hinstance;
......@@ -239,9 +239,7 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
&unix_handle, sizeof(unix_handle), NULL))
return FALSE;
if (vk_unix_call(unix_init, &p_vk_direct_unix_call)) return FALSE;
if (!p_vk_direct_unix_call) p_vk_direct_unix_call = __wine_unix_call;
return TRUE;
return !vk_unix_call(unix_init, &p_vk_direct_unix_call);
}
static BOOL wine_vk_init_once(void)
......
......@@ -2686,9 +2686,9 @@ class VkGenerator(object):
f.write("const unixlib_entry_t __wine_unix_call_funcs[] =\n")
f.write("{\n")
f.write(" init_vulkan,\n")
f.write(" vk_is_available_instance_function,\n")
f.write(" vk_is_available_device_function,\n")
f.write(" init_vulkan32,\n")
f.write(" vk_is_available_instance_function32,\n")
f.write(" vk_is_available_device_function32,\n")
for vk_func in self.registry.funcs.values():
if not vk_func.needs_exposing():
continue
......
......@@ -410,6 +410,8 @@ static void wine_vk_device_free(struct wine_device *device)
free(device);
}
#ifdef _WIN64
NTSTATUS init_vulkan(void *args)
{
vk_funcs = __wine_get_vulkan_driver(WINE_VULKAN_DRIVER_VERSION);
......@@ -424,6 +426,23 @@ NTSTATUS init_vulkan(void *args)
return STATUS_SUCCESS;
}
#endif /* _WIN64 */
NTSTATUS init_vulkan32(void *args)
{
vk_funcs = __wine_get_vulkan_driver(WINE_VULKAN_DRIVER_VERSION);
if (!vk_funcs)
{
ERR("Failed to load Wine graphics driver supporting Vulkan.\n");
return STATUS_UNSUCCESSFUL;
}
#ifndef _WIN64
*(void **)args = vk_direct_unix_call;
#endif
return STATUS_SUCCESS;
}
/* Helper function for converting between win32 and host compatible VkInstanceCreateInfo.
* This function takes care of extensions handled at winevulkan layer, a Wine graphics
* driver is responsible for handling e.g. surface extensions.
......@@ -1587,6 +1606,8 @@ void wine_vkDestroyDebugReportCallbackEXT(VkInstance handle, VkDebugReportCallba
free(object);
}
#ifdef _WIN64
NTSTATUS vk_is_available_instance_function(void *arg)
{
struct is_available_instance_function_params *params = arg;
......@@ -1600,3 +1621,27 @@ NTSTATUS vk_is_available_device_function(void *arg)
struct wine_device *device = wine_device_from_handle(params->device);
return !!vk_funcs->p_vkGetDeviceProcAddr(device->device, params->name);
}
#endif /* _WIN64 */
NTSTATUS vk_is_available_instance_function32(void *arg)
{
struct
{
UINT32 instance;
UINT32 name;
} *params = arg;
struct wine_instance *instance = wine_instance_from_handle(UlongToPtr(params->instance));
return !!vk_funcs->p_vkGetInstanceProcAddr(instance->instance, UlongToPtr(params->name));
}
NTSTATUS vk_is_available_device_function32(void *arg)
{
struct
{
UINT32 device;
UINT32 name;
} *params = arg;
struct wine_device *device = wine_device_from_handle(UlongToPtr(params->device));
return !!vk_funcs->p_vkGetDeviceProcAddr(device->device, UlongToPtr(params->name));
}
......@@ -233,11 +233,14 @@ BOOL wine_vk_instance_extension_supported(const char *name) DECLSPEC_HIDDEN;
BOOL wine_vk_is_type_wrapped(VkObjectType type) DECLSPEC_HIDDEN;
NTSTATUS init_vulkan(void *args) DECLSPEC_HIDDEN;
NTSTATUS init_vulkan32(void *args) DECLSPEC_HIDDEN;
NTSTATUS WINAPI vk_direct_unix_call(unixlib_handle_t handle, unsigned int code, void *arg) DECLSPEC_HIDDEN;
NTSTATUS vk_is_available_instance_function(void *arg) DECLSPEC_HIDDEN;
NTSTATUS vk_is_available_device_function(void *arg) DECLSPEC_HIDDEN;
NTSTATUS vk_is_available_instance_function32(void *arg) DECLSPEC_HIDDEN;
NTSTATUS vk_is_available_device_function32(void *arg) DECLSPEC_HIDDEN;
struct conversion_context
{
......
......@@ -42999,9 +42999,9 @@ C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count);
const unixlib_entry_t __wine_unix_call_funcs[] =
{
init_vulkan,
vk_is_available_instance_function,
vk_is_available_device_function,
init_vulkan32,
vk_is_available_instance_function32,
vk_is_available_device_function32,
thunk32_vkAcquireNextImage2KHR,
thunk32_vkAcquireNextImageKHR,
thunk32_vkAcquirePerformanceConfigurationINTEL,
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