protonscr

[d3d9] Total War: MEDIEVAL II: ridiculously high system memory usage when loading battles

dxvkclosed d3d932-bit
doitsujin/dxvk#2264 · opened 2021-08-25 by DadSchoorse · updated 2021-10-15 · 1 comments · github
DDadSchoorse 2021-08-25 github

When starting any field battle, dxvk runs out of address space on the end of the loading screen. When replaying the wined3d trace with 64bit d3dretrace and dxvk it peaks at ~9.2GB system heap usage.

Software information

Total War: MEDIEVAL II, all settings are affected.

System information

  • GPU: GTX 1060
  • Driver: 470.56.05
  • Wine version: Proton 6.3 experimental
  • DXVK version: 1.7.3 - master

Apitrace file(s)

Log files

KK0bin maintainer 2021-08-26 github

CME found out that this is caused by SWVP constants.
Josh suggested allocating smaller constant buffers based on either the highest accessed constant in the shader (if dynamic indexing is not used) or the highest changed constant the game sets. We would rely on robustness2 if the shader accesses constants that haven't been set, so we have to keep the 256 alignment on Nvidia GPUs in mind.

This change would also allow us to get rid of the app configs for Track Mania Nations, Sims 2 and various other games.

Proton versions