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

Commit fd71e13e authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 8741263 from cb9f076c to tm-d1-release

Change-Id: Iee79c1d3d24b9c93f35e0843ad851e6ffee15d5e
parents c8d92974 cb9f076c
Loading
Loading
Loading
Loading
+10 −3
Original line number Diff line number Diff line
@@ -299,8 +299,8 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) {
                highp vec3 ScaleLuminance(highp vec3 color) {
                    // The formula is:
                    // alpha * pow(Y, gamma - 1.0) * color + beta;
                    // where alpha is 1000.0, gamma is 1.2, beta is 0.0.
                    return color * 1000.0 * pow(color.y, 0.2);
                    // where alpha is displayMaxLuminance, gamma is 1.2, beta is 0.0.
                    return color * displayMaxLuminance * pow(color.y, 0.2);
                }
            )__SHADER__";
            break;
@@ -316,7 +316,6 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) {
    // Tone map absolute light to display luminance range.
    switch (needs.getInputTF()) {
        case Key::INPUT_TF_ST2084:
        case Key::INPUT_TF_HLG:
            switch (needs.getOutputTF()) {
                case Key::OUTPUT_TF_HLG:
                    // Right now when mixed PQ and HLG contents are presented,
@@ -396,6 +395,14 @@ void ProgramCache::generateToneMappingProcess(Formatter& fs, const Key& needs) {
                    break;
            }
            break;
        case Key::INPUT_TF_HLG:
            // HLG OOTF is already applied as part of ScaleLuminance
            fs << R"__SHADER__(
                 highp vec3 ToneMap(highp vec3 color) {
                     return color;
                 }
             )__SHADER__";
            break;
        default:
            // inverse tone map; the output luminance can be up to maxOutLumi.
            fs << R"__SHADER__(