Frogging-Family / wine-tkg-git

The wine-tkg build systems, to create custom Wine and Proton builds
891 stars 160 forks source link

HDR not detected by Elden Ring #1246

Open TheFeelTrain opened 2 months ago

TheFeelTrain commented 2 months ago

In Elden Ring HDR works perfectly with Proton Experimental and proton-ge-custom, but it does not work with proton-tkg.

Using this: gamescope -f -W 3840 -H 2160 --hdr-enabled -- python er-patcher --all --rate 120 -- %command%

The option is greyed out in the menu so Elden Ring is not detecting that HDR is available.

I tried a few different versions from the GitHub CI and my own build and it did not work on any of them. Is there a particular patch or config option that's needed?

I should also note that HDR works fine with Divinity Original Sin 2 and The Witcher 3, even without gamescope, so this is something that seems to be tripping up Elden Ring in particular.

Arch Linux Ryzen 9 7950X + RX 7900XTX Kernel 6.10.4-zen2-1-zen Mesa 24.1.6 KDE Plasma 6.1.4

TheFeelTrain commented 2 months ago

With some further testing, trying different builds and different settings do not seem to fix it. I tried enabling all of the different config options like protonify, still no luck.

Proton 9.0-2 -> gamescope -> HDR works Proton 9.0-2 -> wayland driver -> not supported

Proton Experimental -> gamescope -> HDR works Proton Experimental -> wayland driver -> not supported

GE-Proton9-11 -> gamescope -> HDR works GE-Proton9-11 -> wayland driver -> not supported

proton-ge-custom (AUR) -> gamescope -> HDR works proton-ge-custom (AUR) -> wayland driver -> runs but input does not work

proton-tkg (Valve Exp Bleeding Edge) -> gamescope -> HDR works proton-tkg (Valve Exp Bleeding Edge) -> wayland driver -> runs but input does not work

proton-tkg (Wine Master) -> gamescope -> HDR greyed out in settings proton-tkg (Wine Master) -> wayland driver -> HDR greyed out in settings

Tk-Glitch commented 2 months ago

It's not expected to work on upstream bases so I don't see anything abnormal here. Works on valve trees as it should (outside of winewayland which is incomplete and broken).

TheFeelTrain commented 2 months ago

Oh okay, I just assumed enabling "protonify" (or one of the other config options) would pull in the patches to sort of convert upstream wine to match Valve's wine.

(outside of winewayland which is incomplete and broken)

It does actually work perfectly in Divinity Original Sin 2 and Witcher 3, I haven't had any problems with it. Elden Ring also works perfectly minus the HDR detection, but since that's also not working with gamescope I'm just assuming it's unrelated to the wayland driver.

I did find this pull request from about a year ago https://github.com/ValveSoftware/Proton/pull/7048

https://github.com/Joshua-Ashton/Proton/blob/3f1b15dca15003806d6c738d3cab3edaf74672f9/proton#L1227-L1233

So it does seem like Elden Ring (and Sekiro) in particular have always been finicky with HDR. But this was never merged so it must have gotten fixed some other way.

If this is expected behavior feel free to close the issue, I don't want to waste your time. I was just hoping I could get it working because the game is noticeably smoother with the wayland driver compared to gamescope. And it seems like it should be possible with the right environment variable and/or patch.

valgusk commented 2 months ago

It works on my machine, albeit on Nvidia GPU, both with native wayland and gamescope. If I can somehow help debug, feel free to ping.

TheFeelTrain commented 2 months ago

I am about 95% sure I have narrowed the issue down to AMD AGS so I need to test some of the related patches, just haven't had time yet. Looks like it has caused a lot of HDR-detection issues on the OLED Steam Deck in the past for various games. Nvidia uses the NVAPI instead so that's probably why it works fine.

But actually this is off topic to this issue but I do have a friend with a 2080 Ti who can't seem to launch proton-tkg at all, and gamescope crashes for them in all games regardless of proton version. What does your setup look like and what launch options are you using? I would love to get HDR working for him.

TheFeelTrain commented 2 months ago

Right after I commented I thought of something and tried it out.

I manually copied lib/wine/i386-windows/amd_ags_x64.dll and lib64/wine/x86_64-windows/amd_ags_x64.dll from the valve-based tkg and overwrote the ones in the wine-based tkg. Sure enough now the detection works no problem. The valve-based versions were almost double the filesize so they are completely different.

valgusk commented 2 months ago

@TheFeelTrain

But actually this is off topic to this issue but I do have a friend with a 2080 Ti who can't seem to launch proton-tkg at all, and gamescope crashes for them in all games regardless of proton version. What does your setup look like and what launch options are you using? I would love to get HDR working for him.

TheFeelTrain commented 2 months ago

Thank you so much, I made a build with your exact settings and then taking these three environment variables: VKD3D_DISABLE_EXTENSIONS=VK_KHR_present_wait PROTON_ENABLE_NVAPI=1 VKD3D_CONFIG=force_static_cbv were the key.

Without those options the games would crash and/or freeze after a few seconds but with them it works. However the performance took a roughly 20% hit until also switching from 555 to the 560 beta for whatever reason. But with those three things combined it's working perfectly in all the games we've tested.