protonscr

[QUESTION] What can I do when I've two solutions using the same DLL names (d3d9.dll)

dxvkclosed question
doitsujin/dxvk#4832 · opened 2025-04-05 by Sol1vaN · updated 2025-05-11 · 5 comments · github
5 matching comments, n / p to jump
SSol1vaN 2025-04-05 github

Hi there,

I'm playing Enter The Matrix, and the widescreen solution comes with d3d9.dll file.
https://github.com/ThirteenAG/WidescreenFixesPack/releases/tag/enterthematrix

But the doitsujin vulkan wrapper comes with d3d9.dll too
So, what can I do in this case?

I don't like to implement it on my system32 folder because I like to maintain my system intact, only I like to apply wrappers/patches on the games, not to system.

I hope this can be a way to solve this.
Cheers.

KK0bin maintainer 2025-04-05 github

Ask the mod author to support chain loading a specific d3d9 dll with a different name.

Or use Linux.

Qqinlili23333 2025-04-06 github

I've checked the link you provided. Seems this mod is just one ASI packed with some d3d9 proxy as ASI loader. The d3d9 proxy source is not available in this repo. You may find some alternative ASI loader to do chain loading.

Since you are on Windows and just require it for d3d9, there is another hacky way to do this without modification on mod file. I've used this approach for a long time.
You need Sandboxie, install it, add a new sandbox for DXVK only. Run explorer in this sandbox (window title with [#] by default, check twice the right window to avoid bricking your system) and replace d3d9.dll in SysWOW64 with 32-bit DXVK one (since it's in sandbox, this won't brick your system, but ensure only d3d9.dll, DO NOT replace dxgi.dll). A well-configured sandbox should like this if you browse file in sandboxie manager.
Image
You can also run control in this sandbox and set user variable DXVK_HUD to configure dxvk hud for the sandbox (user variable can be different inside sandbox). After this, right click the new sandbox and click Terminate All Processes, then start a new explorer in sandbox and start the game with mod, dxvk should be available.
The disadvantage for this is the IO performance in sandbox is poor, you may feel performance downgrade during game, and this approach is not compatible with all games but most d3d9 games work as I have tested.
This approach can also be used to do apitrace with dxvk, just put apitrace dll with game and run the game (actually this approach is much easier than configuring variables to make apitrace using dxvk, I really love this hacky way).

Or just Linux if you're tired with all these hacky tricks.

DDigger1955 2025-04-06 github

You can try to use the solution from:

https://www.pcgamingwiki.com/wiki/Enter_the_Matrix#Extremely_low_performance

but use DXVK d3d9.dll instead of dgVoodoo2 d3d9.dll and D3DImm.dll.

If it won't work, then you can try to use DXVK in conjunction with dgVoodoo2, using the same solution from PcGamingWiki.

You can set dgVoodoo2 mode in dgVoodoo.conf:
[General] section, OutputAPI parameter, set it to "d3d11_fl11_0" (without quotes).

Then copy d3d11.dll and dxgi.dll from DXVK and try to use solution from PcGamingWiki.

If you use 1st option, then after you set resolution in MatrixOptions.exe, you will have dinput8.dll (WidescreenFix) and D3D9 x32 to DXVK x32 translation layer working.

If you use 2nd option, then after you set resolution in MatrixOptions.exe, you will have dinput8.dll (WidescreenFix), D3D9 x32 to dgVoodoo2 (D3D11) x32 to DXVK x32 translation layer working.

I checked that 2nd option is working properly in another game - Need for Speed Carbon - it has the WidescreenFix too.

KK0bin maintainer 2025-04-06 github

@Digger1955 That only works for DgVoodoo which is not what the person, who opened the issue, wanted to run in the first place.

SSol1vaN 2025-05-04 github

qinlili23333 many thanks for your reply.
I never imagined Sandboxie could do that, impressive

K0bin not exactly, my approach is to make MSAA work, I don't care how to.

for information purposes
I noticed this stance:
ThirteenAG widescreenfix correctly recognizes dinput8.dll as a valid DLL.

The initial steps to follow are:

Steps to combine dxvk and WidescreenFix:

  • In the game folder, rename d3d9.dll to dinput8.dll
    Doing this name change, makes the MatrixOptions.exe will not longer show 16:9 resolutions
    Image
    but this don't matter, the widescreenfix still work on the game
  • We only need to ensure the MatrixConfig.ini wtill have the following line
    RESOLUTION =2560x1440
  • Now, unzip d3d9.dll from the dxvk wrapper (doitsujin)
    https://github.com/doitsujin/dxvk
  • Create a dxvk.conf file in the main folder of the game
  • Enter the following line in the dxvk.conf file: d3d9.forceSwapchainMSAA = 16 (possible values ​​0 to 16)
  • Run the game
    Image
    now we are ready to combat (no more aliasing edges)
    Image
    game files now would be look like:
    Image

Problems with the DXVK wrapper from Doitsujin:
The game will experience some stuttering (not much, but it will be noticeable).
I believe this issue is caused by something called the "DXVK Sync Cache"
dxvk wrappers are synced to frames to be drawn after shaders finish compiling
giving us stuttering in many games, like Enter the Matrix

https://youtu.be/LIXWHIjnk9w

So, there's other DXVK wrapper from Ph42oN that have a dxvk-async feature
dxvk-async let us drawn frames before shaders finish compiling, giving a reduced stuttering (theoretically)
https://gitlab.com/Ph42oN/dxvk-gplasync/-/releases
I've tested this wrapper, but the stuttering still are noticeable

And from sporif (deprecated) Enter the Matrix don't work
https://github.com/Sporif/dxvk-async/releases/tag/2.0
Image

Next step is test all this with dgVoodoo2 wrapper:

  • So we need to delete:
    d3d9.dll (from DXVK wrapper Doitsujin)
    dxvk.conf (from DXVK wrapper Doitsujin)
  • Now copy the d3d9.dll from dgVoodoo2
  • Execute dgVoodooCpl.exe and add path to the game
    Image
    now we can generate dgVoodoo.conf from the aplicattion changing General Options
    Image
    and DirectX options (press Apply to generate dgVoodoo.conf in the game folder)
    Image
  • Finally, run the game
    Image
    again, no aliased edges (I noticed dgvd2 have better AA than dxvk)
    Image
    game files would be look like:
    Image

The stuttering gone, the game is more fluid and constant
but...
dgVoodoo2 makes the game have flickering zfight shadows...
Image
Image

https://youtu.be/u74-qwlNw_g

aaah this is a good moment Warner Bros release the source code to make a sourceport of Enter the Matrix
but we know that never will happen...
😌

or...
changing advanced setting on dgVoodoo2?
Image
Image
Image

but is a pain balls do that
😫

Launch options

DLLs