HansKristian-Work / vkd3d-proton

Fork of VKD3D. Development branches for Proton's Direct3D 12 implementation.
GNU Lesser General Public License v2.1
1.94k stars 202 forks source link

Arma Reforger Heavy Foliage Artifacting #2031

Open kit-the-cat-skelanimal-plush opened 5 months ago

kit-the-cat-skelanimal-plush commented 5 months ago

In Arma Reforger rocks and foliage will completely glitch out when around 100% GPU usage. Does not happen on every instance of the game, I'd say it shows up about every 1 in 2, maybe 2 in 3 launches. The only thing that stops it is limiting the framerate, but that fails once the GPU usage increases to 100% during heavy gameplay moments.

https://youtu.be/RdhsNIctri8?si=8Zz4HWHwiVfpqL3Y

This is a video of it happening. The subtitles can be ignored, I wrongly attributed it to framerate rather than GPU usage.

Software information

Arma Reforger, happens on all settings configurations and game versions.

System information

Log files

steam-1874880.log

HansKristian-Work commented 5 months ago

@runar-work reproduced it.

runar-work commented 5 months ago

I wasn't able to reproduce this with the 555 drivers on RTX 3070, so give that a try. 555.58.02 is the most recent I checked.

kit-the-cat-skelanimal-plush commented 5 months ago

Thanks, will try.

kit-the-cat-skelanimal-plush commented 5 months ago

Looks like the 555 driver works! Tested very extensively launching the game 15 or so times, worked perfectly. Still reproduces easily on 545, so it must be a bug that's been since patched. Anyways, thanks so much for the help! Should this be closed now since it appears to just be a driver issue?

Edit: Nevermind, I launched the game again and it is indeed still happening. Somehow wasn't happening for the first 15 times I launched the game :/

runar-work commented 5 months ago

Huh. Strangely enough I also reproduced again after roughly the same number of launches. Thanks for the feedback. I'll switch back to 545 and poke at this a bit more.

kit-the-cat-skelanimal-plush commented 5 months ago

Thanks a ton for the help!

runar-work commented 4 months ago

I found a compute shader that seems to do the ground work for the flower drawing, 3ca95f6902bd3478. It does have some barriers, but not in the biggest of the loops, so I added one there and could no longer reproduce the issue. Without the shader override the glitch always reproduces on the second launch after I delete the pipeline cache.

Here's the original dumped shader and the edited version: 3ca95f6902bd3478.zip

kit-the-cat-skelanimal-plush commented 4 months ago

How would I go about trying the edited version? Sorry I'm not very good with this kind of stuff :P

runar-work commented 4 months ago

Ah, sorry, I meant to tag Hans-Kristian on that comment. The goal, if it's possible, is to find some way to fix this in vkd3d-proton so you won't need to do any acrobatics. So far the easy workarounds involve reducing performance in some way, like adding VKD3D_SWAPCHAIN_LATENCY_FRAMES=1 to launch options, which obviously isn't ideal.

adolfintel commented 4 months ago

Is this an UE5 game? I noticed the same issue in Talos Principle 2, on AMD, in a couple of spots in the west 2 and west 3 areas when looking at the grass from certain angles or when zooming in, I thought it was a game bug but it looks the same as this.

https://github.com/HansKristian-Work/vkd3d-proton/assets/16307689/45ed65ee-40ee-4114-94d2-8976b433a140

kit-the-cat-skelanimal-plush commented 4 months ago

@adolfintel It runs on a proprietary engine made by the devs called Enfusion. That is a very similar looking bug, although in Arma Reforger it doesn't seem have to do with the angle you view the grass from.

adolfintel commented 4 months ago

@kit-the-cat-skelanimal-plush Thanks, I'll see if I can replicate this in windows, make some captures and open a separate issue then.

runar-work commented 4 months ago

Yeah, this is an Nvidia issue. I tested it on RX 7600 with Mesa 24.1.2 without any problems there, at least.

As for the root cause investigation, I did some more testing with shader overrides and it seems it was the shader compilation and not the shader modification that fixed the issue. So it seems to be a bug that is fixed when going through SPIRV-Cross.

Here's a RenderDoc capture with 550.90.07 and minimal settings, where I bookmarked the compute shader dispatch and a draw call that reads from the same buffer later.

The SPIR-V files from the original shader dump and the recompiled override (without other modifications): 3ca95f6902bd3478.spv.zip

The easiest way to reproduce seems to be to launch with high or ultra preset (changing presets while in-game doesn't seem to affect the glitch), then go into the training mode.

esullivan-nvidia commented 4 months ago

Thanks for the detailed investigation Runar. I am tracking this issue in NVIDIA bug 4739549. I will report back here when I have more to share.

kit-the-cat-skelanimal-plush commented 3 months ago

I seem to no longer be having this bug while playing on the bleeding edge branch of Proton. Not gonna say that it's fixed for sure yet, but I have launched the game maybe 30 times in testing and have had no issues. I can still easily reproduce it on the most recent stable branch of Proton. Were any changes made to vkd3d that might've fixed it?

runar-work commented 3 months ago

Weird. I can still reproduce the glitch easily with

kit-the-cat-skelanimal-plush commented 3 months ago

Well sure enough I went back and tested it a few more times and it happened on the third launch. No idea why it was working seemingly perfectly for me earlier, I haven't changed anything since then. Very strange.