Vulkan HDR support added

Good evening everybody, so having looked at the documentation for Vulkan again I realised it was possible to support HDR (at least on Windows). I also realised this must be the case as I’ve just been playing Doom Eternal in HDR on my new HDR monitor!

So anyway having not really done anything in Vulkan I decided it was long over due that I learnt a bit more about the API and this is the result.

I will say the support is kind of rudimentary - it works but its not going to play nice with weird setups like two monitors: one with HDR on and the other with it off, say (D3D11and D3D12 will be more robust).

There does also seem to be a weird issue that after a lot of messing around with HDR (turning it on/off a lot of times) my monitor got into a weird state and I had to go into the Windows display options and turn it on/off again to restore everything. This is maybe a driver or monitor issue though as I have seen that happening.

Hopefully this will bring my new pre-HDR shader style to more desktops and TV’s please see:

It should also allow for more existing shaders to use HDR (post HDR) - be warned however that breaking up colours into each channel and individually inverse tonemapping and transforming into Rec. 2020 space (as many CRT shaders do) will probably result in off colours. Do try it and let me know your mileage.

Anyway the pull request has yet to be merged but when it does you’ll need the latest nightly build which can be found here:

https://buildbot.libretro.com/nightly/

Until that is it’s incorporated into the next RetroArch release (fingers crossed).

Also hopefully this may spur someone on, to create a HDR handheld gaming device

Thanks!

10 Likes

Hello -

I want to say thank you for the addition of HDR to the Vulkan backend but, I am having serious issues with it with BFI enabled. I’m not sure if this is something on my end or this is a legit bug but….

The first issue is When enabling HDR on Vulkan from regular mode, Retroarch blacks out and the only way to get your screen back is to restart it. I remember someone mentioned this when it was first implemented in a thread but I think it was never looked at.

However The major problem is the visual glitches happening when BFI is enabled. This happens on both my arcade LCD when using 120HZ & my LG C1. I’ve uploaded a video to demonstrate what’s happening.

Happens on all cores I’ve tried as well with shaders on, off etc. If I shut off HDR Vulkan BFI is perfect.

Can anyone replicate this?

2 Likes

Ok so my first guess is this is to do with local Dimming settings on your LG C1. Turn it all off and see what happens.

With regards to BFI and RA - RA doesn’t actually know anything about BFI it’s purely a TV thing. As long as HDR works then any other TV option on top that breaks things is down to the TV. There isn’t really any other information RA passes to the TV other than the image is HDR.

In all in all I’m not sure there is anything we can do to fix this from the RA end. Can you try Doom Eternal? It’s HDR and Vulkan so it might give us more insight as to where the issue lies.

Done!

As for the problem at hand, there’s TV-based BFI / backlight strobing and then there’s RetroArch’s software BFI. I’m assuming @trnzaddict is using RetroArch’s setting, but I guess that’s a good thing to verify.

2 Likes

Ahhh I didn’t know about that! Where do you find that? First off I’d use the LG TVs BFI setting if available? Secondly I’m sure the TV’s auto/intelligent settings won’t like a software based BFI.

1 Like

It’s in settings > video > synchronization (which is a sort of weird place for it, but I think the idea is that it can be used with 120 Hz mode to sync 60 Hz content).

And yes, using the TV’s own BFI is more reliable and less prone to weird reactions from the display. For example, IPS panels will build up voltage from the cycling, which results in temporary image persistence that is similar to (and often mistaken for) burn-in.

2 Likes

I’m using using RA’s BFI.

So my C1 has native BFI. The problem is it can only be turned on if GSync is disabled on the TV, plus it seems to darken the display a lot more than RA’s method and adds input lag.

This is why I was hoping other users can chime in to see this issue is on my end only or happening to others. I know I’m not the only one using 120HZ BFI HDR on Vulkan.

One game it prominently happens on is original Super Mario Brothers. If you let it go and Mario starts to run to the right to demo the game the black pumping corruption starts.

So I take it this is not happening on the displays you guys use?

2 Likes

Definitely try turning off any auto local dimming settings on your TV. Hmm having thought for a moment your using OLED - does that have anything like that? Possibly/probably not. What you really want to do is figure out what combination of settings cause this and what don’t (if any).

