doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.44k stars 868 forks source link

silent hunter 3 | DXVK | resolution fix #4501

Open Sergey-pmr opened 3 days ago

Sergey-pmr commented 3 days ago

d3d9.zip fix resolution

The original resolution of the game is 1024 720 and it cannot be changed in the game, there is a resolution fix for this to get 1920 by 1080. The problem is that I can't run these two dlls. Can dxvk change the resolution forcibly?

I also tried AutoInject for dll injections, but it didn't help.

Any ideas?

Blisto91 commented 2 days ago

Hi there.

Can dxvk change the resolution forcibly?

It can not. I don't have any ideas besides trying to see if it works by changing the name of the dll to e.g. dinput8.dll and see if it still works

qinlili23333 commented 2 days ago

The fix u provided is a wrapper (it will load system dll after it's loaded). image It uses GetSystemDirectoryA to get system path and concat with "d3d9.dll" to load system d3d9.dll, then call LoadLibraryA to load it.

That's why any common injector cannot be used to solve this issue.

However, it's possible to use DXVK with this fix.

If u have access to source code of this fix, u can easily change GetSystemDirectoryA to some other folder which contains DXVK dll.

Or if u don't have source code or cannot compile this fix, u can write another DLL wrapper which is loaded before d3d9.dll, and use Detours to hook LoadLibraryA, if the path equals "C:\WINDOWS\system32\d3d9.dll" then u just replace it with path to DXVK d3d9.dll.

Sergey-pmr commented 2 days ago

@qinlili23333 thank you very much, is it possible to force the fix to set the resolution to 2560 by 1440? I'll try to write my own wrapper using chatgpt that connects the resolution fix and then intercepts LoadLibraryA and substitutes the path to dxvk.

qinlili23333 commented 2 days ago

@qinlili23333 thank you very much, is it possible to force the fix to set the resolution to 2560 by 1440? I'll try to write my own wrapper using chatgpt that connects the resolution fix and then intercepts LoadLibraryA and substitutes the path to dxvk.

Of course it's possible. You just need to modify the dll, find 1920 and 1080 then replace them. X64dbg is a useful tool to complete this.