[client] egl: correct CAS processing for HDR

Convert HDR scRGB input to normalized linear Rec.2020 before CAS, then
convert the filtered result back to scRGB. Use the content metadata to
select an appropriate normalization peak while leaving SDR unchanged.

This follows AMD's documented recommendation for applying CAS to HDR
content and prevents HDR highlights from being clamped and dimmed.
This commit is contained in:
Geoffrey McRae
2026-07-19 20:13:42 +10:00
parent 0333bf0261
commit e18925f436
6 changed files with 52 additions and 9 deletions

View File

@@ -47,7 +47,8 @@ bool egl_postProcessNeedsFullFrame(EGL_PostProcess * this);
* targetX/Y is the final target output dimension hint if scalers are present */
bool egl_postProcessRun(EGL_PostProcess * this, EGL_Texture * tex,
EGL_DesktopRects * rects, int desktopWidth, int desktopHeight,
unsigned int targetX, unsigned int targetY, bool useDMA, bool hdrPQ);
unsigned int targetX, unsigned int targetY, bool useDMA, bool hdrPQ,
float hdrPeak);
/* Return the current output texture and whether it remains PQ encoded. */
EGL_Texture * egl_postProcessGetOutput(EGL_PostProcess * this,