Even though RA is inserting a black frame (and presumably running at double the frame rate) there isn’t really anything logically pertinent between HDR and BFI other than that HDR will stretch the capabilities of the screen more and so make some things more visible.

You mention gsync or lack thereof - that potentially could cause issues with BFI.

1 Like

@c9f5fdda06 if you could post your video here too.

Ok @trnzaddict and @c9f5fdda06 I’ll try and repro this on my display and capture it with PIX. I’ll get back to you about my findings.

2 Likes

Issues with Vulkan+HDR+Black frame insertion?

https://1drv.ms/v/s!AmQUGfXPPtq7gw3q-vVZo46cCI5G?e=38B1Ny

This is FBNeo but it also happens with other cores like Mesen and SNES9x. BTW I think the MAME core doesn’t support HDR…

(yet to determine whether this is the fault of Retroarch, HDMI, or TV)

I also want to add that I am using my TV’s BFI. I can do some troubleshooting to help but I don’t have an HDMI 2.1 card so it would be something like 2.5k @ 120hz.

Finally, I might be stupid but I can no longer find the BFI option in Retroarch :persevere: @hunterk

2 Likes

it should be in settings > video > synchronization, but if you’re not seeing it, stop by settings > user interface and set ‘show advanced settings’ to ON.

2 Likes

@MajorPainTheCactus and @hunterk (thank you!) I can confirm that I continue to get this issue even if I use Retroarch’s BFI option @ 120hz. At 0, no issue, at 1 (which is appropriate for 120hz) I get the black gradient towards the bottom.

1 Like

Are you using any form of freesync/gsync? Are you doing the complete opposite of that too i.e not using any frame sync at all.

I’ll look into this as soon as I can but it may end up being next weekend due to work commitments.

Ok so I’m not nuts then. So it’s happening to you too even with LG’s built in BFI too?

If so that’s not cool. To be honest (rant) I regret buying the C1. I was initially blown away by the picture, Input lag but I’m finding a crap load of caveats.

1- the issue I’m having with RA. This is THE program to play old games, and I can’t get this to work right with it.

2 - The sound lag that LG knows about and refuses to fix. With the TV’s built in speakers I have 500ms of sound lag. Its like when the TV is running at 120hz mode the idiots at LG never thought about tweaking the firmware to keep up with the accelerated picture. Nothing fixes it except purchasing an external sound bar to use for sound or I have to use headphones. Like when I jump in Super Mario Brothers I don’t hear the jump sound until he’s at the top of his jump. Reddit is full posts about this.

3 - the latest software update doubles the input lag in game optimizer mode. So now essentially if you bought this TV for gaming because it WAS the most responsive on the market you basically just got screwed.

4 - You really need some sort of motion assistance with this TV when it comes to pixel games. Because of the instantaneous way it refreshes, when the game scrolls from left to right it’s too harsh and it’s seems stuttery.

Rant over, I’m just so bummed out. A 2000 dollar TV should not have problems like this.

2 Likes

No freesync/gsync.

I’m just using standard HDMI 2.0. Whether I use BFI with the tv (4K @ 60hz with BFI) or retroarch (@1920x1080@120hz) I get this issue. I use a GTX 980 with HDMI.

@trnzaddict I guess I’m not so picky because I don’t see some of these issues. Personally the LG C9 is the best TV I’ve ever owned. Comparatively it’s the TV with the lowest lag unless I want to buy a 20" PVM.

2 Likes

If it’s any consolation I find pretty much any display is full of issues. They’re getting kind of complicated but you do wish from all the companies that their flagship models have less of them.

3 Likes

A quick question @trnzaddict @c9f5fdda06 do you see the same issue with the D3D11 and D3D12 drivers? Is this purely a Vulkan issue?

I’m unable to test I can see when I get home from work. Also the issue happens on my display whether Gsync is on or off.

IIRC I believe it was strictly connected to Vulkan but I have to confirm.

1 Like

@trnzaddict unfortunately, the issue persists with DX11, DX12. Maybe it’s to do with the TVs? :thinking:

1 Like

Great thanks for this I’ll try repro-ing it tonight on my LCD display and see if we can whittle it down some more.

1 Like