elishacloud / dxwrapper

Fixes compatibility issues with older games running on Windows 10/11 by wrapping DirectX dlls. Also allows loading custom libraries with the file extension .asi into game processes.
zlib License
1.16k stars 83 forks source link

Fix newer Windows 10 awful performance with d3d9 software vertex processing #111

Closed mirh closed 1 year ago

mirh commented 3 years ago

See https://github.com/Nucleoprotein/OneTweakNG/issues/1#issuecomment-568756645 https://docs.microsoft.com/en-us/windows/win32/direct3d9/d3dcreate https://social.msdn.microsoft.com/Forums/en-US/a84dce94-49f4-4118-9e68-fe412c909ee4/directx-9-program-runs-terribly-after-win10-update-1607

Perhaps switching to mixed and hardware one may be already some solution (idk I'm not a dev), but if the original game devs didn't think to it my uneducated guess would be there was a legit reason.

elishacloud commented 3 years ago

Interesting. It looks like changing the vertex buffer to use system memory and switching the vertex processing to mixed mode solved the performance issues. Mixed mode processing is not normally recommended by Microsoft. But I suppose adding an option for this would be good.

mirh commented 3 years ago

I mean, to be fair, the last link could as well be just amd-specific.. they have been skimping on the d3d9 driver as of the last years in turn. But nice for the option.

Assuming it actually ever was just for retrocompatibility, I wonder if it couldn't be safe to have all vertex processing be forced on hardware on say akk >DX10 or >SM3 gpus?

mirh commented 3 years ago

https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9451/diffs Not exactly linked to the problem here, but I guess you might found interesting these behind the scenes factlets.

mirh commented 2 years ago

Mhh, so, I just got some testing (yes, sorry for the lazy ass) But ForceMixedVertexProcessing doesn't really help much, while ForceSystemMemVertexCache totally nukes framerate.

Maybe forcing hardware processing could do it?

elishacloud commented 2 years ago

Forcing hardware processing should do it. But may also cause graphical issues is the hardware cannot support somethings. Though it should be less of an issue with d3d9, I think. There is already an option to ForceMixedVertexProcessing. I could create a new option to ForceHardwareVertexProcessing.

mirh commented 2 years ago

Not really sure what could be the point of forcing modes if it isn't to improve performance (also was there any specific reason behind ForceSystemMemVertexCache?), but maybe you could have a single option with an integer value rather than a boolean.

EDIT: nevermind, over at dxwnd they report quite the success with the flags. It's just that they are just a drop in the bucket compared to all the other changes.