GPUOpen-LibrariesAndSDKs / AGS_SDK

AMD GPU Services (AGS) library and samples
MIT License
245 stars 40 forks source link

HDR support in AGS_SDK #33

Closed DMU-debug closed 4 years ago

DMU-debug commented 4 years ago

Hi there. You have entered support for HDR mode. The agsSetDisplayMode() function used to set a specific display in HDR mode, does its job perfectly: it sends metadata to the display device, which is defined in section 6.9 «Dynamic Range and Mastering InfoFrame» according to Table 5 of the CTA-861 standard. But in the same Table 5 there is also «Auxiliary Video Information (AVI)» defined in section 6.4. And all display devices are required to use the color space (colorimetry) from this data section (AVI InfoFrame) for the current video signal. Suppose we are in SDR mode with the standard sRGB color space. And we want to switch to the HDR mode with the BT.2020 color space, which is the main one for this mode. By calling the agsSetDisplayMode() function, we put the display device in HDR mode. And we see distorted or unsaturated colors. This is because the display device did not receive the corresponding flag from the GPU in the AVI InfoFrame and is trying to display our BT.2020 color space in its sRGB. Please tell me, do you think that such HDR support in AGS_SDK is sufficient? If yes, then advise what else needs to be done so that the display device passes into the correct color space when activating the HDR mode using AGS?

gareththomasamd commented 4 years ago

Hi DMU,

Are you using the right swap chain for the HDR mode and a fullscreen window? The sample here might be worth trying to see if you get the same issues: https://gpuopen.com/using-amd-freesync-premium-pro-hdr-code-samples/

I also recommend trying the 20.2.1 driver as that has some HDR fixes in which might help.

stoolzo commented 4 years ago

Hi gareththomasamde, any chance you could provide a video sample we can test in MKV or MP4 format?

However we know its the AMD API at fault as HDR works with windows and NVIDA API when using movie players and renderers llike MADVR. If we turn on the windows HDR before opening an app which uses the AMD private HDR API it seems to force the app into BT2020 mode. This is the workaround we are using the moment, it may also work for gamers, we really need AMD to look at what is different for NAVI based cards and the last gen as last gen card RX400/500 series all still work so it must be an issue with how NAVI is working with this API where it cannot output BT2020 unless its forced to be turning on windows HDR, is that a little more clear for you?

DMU-debug commented 4 years ago

Hi DMU,

Are you using the right swap chain for the HDR mode and a fullscreen window? The sample here might be worth trying to see if you get the same issues: https://gpuopen.com/using-amd-freesync-premium-pro-hdr-code-samples/

I also recommend trying the 20.2.1 driver as that has some HDR fixes in which might help.

That is you acknowledge that separately AGS SDK is not able to correctly display a HDR image? Then why do the Polaris series cards do this?

stoolzo commented 4 years ago

gareththomasamd - do you work for AMD, is there any way to get this problem moviing at all, someone we can contact? this hasnt worked since the card was released, its utterly bizarre that AMD would put a card out with HDR API not working at all, they havent even acknowledged this is a problem yet when many people have reported it direct to AMD as a fault and on their forums.

gareththomasamd commented 4 years ago

Can you try 20.2.2 to see if that resolves the HDR10 issue please?

stoolzo commented 4 years ago

Hi, still doesnt look right, colours are better and maybe even correct now but image is very low in brightness, picture has SDR brightness levels. If I switch to Windows HDR I can tell threre is a huge difference in overall brightness, so AMD is half way there.

stoolzo commented 4 years ago

issue is impossible to capture on camera unfortunately, its quiet a lot more dim than it should be, thats all i can say really.

ive tried to mock up what i'm seeing but its very difficult, the colours look right to me but have no pop as the picture is so dim.

https://1drv.ms/u/s!AgvFafeelEBij9gw4zyLyw7311WuxA?e=YXj1el

stoolzo commented 4 years ago

Hi, AMD Private HDR API is still sending BT709 not BT2020, no idea who AMD have got working on this but i'm sensing they dont understand HDR.

DMU-debug commented 4 years ago

I confirm it. There is no BT.2020 flag (see screenshot). I integrated the AMD AGS code into the Microsoft example code - D3D12Fullscreen. HDFury and TV showed that the BT.2020 flag is not sent by the video card, as I wrote in the first post. AMD_AGS_issue

stoolzo commented 4 years ago

ive also logged this here in the vein hope the right person will finally see this and it gets fixed, this is incredibly frustrating and taking up a lot of my time discussing it with people, i've also logged it twice as a fault direct to AMD who didnt get back to me as well as logged 3 times on AMD forums.

end of my tether now to be honest, if I didnt need 3D support i'd be heading over the the green camp for proper HDR support. :(

https://old.reddit.com/r/Amd/comments/favtfv/radeon_software_adrenalin_2020_edition_2022/

AMD-aric commented 4 years ago

@stoolzo If you are using Mode_HDR10_PQ, as your screenshot shows, then you must be creating an ARGB2101010 swap chain and it must be fullscreen or HDR will not engage. Please confirm you have done this.

stoolzo commented 4 years ago

Hiya, yeah full screen is being used at all times.

We've also tested this with a Philips OLED TV which helpfully reports back which colour space ite receiving, when using the AMD API it reports BT709 when using windows HDR it reports BT2020.

Just a reminder, this is only happening with NAVI cards, POLARIS cards have no issues, it must be something to do with how you've implemented this API on the navi hardware.

DMU-debug commented 4 years ago

Just a reminder, this is only happening with NAVI cards, POLARIS cards have no issues, it must be something to do with how you've implemented this API on the navi hardware.

This also applies to the integrated GPU's Vega too. I have one - Ryzen 3 3200G.

stoolzo commented 4 years ago

sorry yes i keep forgetting about vega, its only Polaris which is currently fine, Polaris was first gen HDR Hevc capable cards.

DMU-debug commented 4 years ago

@AMD-aric

@stoolzo If you are using Mode_HDR10_PQ, as your screenshot shows, then you must be creating an ARGB2101010 swap chain and it must be fullscreen or HDR will not engage. Please confirm you have done this.

How else can I show you an issue? Maybe you will post here an example of working AMD_AGS_HDR, and I will check it using HDFury? A screenshot from the Microsoft application, in which the output of ARGB2101010 is clearly visible. AMD_AGS code is integrated into this application and called by hotkey. AMD_AGS_issue1

DMU-debug commented 4 years ago

Version 20.3.1 fixes this. Thanks for the work.

stoolzo commented 4 years ago

I concor