Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

American Truck Simulator DX11 rendering is broken #1250

Closed
antonkurkin opened this issue Nov 18, 2019 · 9 comments
Labels
bug

Comments

@antonkurkin
Copy link

@antonkurkin antonkurkin commented Nov 18, 2019

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%20from%202019-11-17%2003-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

@antonkurkin

This comment has been minimized.

Copy link
Author

@antonkurkin antonkurkin commented Nov 19, 2019

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
@doitsujin

This comment has been minimized.

Copy link
Owner

@doitsujin doitsujin commented Nov 19, 2019

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.

@ViNi-Arco

This comment has been minimized.

Copy link

@ViNi-Arco ViNi-Arco commented Nov 19, 2019

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

@doitsujin

This comment has been minimized.

Copy link
Owner

@doitsujin doitsujin commented Nov 19, 2019

That issue only affects OpenGL, not Vulkan.

@antonkurkin

This comment has been minimized.

Copy link
Author

@antonkurkin antonkurkin commented Nov 19, 2019

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.

@antonkurkin

This comment has been minimized.

Copy link
Author

@antonkurkin antonkurkin commented Nov 20, 2019

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

doitsujin added a commit that referenced this issue Nov 23, 2019
For host-visible resources, these behave like MAP_DISCARD.
Euro Truck Simulator 2 and friends relies on this (see #1250).
doitsujin added a commit that referenced this issue Nov 23, 2019
For host-visible resources, these behave like MAP_DISCARD.
Euro Truck Simulator 2 and friends relies on this (see #1250).
@doitsujin

This comment has been minimized.

Copy link
Owner

@doitsujin doitsujin commented Nov 23, 2019

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

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

@doitsujin doitsujin added the bug label Nov 23, 2019
@doitsujin doitsujin closed this Nov 24, 2019
@antonkurkin

This comment has been minimized.

Copy link
Author

@antonkurkin antonkurkin commented Nov 24, 2019

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%20from%202019-11-24%2019-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

@antonkurkin

This comment has been minimized.

Copy link
Author

@antonkurkin antonkurkin commented Nov 28, 2019

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.