winevulkan: Move Vulkan calls to Unix lib.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
187e4d7e2f
commit
250072f91e
|
@ -21,6 +21,7 @@
|
|||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winternl.h"
|
||||
#include "winreg.h"
|
||||
#include "winuser.h"
|
||||
#include "initguid.h"
|
||||
|
@ -218,10 +219,8 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
|
|||
ReleaseDC(0, hdc);
|
||||
if (!driver)
|
||||
ERR("Failed to load Wine graphics driver supporting Vulkan.\n");
|
||||
else
|
||||
unix_funcs = unix_vk_init(driver);
|
||||
|
||||
return driver != NULL;
|
||||
return driver && !__wine_init_unix_lib(hinstance, DLL_PROCESS_ATTACH, driver, &unix_funcs);
|
||||
}
|
||||
|
||||
static BOOL wine_vk_init_once(void)
|
||||
|
@ -239,7 +238,7 @@ VkResult WINAPI wine_vkCreateInstance(const VkInstanceCreateInfo *create_info,
|
|||
if(!wine_vk_init_once())
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
|
||||
return unix_vkCreateInstance(create_info, allocator, instance);
|
||||
return unix_funcs->p_vkCreateInstance(create_info, allocator, instance);
|
||||
}
|
||||
|
||||
VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_name,
|
||||
|
@ -259,7 +258,7 @@ VkResult WINAPI wine_vkEnumerateInstanceExtensionProperties(const char *layer_na
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
return unix_vkEnumerateInstanceExtensionProperties(layer_name, count, properties);
|
||||
return unix_funcs->p_vkEnumerateInstanceExtensionProperties(layer_name, count, properties);
|
||||
}
|
||||
|
||||
VkResult WINAPI wine_vkEnumerateInstanceVersion(uint32_t *version)
|
||||
|
@ -272,7 +271,7 @@ VkResult WINAPI wine_vkEnumerateInstanceVersion(uint32_t *version)
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
return unix_vkEnumerateInstanceVersion(version);
|
||||
return unix_funcs->p_vkEnumerateInstanceVersion(version);
|
||||
}
|
||||
|
||||
static HANDLE get_display_device_init_mutex(void)
|
||||
|
|
|
@ -2263,6 +2263,11 @@ class VkGenerator(object):
|
|||
|
||||
def generate_thunks_c(self, f, prefix):
|
||||
self._generate_copyright(f)
|
||||
|
||||
f.write("#if 0\n")
|
||||
f.write("#pragma makedep unix\n")
|
||||
f.write("#endif\n\n")
|
||||
|
||||
f.write("#include \"config.h\"\n")
|
||||
f.write("#include \"wine/port.h\"\n\n")
|
||||
|
||||
|
|
|
@ -17,11 +17,17 @@
|
|||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#pragma makedep unix
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include <time.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "ntstatus.h"
|
||||
#define WIN32_NO_STATUS
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winreg.h"
|
||||
|
@ -448,11 +454,14 @@ static void wine_vk_device_free(struct VkDevice_T *device)
|
|||
free(device);
|
||||
}
|
||||
|
||||
const struct unix_funcs *unix_vk_init(const struct vulkan_funcs *driver)
|
||||
NTSTATUS CDECL __wine_init_unix_lib(HMODULE module, DWORD reason, const void *driver, void *ptr_out)
|
||||
{
|
||||
if (reason != DLL_PROCESS_ATTACH) return STATUS_SUCCESS;
|
||||
|
||||
vk_funcs = driver;
|
||||
p_vkEnumerateInstanceVersion = vk_funcs->p_vkGetInstanceProcAddr(NULL, "vkEnumerateInstanceVersion");
|
||||
return &loader_funcs;
|
||||
*(const struct unix_funcs **)ptr_out = &loader_funcs;
|
||||
return STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
/* Helper function for converting between win32 and host compatible VkInstanceCreateInfo.
|
||||
|
|
|
@ -9,6 +9,10 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#if 0
|
||||
#pragma makedep unix
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
#include "wine/port.h"
|
||||
|
||||
|
|
Loading…
Reference in New Issue