The d3d12.dll contained in the Wow installation directory makes it crash when running with VKD3D

Questions about Wine on Linux
Locked
SwimmingTiger
Level 1
Level 1
Posts: 5
Joined: Fri Oct 18, 2019 5:27 am

The d3d12.dll contained in the Wow installation directory makes it crash when running with VKD3D

Post by SwimmingTiger »

I installed VKD3D, so I put its "d3d12.dll" to the "system32" directory and set the DLL override "d3d12" to "native then builtin".

It works well with other DX12 games, except World of Warcraft. The problem is that the World of Warcraft installation directory (_retail_) contains its own "d3d12.dll" (used to provide user mode D3D12 in Windows 7). So when I set "d3d12" as "native then builtin", wine will load this "d3d12.dll" instead of the right one located in "system32". The DLL obviously cannot run normally in wine, so the game will just crash.

I know two simple solutions, but neither is good:
1. Delete "d3d12.dll" in the World of Warcraft installation folder.
2. Replace this dll with "d3d12.dll" of VKD3D.

The problem is that both of these need modify the game installation files. This brings up the following problems:
1. Every time the game is updated, the launcher will regenerate "d3d12.dll" which we don't want. Then we need to delete or replace again.
2. Due to issue 1, the process of deleting or replacing "d3d12.dll" cannot be automated by script (such as Lutris). When a Lutris user directly launches the game after downloading / updating it via the launcher, the game will crash and the Lutris client did not have the right time to intervene in the process.

So, can wine provide a way to control the native DLL loading order? Or does such a method already exist? I have two native dlls, one in "system32" and one in the game installation folder. Can I set environment variables or registry keys to make wine only load the native dll in "system32" and ignore the one in the game installation folder?
SwimmingTiger
Level 1
Level 1
Posts: 5
Joined: Fri Oct 18, 2019 5:27 am

Re: The d3d12.dll contained in the Wow installation directory makes it crash when running with VKD3D

Post by SwimmingTiger »

I got VKD3D from here:

https://github.com/lutris/dxvk/releases

It is compiled to native dll "d3d12.dll", just like DXVK's "d3d11.dll".
Cybermax
Level 4
Level 4
Posts: 218
Joined: Fri Dec 01, 2017 5:26 pm

Re: The d3d12.dll contained in the Wow installation directory makes it crash when running with VKD3D

Post by Cybermax »

I do not have these problems with WoW and using vkd3d-proton (which is the one lutris is using), but i set it to "native" only.

You must make sure that you create either symlinks (the easiest) or copy the files directly.
I symlink the following:
/folder/where_d3d12.dll_is_extracted/x64/d3d12.dll -> /my/wine_prefix_folder/drive_c/windows/system32
/folder/where_d3d12.dll_is_extracted/x86/d3d12.dll -> /my/wine_prefix_folder/drive_c/windows/syswow64

Add "d3d12.dll" to the dll-overrides set to "native".

Launch WoW using Wow.exe -d3d12 option (Either from the battle.net launcher and "game options" or by running a script manually).

Afaik when it comes to wine, the search-order seems to be the windows system folders before anything when using "native" override.
Locked