This is caused by running out of address space.
Curiously, it's not buffers or constants that cause it (partially because we are already doing a bunch of tricks to avoid that) but StateBlocks instead.

warn: state blocks: 8314 memory of one: 190616 memory of state: 188792 total (MB): 1511
In dx9 mode shogun 2 can or will crash on battle exit if Terrain Quality is set to high.
It does not matter if all other setting are off or low, just that Terrain Quality is set to High. Doesn't happen with the setting set to low.
First discovered in https://github.com/doitsujin/dxvk/issues/2591 but i don't think it is directly related to that issue.
Way to reproduce
If it doesn't crash the first time then try again.
Doesn't happen in wined3d
Software information
Shogun 2 Terrain Quality High
System information
Apitrace file(s)
Apitrace pending
Log files
Shogun2_d3d9.log
Shogun2_d3d11.log
Shogun2_dxgi.log
Errors can also be seen at the end of the proton log
steam-34330.log