mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-22 07:12:04 +00:00
[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:
@@ -876,7 +876,8 @@ static bool configureChain(EGL_PostProcess * this, EGL_PixelFormat pixFmt,
|
||||
|
||||
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)
|
||||
{
|
||||
if (targetX == 0 && targetY == 0)
|
||||
DEBUG_FATAL("targetX || targetY == 0");
|
||||
@@ -918,10 +919,11 @@ bool egl_postProcessRun(EGL_PostProcess * this, EGL_Texture * tex,
|
||||
}
|
||||
|
||||
EGL_FilterRects filterRects = {
|
||||
.rects = rects,
|
||||
.matrix = this->matrix,
|
||||
.width = desktopWidth,
|
||||
.height = desktopHeight,
|
||||
.rects = rects,
|
||||
.matrix = this->matrix,
|
||||
.width = desktopWidth,
|
||||
.height = desktopHeight,
|
||||
.hdrPeak = hdrPeak,
|
||||
};
|
||||
|
||||
EGL_Texture * texture = tex;
|
||||
|
||||
Reference in New Issue
Block a user