doitsujin / dxvk

Vulkan-based implementation of D3D8, 9, 10 and 11 for Linux / Wine
zlib License
13.18k stars 849 forks source link

[d3d9] Significantly lower performance than gallium-nine in Dragon's Dogma #1965

Open Oschowa opened 3 years ago

Oschowa commented 3 years ago

Dragon's Dogma Dark Arisen is about 15 fps slower than gallium-nine in a cpu-bound case on my system. This is most prominent in the first village area of the game after completing the tutorial when standing at the city gate looking towards the sea.

DXVK (master is at about 60 fps): Screenshot from 2021-02-28 13-40-25

gallium-nine: Screenshot from 2021-02-28 13-41-57

perf shows most of the cpu time spend in WaitForResource: Screenshot from 2021-03-03 14-37-48

As discussed on discord, here is some debug logging before every WaitForResource call: DDDA_d3d9-WFR.log

Patch used to generate the log: frog.txt

Software information

Dragon's Dogma Dark Arisen https://store.steampowered.com/app/367500/Dragons_Dogma_Dark_Arisen/ Medium settings 720p

System information

Apitrace file(s)

recorded with DXVK: https://drive.google.com/file/d/1GgxS5V2GLSysmMWf6ZQzZEGeN7x3Cmui/view?usp=sharing recorded with wined3d: https://drive.google.com/file/d/11YHQBLHzjDpdxlO5Z82Llwhw0VZ7hkGN/view?usp=sharing

Log files

misyltoad commented 3 years ago

Does this build improve the situation?

dxvk-dragon-dog.tar.gz

Oschowa commented 3 years ago

No real change compared to master with this build.

lemonzest79 commented 3 years ago

Been playing Dragon's Dogma myself a few days also, this time under wine-staging 6.3 and with a RX 5600 XT (Navi10) on a Ryzen 7 1700 @3.6Ghz & 48GB RAM

What I don't understand is that both GPU/CPU Usage is around the mid 20% mark, and the FPS drop as low as 30s and peak as high as 150 (the cap), seems so inconsistent, what is causing the low resource usage?

doitsujin commented 3 years ago

GPU synchronization, which is an absolute shitshow in D3D9 with pretty much every single game being horribly broken.

Oschowa commented 3 years ago

FWIW, master with the recent locking changes doesn't affect this game.

Blisto91 commented 2 years ago

While i was testing this i noticed what appeared to be a performance regression between 1.9.4 and 1.10. Here i was testing a specific spot where i loaded in each time without touching the mouse. In 1.9.4 i was getting a stable 50ish fps and in 1.10 i was getting a stuttery 30 - 40 fps.

I have tried going through the github actions master artifacts to find out somewhat where the issue happens. But these are not the specific commits where the issue occurs, just close to the behavior change.

Stable fps Here in a build from commit 25ebf948 we see the steady fps behavior ![Screenshot_20220320_004935](https://user-images.githubusercontent.com/47954800/159142776-ee7b7ebb-2615-4dcc-ace9-c92bae0c75f8.png)
Low stuttery fps Then somewhere between the commit above and 4e464327 the issue appears ![Screenshot_20220320_004700](https://user-images.githubusercontent.com/47954800/159142779-a41aee62-23d6-4a9c-8ffe-21257ebcac73.png)
High stuttery fps Then somewhere between the commit above and 29d88127 the fps suddenly improves, but have these high stutters that come relatively often ![Screenshot_20220320_010641](https://user-images.githubusercontent.com/47954800/159142790-70797a73-5f98-4917-9ab1-063ca169a994.png)
Low stuttery fps Then somewhere between the commit above and b42c0725 we are back at low fps with stutter. This is also how it is on bleeding edge proton with latest master. ![Screenshot_20220320_011543](https://user-images.githubusercontent.com/47954800/159142795-6eca0efa-82eb-462a-bde6-d2d5da8c83be.png)
Oschowa commented 2 years ago

I don't see a regression with dxvk master on my end:

screenshot ![Screenshot from 2022-03-20 11-31-05](https://user-images.githubusercontent.com/8129300/159158299-68d003d6-d705-4d06-b921-44274b0a852a.png)

This is with dxvk master on proton experimental bleeding edge, despite the HUD saying 1.10.

Blisto91 commented 2 years ago

Odd. Can reproduce it quite consistently by loading up my save. I had to make sure i stayed in the same spot cuz this games performance can change quite a lot just by moving a few meters or look to the side which makes it hard to do proper performance comparisons unless you stay in one spot xd.

But even then when running around a bit, on my system comparing proton 7.0-1 to bleeding edge the latter gets frame timing spikes relatively often whereas the former don't. And looking at mangohud it didn't look like gpu or cpu utilization seemed to have changed (not a very scientific test)

Edit: I just noticed that launching the game with gamemode on bleeding edge gets rid of the frame spikes. ffs :grin:

K0bin commented 2 years ago

@Blisto91 The game copies the rendered image onto another texture and immediately reads it, causing a full GPU sync. This is very slow and there's not a lot we can do about it. I accidentally broke this which is why the game ran fast for a couple of commits.

Blisto91 commented 2 years ago

Roger roger. šŸ‘

I still find it odd that i now need to use game mode to make it non stuttery like the old versions. But there is probably a good explanation for that somewhere and I'm not knowledgeable enough šŸ˜