protonscr

American Truck Simulator DX11 rendering is broken

dxvkclosed bug
doitsujin/dxvk#1250 · opened 2019-11-18 by antonkurkin · updated 2020-11-26 · 12 comments · github
Aantonkurkin 2019-11-18 github

Sometimes I can see parts of truck's interior but all other 3d stuff rendered is total garbage.
Native or proton OpenGL runs great. The problem is I want to try American Truck Simulator in VR mode, but can't get it to work.
Same problem for 64 bit DX11 beta of Euro Truck Simulator 2 (same engine AFAIK).
Native linux build doesn't have VR beta, OpenGL renderer of windows build doesn't support it either. DX9 render of ESR2 works in proton but I can't get anything rendered in HMD. In VR with DX11 renderer I see menu and I can interact with it but other than that its broken.
Screenshot: https://www.dropbox.com/s/3macstlfcl3odv0/Screenshot from 2019-11-17 03-53-17.png?dl=0

Posted d3d11.log is from non-VR branch with DXVK 1.4.4 (render results are the same in both branches, can get one from VR branch if needed). To get DXVK 1.4.4 with proton I replaced dlls with release binary dlls (including dxgi.dll) in ~/.steam/steam/steamapps/compatdata/270880/pfx/drive_c/windows/syswow64 and system32.

Software information

American Truck Simulator. Launch with DX11 (same for Play American Truck Simulator option in steam)

System information

  • GPU: AMD Vega 56
  • Driver: kernel 5.4.0-rc5, mesa 19.2.3
  • Wine version: proton 4.11-8
  • DXVK version: proton 4.11-8 and DXVK 1.4.4

Apitrace file(s)

Don't have windows, sorry

Log files

Aantonkurkin 2019-11-19 github

There are also a lot of messages like these in steam output when I get rendering problems from the game:

VUID-VkBufferImageCopy-imageOffset-00197(ERROR / SPEC): msgNum: 0 - vkCmdCopyBufferToImage(): Both pRegion[0] imageoffset.x (0) and (imageExtent.width + imageOffset.x) (4) must be >= zero or <= image subresource width (1). The Vulkan spec states: imageOffset.x and (imageExtent.width + imageOffset.x) must both be greater than or equal to 0 and less than or equal to the image subresource width (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00197)
    Objects: 1
        [0] 0x78219, type: 10, name: NULL
VUID-VkBufferImageCopy-imageOffset-00198(ERROR / SPEC): msgNum: 0 - vkCmdCopyBufferToImage(): Both pRegion[0] imageoffset.y (0) and (imageExtent.height + imageOffset.y) (4) must be >= zero or <= image subresource height (1). The Vulkan spec states: imageOffset.y and (imageExtent.height + imageOffset.y) must both be greater than or equal to 0 and less than or equal to the image subresource height (https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkBufferImageCopy-imageOffset-00198)
    Objects: 1
        [0] 0x78219, type: 10, name: NULL
Ddoitsujin maintainer 2019-11-19 github

Can you please provide an apitrace? If you don't have Windows, record it on Linux, but i NEED one in order to debug the problem.

The validation errors indicate a game bug but not the kind of thing that would break it as badly as in your screenshot.

VViNi-Arco 2019-11-19 github

Could you upgrade to Mesa 19.2.4 to see if it resolves? because Mesa 19.2.3 is in trouble:
https://www.phoronix.com/scan.php?page=news_item&px=Mesa-19.2.4-Released

Ddoitsujin maintainer 2019-11-19 github

That issue only affects OpenGL, not Vulkan.

Aantonkurkin 2019-11-19 github

I updated mesa to 19.2.4 and kernel to 5.4.0-rc8 just in case and the problem persists.
I still was not able to get apitrace for reasons I don't comprehend but I didn't gave up yet. Will post it here as soon as I get it.

Aantonkurkin 2019-11-20 github

Ok after quite a few more tries and running apitrace in Windows work VM on other computer I finally was able to understand that trace files are actually created in the desktop folder...

So here is a trace file I generated from proton on my home computer. Looks like the game actually froze on loading screen after I put wrapper dlls to the directory of game executable. Yet rendering glitches start to appear on loading screen so maybe you can use it somehow. On the other hand maybe I just need to let it run for a longer time though.
https://www.dropbox.com/s/kt9u487cdssjtdk/amtrucks.7z?dl=0

And here is a trace file from windows VM. It was rendered fine there. VM has no GPU passthrough though.
https://www.dropbox.com/s/8bcorxew49orh4b/amtrucks.2.trace.7z?dl=0

I'm not sure if any of them are useful so please tell me if I need to do something else

Ddoitsujin maintainer 2019-11-23 github

Thanks for providing the trace. This should be fixed as of a7c21a617cc766a51259988febcce0dd4e8e885d.

There's also some rather questionable API usage in the game, but that gets ignored for now, it should work.

Aantonkurkin 2019-11-24 github

Awesome, thank you very much! DX11 render of both American Truck Simulator and Euro Truck Simulator 2 work perfectly for desktop. And I was able to play first mission in VR too! Yet unfortunately it seems like there is also a problem specific to their VR rendering. It's even happening when logo videos are running. Can't say how I missed it in the first place, sorry about that.
Good rendered scene is frequently flickering with garbage like here on the screenshot (got it from VR view):
https://www.dropbox.com/s/dxztxhisej26j2z/Screenshot from 2019-11-24 19-45-09.png?dl=0

d3d11.log: https://www.dropbox.com/s/lwh908zyay5pxak/amtrucks_d3d11.log?dl=0
apitrace file: https://www.dropbox.com/s/kt9u487cdssjtdk/amtrucks.7z?dl=0

Aantonkurkin 2019-11-28 github

@doitsujin Sorry for the nudge, I'm just not sure what should I do. Should I open another bug about the problem in last comment? Checked it with latest dxvk just in case, vr problem still present

Mmimattr 2020-11-15 github

@antonkurkin VR now appears to work as expected, can you re-test with the latest Proton (5.13-2) and SteamVR? (1.15.9)

Aantonkurkin 2020-11-15 github

Thanks for the heads up, will try and report when I'm around my VR system

Aantonkurkin 2020-11-26 github

@mimattr just checked and it's working flawlessly for me too. That's awesome, thanks again for letting me know!

Proton versions

DLLs