The WINE implementation of DirectX 8 is understandably very old and I don't expect it to be getting any updates any time soon, so a way to get more FPS out of the game is to use
dxwrapper
to convert the DirectX 8 calls to DirectX 9. This might already boost performance as wined3d9 might be faster thanks to more work being done to it.
However, at least for me, the big performance gains come from then using
dxvk
(formerly d9vk) to convert the DirectX 9 calls over to Vulkan.
Installation is simple:
dxwrapper can be installed into the game via two ways, either by loading it as an ASI if you already have an ASI loader installed, or by hooking a custom d3d8 dll.
The popular widescreen patch already works off of an ASI loader, so if you are using that you are good to go. Now just download the newest version of dxwrapper off their github releases page and drop "dxwrapper.asi" and "dxwrapper.ini" from the archive into your H&D2 installation folder's "scripts" subfolder. Note the lowercase letters! "Scripts" is a location for the game's files and the wrapper will not run if you place the files there.
Also note that
it is unadvisable to extract all of the contents of the archive to your game folder! Dxwrapper is meant to be used by selecting individual DLLs/ASIs you need and not by dumping everything in at once. It is likely the game will cease to work if you do this.
If you don't have the widescreen patch or other ASI loader installed, drop the d3d8.dll file from the archive's "Stubs" folder into the main installation folder of H&D2 and then drop the dxwrapper.dll and dxwrapper.ini files there as well.
After dropping whatever files you need, open dxwrapper.ini and under [Compatibility] change "d3d8to9" from "0" to "1".
You can also check for additional settings under "d3d9" and enable them if you want to, but this is not necessary.
If you don't already have dxvk (This is automatically installed and enabled in Proton, for example), download it from the github releases page, extract it somewhere and run the setup script under your chosen wine prefix:
env WINEPREFIX=path/to/prefix ./setup_dxvk.sh install
If you use the default wineprefix you can omit the env WINEPREFIX part.
After this you are all set! You have enabled dxwrapper in your H&D2 installation and dxvk will further convert that to Vulkan.
I personally experienced some hitches here and there when running d3d8, such as fps drops in Africa1 (30fps when at certain angles) and some custom maps completely tanking my fps if I look the wrong way. With dxwrapper and dxvk my game is locked at 95FPS all the time. (This seems to be some sort of a game fps lock?)
Note that your graphics card and its driver need to support vulkan in order for this to work. If you are running any discrete graphics card or anything newer than 2010 along with the latest mesa driver, you should be fine.[/code]