doitsujin / dxvk

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

[D3D11] Titan Quest Anniversary Edition crashes when it is set to fullscreen #2395

Closed Leopard1907 closed 2 years ago

Leopard1907 commented 2 years ago

Description:

Game crashes with DX11 backend ( default ) when game is set to fullscreen. Also does not start with fullscreen mode either. Default mode is set to borderless.

Window settings can be adjusted from steamapps/compatdata/475150/pfx/drive_c/users/steamuser/Documents/My Games/Titan Quest - Immortal Throne/Settings/options.txt with setting windowmode to 2 for Borderless , 1 for Windowed and 0 for Fullscreen.

Fullscreen mode works with wined3d and DXVK as well with using wine dxgi (WINEDLLOVERRIDES="dxgi=b")

Software information

Titan Quest Anniversary Edition

System information

Log files

Proton logs : first one is with wine dxgi+dxvk , setting game from borderless to fullscreen, second one is dxvk dxgi with setting game from borderless to fullscreen

I think this is the relevant part:

Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Present mode: VK_PRESENT_MODE_IMMEDIATE_KHR
info:    Buffer size:  1920x1080
info:    Image count:  2
info:    Exclusive FS: 1
err:   DXGI: Failed to query closest mode:
err:     Format: 28
err:     Mode:   1920x1080@0
err:   DXGI: EnterFullscreenMode: Failed to change display mode
err:   DXGI: Failed to set initial fullscreen state
err:   D3D11CreateDevice: Failed to create swap chain
doitsujin commented 2 years ago

Can you post a full list of the display modes available on your system?

This function is known to be problematic on some systems (especially when using monitors that don't support 60 Hz for certain resolutions since some games hard-code that), but I cannot reproduce that here and I don't know why something like that would work on Windows.

Leopard1907 commented 2 years ago

Sure.

xrandr
Screen 0: minimum 8 x 8, current 1920 x 1080, maximum 32767 x 32767
eDP1 connected primary 1920x1080+0+0 (normal left inverted right x axis y axis) 340mm x 190mm
   1920x1080     60.01*+  59.93  
   1680x1050     59.88  
   1400x1050     59.98  
   1600x900      60.00    59.95    59.82  
   1280x1024     60.02  
   1400x900      59.96    59.88  
   1280x960      60.00  
   1368x768      60.00    59.88    59.85  
   1280x800      59.81    59.91  
   1280x720      59.86    60.00    59.74  
   1024x768      60.00  
   1024x576      60.00    59.90    59.82  
   960x540       60.00    59.63    59.82  
   800x600       60.32    56.25  
   864x486       60.00    59.92    59.57  
   640x480       59.94  
   720x405       59.51    60.00    58.99  
   640x360       59.84    59.32    60.00  
HDMI1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)

Game is set to native res, 1920x1080.

doitsujin commented 2 years ago

I don't know how to debug this or why it fails, can't reproduce on my end.

doitsujin commented 2 years ago

Does https://github.com/doitsujin/dxvk/tree/closest-matching-mode-fix fix this?

(Context: The game is asking for 1/60 Hz instead of 60 Hz, so we're looking for a 1080p 59Hz mode which doesn't exist)

Leopard1907 commented 2 years ago

Thanks, dxgi from that branch fixed the issues.

Game can now start at fullscreen, also doesn't crash when switching to fullscreen from other windowing options.