On 6.8.2017 20:36, Stefan Dösinger wrote:
On 06/08/17 17:19, Jan Havran wrote:
Can I simply edit some code in Wine (some D3D flag) so the game will think that it use SW vertexes, so after checking some flags by game it will not jump into some unfinished branches for HW vertexes? I just want to test if it is really caused by this. From application view, what is difference between using SW and HW vertexes, do you think that using HW vertexes with code done for SW vertexes will work?
This behavior should already be in place. If the app requsts a software vertex processing device and asks us for the device description later we should report that this is a software vertex processing device. We even do some software-like things if the app wants SWVP, like ignore D3DLOCK_DISCARD on buffers.
The game may check some derived properties though and expect some capability that SWVP has, but HWVP does not. The most likely case is support for more than 256 vertex shader constants. Modern GPUs support much more than that in OpenGL, but not in d3d8/9 on Windows. Because of this we filter this in dlls/d3d8/device.c, d3dcaps_from_wined3dcaps(). Look for D3D8_MAX_VERTEX_SHADER_CONSTANTF at the end. It is likely that this restriction is not in place on Windows with SWVP. You can try to just disable this line.
Wine is big magic to me right now, so thank you for your tips, I will try to test that.
Another possible culprit is fixed function vertex blending using matrix indices. You can try to set MaxVertexBlendMatrices and MaxVertexBlendMatrixIndex to 4 and 256 respectively (check on Windows if those values are accurate, I might misremember them). This functionality is unimplemented in Wine, so expect rendering problems if the game uses this. It should be possible to implement this feature in our fixed function replacement shader though.
Ok, I will test it. Unfrotunately I didnt find piece of code where the game decide which vertex processing it will use yet - maybe I will install Windows so I will be able to compare execution of branches between Windows and Linux.
The bug report doesn't have a crash dump. The similarity to windows HWVP might mislead you. Try to compare your crash to the one of windows HWVP. in particular, see if the crash address is the same.
Well, I was talking about my issue with Brchi and we came to the conclusion that it was crashing in the same function for both Linux (Wine) and Windows (with enabled HWVP). Unfortunately, there is version of his util without HWVP enabled (which doesnt work in Wine as I said, because the game use branches for HWVP here) and after that version with HWVP enabled only, but with fixed game code (by memory patching) so there is no way how can I test it on Windows (because I dont have version of the util where it is crashing for Windows, since there is no version with HWVP enabled and without fix of this issue at the same time).
Anyway, this game has plenty of problems on newer Windows, but I never heard about this issue even on Windows 10.
I will try some tests you described and report back as soon as possible.
Thanks for your time.