mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-11-29 10:24:10 +01:00
[build] Use native Vulkan ABI for winelib builds (#520)
Allows 32-bit winelib builds to run.
This commit is contained in:
parent
55632c6b61
commit
2ff614b241
@ -26,7 +26,7 @@ else
|
||||
endif
|
||||
|
||||
if meson.get_cross_property('winelib', false)
|
||||
lib_vulkan = declare_dependency(link_args: [ '-lvulkan-1' ])
|
||||
lib_vulkan = declare_dependency(link_args: [ '-lwinevulkan' ])
|
||||
lib_d3d11 = declare_dependency(link_args: [ '-ld3d11' ])
|
||||
lib_dxgi = declare_dependency(link_args: [ '-ldxgi' ])
|
||||
lib_d3dcompiler_43 = declare_dependency(link_args: [ '-L'+dxvk_library_path, '-ld3dcompiler_43' ])
|
||||
|
@ -1,9 +1,21 @@
|
||||
#include "dxvk_vulkan_loader.h"
|
||||
|
||||
namespace dxvk::vk {
|
||||
|
||||
|
||||
#if defined(__WINE__)
|
||||
|
||||
extern "C"
|
||||
PFN_vkVoidFunction native_vkGetInstanceProcAddrWINE(VkInstance instance, const char *name);
|
||||
static const PFN_vkGetInstanceProcAddr GetInstanceProcAddr = native_vkGetInstanceProcAddrWINE;
|
||||
|
||||
#else
|
||||
|
||||
static const PFN_vkGetInstanceProcAddr GetInstanceProcAddr = vkGetInstanceProcAddr;
|
||||
|
||||
#endif
|
||||
|
||||
PFN_vkVoidFunction LibraryLoader::sym(const char* name) const {
|
||||
return ::vkGetInstanceProcAddr(nullptr, name);
|
||||
return dxvk::vk::GetInstanceProcAddr(nullptr, name);
|
||||
}
|
||||
|
||||
|
||||
@ -12,13 +24,13 @@ namespace dxvk::vk {
|
||||
|
||||
|
||||
PFN_vkVoidFunction InstanceLoader::sym(const char* name) const {
|
||||
return ::vkGetInstanceProcAddr(m_instance, name);
|
||||
return dxvk::vk::GetInstanceProcAddr(m_instance, name);
|
||||
}
|
||||
|
||||
|
||||
DeviceLoader::DeviceLoader(VkInstance instance, VkDevice device)
|
||||
: m_getDeviceProcAddr(reinterpret_cast<PFN_vkGetDeviceProcAddr>(
|
||||
::vkGetInstanceProcAddr(instance, "vkGetDeviceProcAddr"))),
|
||||
dxvk::vk::GetInstanceProcAddr(instance, "vkGetDeviceProcAddr"))),
|
||||
m_device(device) { }
|
||||
|
||||
|
||||
|
@ -1,8 +1,23 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
* In 32-bit winelib build, alignment of Vulkan structures may be different than what
|
||||
* native C++ compiler expects. Wine exposes an extension, intended for winelib
|
||||
* applications, that exposes native Vulkan APIs with win32 additions, but using
|
||||
* native ABI.
|
||||
*/
|
||||
#ifdef __WINE__
|
||||
#pragma push_macro("_WIN32")
|
||||
#undef _WIN32
|
||||
#endif
|
||||
|
||||
#define VK_USE_PLATFORM_WIN32_KHR 1
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#ifdef __WINE__
|
||||
#pragma pop_macro("_WIN32")
|
||||
#endif
|
||||
|
||||
#define VULKAN_FN(name) \
|
||||
VulkanFn<::PFN_ ## name> name = sym(#name)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user