Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
[WIP] DXVK as a native library for wine-integration #926
This WIP PR allows DXVK to be built and installed as a native system library (libdxvk.so) for use by wine, as recommended by Henri Verbeet. The accompanying wine code can be found here.
The goal of this PR is to allow easy integration of DXVK into wine, without manual installation or use of third party tools.
This branch uses function pointers passed in from the entry point when it needs access to windows-specific APIS, similar to VKD3D. Right now the pointers are stored in a global struct that is accessed by various parts of DXVK (vulkan_presenter.cpp, thread_generic.cpp, d3d11_device.cpp, and vulkan_loader.cpp), which may be a problem. Alternatively, for cleaner code, we could store the relevant function pointers as static members of the relevant class.
Another potential issue is the compiler directives making the code unmaintainable. This PR adds 12 new compiler directives. If anyone can find places where I can reduce this number, please share your ideas.
Finally, the biggest issue may be the duplication of dxgi_swapchain and dxgi_monitor code into wine. These classes are heavy in win32 specific functions, so instead of passing in a large amount of function pointers to keep these in DXVK, I had WineDXGISwapChainFactory::CreateSwapChainForHwnd pass the internal d3d11 presenter to wine, which is then used to create a DXGISwapChain for the application. If it would be preferable to keep the IDXGISwapChain inside of DXVK, I will change that.
Finally, there are some trivial things left to implement in DXVK Native.
Guide to use:
I did a build of dxvk and wine 4.2 with your patches for CentOS 7.6 and Fedora 28/29.
Build of libdxvk and patched Wine 4.2 for Fedora 28/29 if anyone wants to test: https://copr.fedorainfracloud.org/coprs/leonmaxx/wine-dxvk/
Thanks but that didn't helped.
This change does fix file names for log and state cache files.
The game I tried to run is "World Of Tanks" and it works if I run it with DXVK built as Win32 library.
Thank you for investigating this issue, I thought that cutting off the string after the exe would fix that, but I guess not. Or were the symbols before .exe?
In regards to the WoT issue, the adapter message is to be expected, as we are using wine's DXGI. The class linkage issues are probably unrelated, do they happen w/ the win32 build? Finally, can you test whether WoT works w/ wine's DXGI when on a windows build of d3d11?
We (users) definitely want a
To reduce the number of required changes and/or improve PR/patch readability, you could do following:
Maybe there is more places to pay attention, but I don't checked further than Files changed tab.