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

Flammable Freddy - Bad performance #2375

Closed
K0bin opened this issue Nov 22, 2021 · 2 comments · Fixed by #3765
Closed

Flammable Freddy - Bad performance #2375

K0bin opened this issue Nov 22, 2021 · 2 comments · Fixed by #3765
Labels

Comments

@K0bin
Copy link
Collaborator

K0bin commented Nov 22, 2021

Flammable Freddy, a game made by a Youtuber I regularly watch, runs very poorly with DXVK and runs out of address space. The game is made with a game engine called Clickteam Fusion, I assume other games using it have the same issue.

The problem is that the game heavily relies on D3DLOCK_NOOVERWRITE when uploading data before every draw. The buffer is a vertex buffer in the systemmem pool with the usages D3DUSAGE_WRITEONLY | D3DUSAGE_DYNAMIC. DXVK ignores D3DLOCK_NOOVERWRITE for everything that isn't in D3DPOOL_DEFAULT, so we do a ton of copying and eventually run out of address space.

The game itself isn't really important but it highlights that we still havent gotten the D3DLOCK flags right.

Software information

Flammable Freddy

System information

  • GPU: GTX 1070
  • Driver: 495.44
  • Wine version: 6.21
  • DXVK version: 1.9.2 or PR 2364.

Log files

  • d3d9.log: Not useful.
@K0bin
Copy link
Collaborator Author

K0bin commented Jun 2, 2023

The problematic buffer is ~300kb. It doesn't crash anymore because DXVK limits the amount of staging memory that can be used for buffer uploads but performance is atrocious with 30+ gpu syncs per frame taking a combined 30+ms.

Unfortunately the game uses SizeToLock = 0, so we end up uploading the entire 300kb buffer over and over and over again.

The solution to this would be to only upload the parts of dynamic sysmem buffers that are used for drawing.
Nine does this now:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9451

@K0bin
Copy link
Collaborator Author

K0bin commented Jun 2, 2023

https://github.com/K0bin/dxvk/tree/dynamic-smol-uploads fixes the issue but I'm not sure if I want to land that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant