diff options
| author | 2018-05-18 15:12:55 -0700 | |
|---|---|---|
| committer | 2018-05-18 15:55:25 -0700 | |
| commit | 834be4916ca270e9534a8ed9f542e0912776cb7d (patch) | |
| tree | eed288d3162388e8d5fc6dcade5a3af0b9b30ca6 | |
| parent | 1236c388170f352adf9c9a3347de4560995c20b1 (diff) | |
[RenderEngine] Use highp in shader.
Previously, OETF for PQ transfer function didn't have highp which caused
precesion problem, resulting in noise when hardware composer is in BT2100_PQ
color mode. This patch makes sure we use highp when applying PQ transfer
function.
BUG: 73825729
Test: Build, flash, boot and watch Youtube HDR.
Change-Id: I898e58c641cb9cb678a25d2992695f675b157f9b
| -rw-r--r-- | services/surfaceflinger/RenderEngine/ProgramCache.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/services/surfaceflinger/RenderEngine/ProgramCache.cpp b/services/surfaceflinger/RenderEngine/ProgramCache.cpp index 7c2cb5b13c..2808a1a912 100644 --- a/services/surfaceflinger/RenderEngine/ProgramCache.cpp +++ b/services/surfaceflinger/RenderEngine/ProgramCache.cpp @@ -422,13 +422,13 @@ void ProgramCache::generateOETF(Formatter& fs, const Key& needs) { case Key::OUTPUT_TF_ST2084: fs << R"__SHADER__( vec3 OETF(const vec3 linear) { - const float m1 = (2610.0 / 4096.0) / 4.0; - const float m2 = (2523.0 / 4096.0) * 128.0; - const float c1 = (3424.0 / 4096.0); - const float c2 = (2413.0 / 4096.0) * 32.0; - const float c3 = (2392.0 / 4096.0) * 32.0; + const highp float m1 = (2610.0 / 4096.0) / 4.0; + const highp float m2 = (2523.0 / 4096.0) * 128.0; + const highp float c1 = (3424.0 / 4096.0); + const highp float c2 = (2413.0 / 4096.0) * 32.0; + const highp float c3 = (2392.0 / 4096.0) * 32.0; - vec3 tmp = pow(linear, vec3(m1)); + highp vec3 tmp = pow(linear, vec3(m1)); tmp = (c1 + c2 * tmp) / (1.0 + c3 * tmp); return pow(tmp, vec3(m2)); } |