doitsujin / dxvk

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

Mirror's Edge (2009) performs worse after shader compilation #4019

Open Tobe95 opened 4 months ago

Tobe95 commented 4 months ago

In the original Mirror's Edge game, when using DXVK, there's a sequence in the "Jacknife" chapter where performance is significantly reduced after shaders have been compiled.

When playing the chapter for the first time, the game maxes out at 62 FPS (the default engine limit), however on subsequent runs performance is reduced by about 40%.

On first run with no shadercache:

before

On 2nd run:

after

I can reproduce this on both, my Steam Deck with Mesa drivers, as well as my laptop running Linux Mint with proprietary Nvidia drivers.

To reproduce:

  1. In the main menu select: Play chapter -> Chapter 2 - Jacknife -> Checkpoint C
  2. Once loaded, wait for shaders to compile, then either go back to the main menu or close the game
  3. Load up the level again and performance will be much worse
  4. Delete/Rename the respective mesa/nvidia shadercache folder to temporarily increase FPS again

I'd like to add that this has been happening with previous versions of DXVK as well.

I'm not sure if the API trace is of any use, I actually didn't notice a performance drop between the first run with no shadercache vs. going back to main menu and then reloading the chapter, performance was just overall reduced...

I'm also including my save file since the level is not unlocked from the start, if anyone has the game and wants to test.

System information

Apitrace file(s)

https://drive.google.com/file/d/1FUbvZ5q_lnVezQr_oR0pINDtRg-4oF6Q/view?usp=drive_link

Save File

https://drive.google.com/file/d/1JF6lO_oJ3zM98yT6kUDs0UHb8VZ9nFmT/view?usp=drive_link

K0bin commented 4 months ago

I downloaded the game on GOG on Windows, installed DXVK, played the entire checkpoint C until you exit the sewers so the shader caches are populated. Then I exited the game, started it again and loaded the same checkpoint again.

62 FPS before, 62 FPS after. So whatever is going on here, it's not our fault. The game doesn't even have a lot of shaders. Just 300 shaders and pipelines.