protonscr

[d3d11] Divinity: The Original Sin Enhanced Edition (Steam ID 373420) crashes during resolution change from menu

dxvkclosed dxgigame bug
doitsujin/dxvk#2558 · opened 2022-03-22 by gofman · updated 2022-05-29 · 1 comments · github
Ggofman 2022-03-22 github

Divinity Original Sin Enhanced Edition crashes during resolution change because it destroys swapchain (which it created through dxgi factory CreateSwapChain) and soon after before creating a new one calls _GetFullscreenState and _Release again on it. I verified that on Windows the second release returns -1, although it doesn't crash. I can make it to work with wined3d in Proton by hacking delayed free to heap (we had such a hack in the past for some games) but that still crashes with dxvk with msvcrt.abort() called from d3d11. dll.

I am not entirely sure if it works on Windows due to delayed free or because something is holding an internal reference to swapchain.

As a side note I found that the texture returned from swapchain _GetBuffer gets an external reference to swapchain on WIndows which is not the case neither in wined3d nor dxvk but that is unrelated here, it releases this texture anyway before swapchain extra release.

Here is the apitrace I recorded on Windows which replays there but crashes with WIne: https://www.dropbox.com/s/mmpkz4j7i09wnfx/EoCApp.trace.bz2?dl=0

BBlisto91 2022-05-28 github

This has been fixed in 1.10.1
Tested with proton 7.0-2, R9 380, mesa 22.1.0 and reproduced with 1.10

Proton versions