diff options
author | 2022-01-13 17:44:10 -0800 | |
---|---|---|
committer | 2022-01-14 14:00:54 -0800 | |
commit | b21d94e6b46a269e9960118c7c8d61ce984aea3e (patch) | |
tree | 3b34cb2634b169182c126dcc3601852d0c07f453 /libs/shaders/shaders.cpp | |
parent | d4c6a656d265504207e79fde2fcd988548cf4c37 (diff) |
Supply extra brightness parameters to RenderEngine
A future CL will update the HLG->SDR tonemapping algorithm to consider
current display brightness, as recommended by BT2100.
In preparation for this:
* Fix an issue where maxLuminance was using the current display
brightness if supplied from DisplayManager instead of the max luminance
* Add currentDisplayBrightnessNits to the RenderEngine interface to
support the current brightness
* Plumb current display brightness all the way to libtonemap, where
nothing uses it (yet)
Bug: 206035964
Test: libcompositionengine_test
Change-Id: I3e9f0fdb23fbb08c50e4733e5a16bcd20948d750
Diffstat (limited to 'libs/shaders/shaders.cpp')
-rw-r--r-- | libs/shaders/shaders.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libs/shaders/shaders.cpp b/libs/shaders/shaders.cpp index 6019c4ac28..4d88d5d417 100644 --- a/libs/shaders/shaders.cpp +++ b/libs/shaders/shaders.cpp @@ -463,6 +463,7 @@ std::vector<uint8_t> buildUniformValue(T value) { std::vector<tonemap::ShaderUniform> buildLinearEffectUniforms(const LinearEffect& linearEffect, const mat4& colorTransform, float maxDisplayLuminance, + float currentDisplayLuminanceNits, float maxLuminance) { std::vector<tonemap::ShaderUniform> uniforms; if (linearEffect.inputDataspace == linearEffect.outputDataspace) { @@ -480,6 +481,7 @@ std::vector<tonemap::ShaderUniform> buildLinearEffectUniforms(const LinearEffect } tonemap::Metadata metadata{.displayMaxLuminance = maxDisplayLuminance, + .currentDisplayLuminanceNits = currentDisplayLuminanceNits, // If the input luminance is unknown, use display luminance (aka, // no-op any luminance changes) // This will be the case for eg screenshots in addition to |