Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a3b93856 authored by Siddharth Kapoor's avatar Siddharth Kapoor Committed by android-build-merger
Browse files

[RenderEngine] Clamp input color for BT2020_PQ EOTF am: ac1f7c9c

am: 582131a7

Change-Id: I0846bb3f215ea70cd2c81cac332da2fcb25ec037
parents d1b8b46e 582131a7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -215,7 +215,7 @@ void ProgramCache::generateEOTF(Formatter& fs, const Key& needs) {
                    const highp float c2 = (2413.0 / 4096.0) * 32.0;
                    const highp float c3 = (2392.0 / 4096.0) * 32.0;

                    highp vec3 tmp = pow(color, 1.0 / vec3(m2));
                    highp vec3 tmp = pow(clamp(color, 0.0, 1.0), 1.0 / vec3(m2));
                    tmp = max(tmp - c1, 0.0) / (c2 - c3 * tmp);
                    return pow(tmp, 1.0 / vec3(m1));
                }