mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-21 14:52:04 +00:00
egl: correct ImGui overlay luminance in HDR
Render ImGui to an intermediate SDR framebuffer and map it into the native PQ or scRGB output using the Wayland surface reference white. Preserve premultiplied alpha during conversion and limit composition to damaged overlay regions.
This commit is contained in:
@@ -108,7 +108,12 @@ static bool getCompositor(char * dst, size_t size)
|
||||
static bool waylandInit(const LG_DSInitParams params)
|
||||
{
|
||||
memset(&wlWm, 0, sizeof(wlWm));
|
||||
wlWm.desktop = WL_Desktops[0];
|
||||
wlWm.desktop = WL_Desktops[0];
|
||||
wlWm.hdrWhiteLevels = (LG_DSHDRWhiteLevels)
|
||||
{
|
||||
.pq = 203,
|
||||
.scRGB = 80,
|
||||
};
|
||||
|
||||
wlWm.display = wl_display_connect(NULL);
|
||||
if (!wlWm.display)
|
||||
@@ -215,6 +220,12 @@ static bool waylandGetProp(LG_DSProperty prop, void * ret)
|
||||
return true;
|
||||
}
|
||||
|
||||
if (prop == LG_DS_HDR_WHITE_LEVELS)
|
||||
{
|
||||
*(LG_DSHDRWhiteLevels *)ret = wlWm.hdrWhiteLevels;
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user