protonscr

tlou1 god rays can go through buildings

vkd3dclosed
HansKristian-Work/vkd3d-proton#1518 · opened 2023-04-17 by Blisto91 · updated 2024-06-20 · 25 comments · github
BBlisto91 2023-04-17 github

In The Last of Us Part 1 god rays can sometimes be seen going through buildings. This does not happen in the native Windows version, but does happen with vkd3d-proton on Windows.

Screenshot

image

Software information

In The Last of Us Part 1
Ultra preset. Haven't tested others yet.

System information

  • GPU: 7900xtx
  • Driver: week old mesa-git
  • Wine version: Proton Experimental & BE
  • VKD3D-Proton version: Tested master, 2.8 and 2.7. 2.6 wouldn't launch the game.

Log files

steam-1888930.tar.gz

Save game

Just look at the buildings to the left when spawning in
SAVEFILE00.tar.gz

Taken from compatdata/1888930/pfx/drive_c/users/steamuser/Saved Games/The Last of Us Part I/users/<user-id>/savedata/

KK0bin 2023-04-18 github

I can't reproduce this on an Nvidia GPU. On Linux, it renders correctly and promptly hangs.

On Windows (with vkd3d-Proton), it works fine.

Aadolfintel 2023-04-19 github

I can confirm this on my 6900xt, in some areas god rays are visible through walls. I can make a trace with renderdoc if you want.
This happens regardless of graphics settings, using the latest mesa (23.2 built from source today)

BBlisto91 2023-04-20 github

Thanks for the offer. One of the devs is already diving in to the issue so that won't be needed 🙂

Ddoitsujin maintainer 2023-04-20 github

Game bug, will need some sort of shader-based workaround.

Aadolfintel 2023-04-24 github

I just tested the current master and the issue is still present and in the same spots (6900xt), can you make sure the shader hash didn't change with version 1.0.3? @doitsujin

Untitled

Mmbriar 2023-04-24 github

Also possible it uses a slightly different shader for this in different parts of the game? So maybe add another save game for areas where you can still repro this. And if the hashes indeed changed between versions, then 1.0.3 will probably also be obsolete soon :D https://twitter.com/Naughty_Dog/status/1649526833678020609?cxt=HHwWgsDTjc36peQtAAAA

BBlisto91 2023-04-24 github

This issue was tested with 1.0.3 how did you test master? Just used proton bleeding edge?

Note the game itself have a bug with rays going through buildings also in the same spots, it just wasn't as pronounced as the vkd3d-proton stuff added on top.
The devs have or will notify the game devs of this afaik.

Aadolfintel 2023-04-24 github

Here's a saved game to see if it uses a different shader. It's pretty early into the game, right after you encounter the first zombies.
SAVEFILE0A.zip

As for how I tested it, I built it from source and installed it in the game's wineprefix.

BBlisto91 2023-04-24 github

Thanks. I will check it out.

Mmbriar 2023-04-24 github

Proton will override any dxvk or vkd3d-proton dlls you install to the wine prefix on launch, so you probably didn't test master. Either overwrite the vkd3d-proton dll in the proton files, or copy the d3d12.dll and d3d12core.dll next to the .exe. Or just use proton experimental bleeding edge.

BBlisto91 2023-04-24 github

Right. What mbriar said. Didn't catch that one.

I'd advise trying bleeding edge or overwriting Protons own files in common. Putting files next to the exe can be iffy together with Proton/wine depending on the game.

BBlisto91 2023-04-24 github

Thanks for the save. I see the issue and also that it isn't present in the native game (couldn't get vkd3d-proton working on Windows again this time for extra test)

Ddoitsujin maintainer 2023-04-24 github

Reopening because apparently the fix doesn't work. Not sure what to do here since this looks like the same bug.

Aadolfintel 2023-04-24 github

@doitsujin do you want a trace this time?

Aadolfintel 2023-04-24 github

Check this out.

I changed the if at https://github.com/HansKristian-Work/vkd3d-proton/blob/c74ffa5427eb5ff50f9047a1825dcecfd1cfe5dc/libs/vkd3d-shader/dxil.c#L969, removing the first part of the condition so that the quirk would apply to all shaders that use a group size >32, the problem is gone, you were on the right track.

So either the game has multiple shaders that need this quirk or the shader has was changed with the patch.

Performance and stability don't seem to be affected by me forcing this quirk on all shaders so maybe you could add the quirk for tlou-i.exe in general?

Untitled

HHansKristian-Work maintainer 2023-04-24 github

I guess we'll have to dump the shaders and see how widespread the problem is. We might be able to do a more directed workaround by analyzing how ballot results are used perhaps ...

Aadolfintel 2023-04-24 github

Is there any way I can help?

HHansKristian-Work maintainer 2023-04-24 github

Confirming the global wave32 hack worked was help enough I think.

BBlisto91 2023-04-24 github

Just a quick note for future visibility. Issue visually appears in the spot above when "Directional Shadow Distance" is set above Low

Aadolfintel 2023-04-25 github

I just did some more testing and it looks like applying the wave32 workaround globally for tlou-i.exe also fixes the sun shadows that have a "blocky screenspace effect" in some areas (mostly interiors) so I guess there are many shaders in this game that need this workaround.

Performance doesn't seem to be affected and the game doesn't crash so I'm opening a PR with the workaround applied properly to the exe instead of changing that condition.

SSylvanas-1977 2024-06-20 github

This issue also happens on Windows with just Directx12 so whoever suggested it does not happen on Windows i assume you meant when using vk3D on Windows, not sure if this was fixed in VK3D tho, i am on a 7900 XTX tho.

BBlisto91 2024-06-20 github

Yes it also happens on Windows it was later found. The issue here was that it was much worse with vkd3d-proton

SSylvanas-1977 2024-06-20 github

Yes it also happens on Windows it was later found. The issue here was that it was much worse with vkd3d-proton

Not sure but this is how it looks like in WIndows on certain spots
https://imgur.com/VYoVcXa
https://imgur.com/F66etpm
Happens in more locations ofcourse these are on Directx12

Anyway was it fixed in vk3D ?

BBlisto91 2024-06-20 github

It was fixed so it looks the same as on native Windows with vkd3d-proton yes.

SSylvanas-1977 2024-06-20 github

if VK3D managed to fix this perhaps naughty dog can fix the issue them self as well might be better anyway, i have had success getting some shader related issues fixed.
Not sure if i reported this issue yet to naughty dog them self i probably did, its not like i keep a log in my head on what issues i report or have.

Proton versions

DLLs