Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incoming Forces - rendering issues #100

Closed
WinterSnowfall opened this issue Feb 2, 2023 · 7 comments
Closed

Incoming Forces - rendering issues #100

WinterSnowfall opened this issue Feb 2, 2023 · 7 comments
Labels
bug Something isn't working
Milestone

Comments

@WinterSnowfall
Copy link

This will be an "interesting" game to fix, because it doesn't work with WineD3D. It works fine with d8vk as long as the virtual desktop is on in Wine, however the rendering is broken at times, with what I'd generally call "vertex surrealism".

It can be clearly noticed when the first mission intro gets to the hangar in the attached trace. Apologies for the abrupt end in the trace, but at some point I simply couldn't bear the 1fps capture any more and it had gotten past the interesting point anyway (the cutscenes are unskippable...).

Software information

Incoming Forces (GOG)

System information

  • GPU: RTX 3060
  • Driver: 525.78.01
  • Wine version: 7.22 Staging
  • DXVK version: f4988e7

Apitrace file(s)

forces.trace.tar.xz

Log files

@Blisto91
Copy link

Blisto91 commented Feb 2, 2023

INCOMING!!! HIDE! 🏃

@AlpyneDreams AlpyneDreams added the bug Something isn't working label Feb 23, 2023
@AlpyneDreams
Copy link
Owner

Seems like this behaves the same way on WineD3D. Not sure what I can do to fix this, if anything.

@WinterSnowfall
Copy link
Author

WinterSnowfall commented Apr 21, 2023

Just to note the "progress" here, moving VB/IB to MANAGED has made the problem even worse 😄 .

Spoiler

Incoming

@AlpyneDreams
Copy link
Owner

AlpyneDreams commented Apr 22, 2023

This game is doing very weird stuff with buffers. The soldier models that are broken are SYSTEMMEM DYNAMIC, but not WRITEONLY, vertex/index buffers that are being locked constantly with DISCARD and NOOVERWRITE, inconsistently.

This is the first offending draw call and the one before it, in frame 326 of the trace:
image

It seem to have indices that refer to verts from outside the range that was locked before the drawcall so I assume this is an issue with the index buffer being trampled on, possibly by the next or previous draw call.

Also, it's probably reading back from the buffers and doing its own TCL on the CPU, I think.

Vertices / indices come into the vertex shader already clipped, skinned, lit, and locally transformed.
image

Occasionally, it gets it very wrong:
image

If it's reading something back from the buffers that is wrong then it may be applying TCL to it wrong too. It might be difficult to debug this issue with just the apitrace, so I think this one will have to wait.

@WinterSnowfall
Copy link
Author

I've tried forcing SWVP on the game and it seems to be fine with that:

error Creating device (behaviour D3DCREATE_HARDWARE_VERTEXPROCESSING PUREDEVICE)
error Creating device (behaviour D3DCREATE_HARDWARE_VERTEXPROCESSING)
error Creating device (behaviour D3DCREATE_MIXED_VERTEXPROCESSING)
found suitable behaviour D3DCREATE_SOFTWARE_VERTEXPROCESSING

... but sadly it doesn't help with the above. I've finished the game ages ago on a Riva TNT2 M64 (which had no HWVP IIRC), which is why I thought it was worth a shot.

I guess this might be SSE2 related after all, as noted above. Forcing the msvcp90.dll and msvcr90.dll the game ships with doesn't seem to fix anything though.

@WinterSnowfall
Copy link
Author

I guess this might be SSE2 related after all, as noted above. Forcing the msvcp90.dll and msvcr90.dll the game ships with doesn't seem to fix anything though.

Some updates on that front:

  • I've tested the game with a variant of the msvcrt.dll from Wine that has SSE2 support disabled. That does nothing to fix the game, although the game does load it.
  • To make it even more apparent that it's unrelated, WineD3D now renders the offending section correctly, namely the marines in the docking bay (tested with Wine 9.8).

@WinterSnowfall
Copy link
Author

Looks fine now with dxvk master, not sure what fixed it, but I'm happy to put it behind us.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants