diff options
author | thexai <58434170+thexai@users.noreply.github.com> | 2024-02-24 17:10:09 +0100 |
---|---|---|
committer | thexai <58434170+thexai@users.noreply.github.com> | 2024-03-04 16:08:33 +0100 |
commit | b6cc5eb156867aeaf899b3ccc0551e42590237bf (patch) | |
tree | 3bbaeb375c991cc9a0aa550f41cf6fa4b47ce345 /system/shaders | |
parent | 8404b9f510f84b7416f5ff3f2bc7567a93d3dbb6 (diff) |
[Android] Adjust GUI SRD peak luminance when display is in HDR PQ mode
Diffstat (limited to 'system/shaders')
7 files changed, 35 insertions, 0 deletions
diff --git a/system/shaders/GLES/2.0/gles_shader_default.frag b/system/shaders/GLES/2.0/gles_shader_default.frag index f213360454..5f0bcd28c4 100644 --- a/system/shaders/GLES/2.0/gles_shader_default.frag +++ b/system/shaders/GLES/2.0/gles_shader_default.frag @@ -22,6 +22,7 @@ precision mediump float; uniform lowp vec4 m_unicol; +uniform float m_sdrPeak; void main () { @@ -34,5 +35,9 @@ void main () rgb.rgb += 16.0 / 255.0; #endif +#if defined(KODI_TRANSFER_PQ) + rgb.rgb *= m_sdrPeak; +#endif + gl_FragColor = rgb; } diff --git a/system/shaders/GLES/2.0/gles_shader_fonts.frag b/system/shaders/GLES/2.0/gles_shader_fonts.frag index 075d26f67a..a26d28b593 100644 --- a/system/shaders/GLES/2.0/gles_shader_fonts.frag +++ b/system/shaders/GLES/2.0/gles_shader_fonts.frag @@ -24,6 +24,7 @@ precision mediump float; uniform sampler2D m_samp0; varying vec4 m_cord0; varying lowp vec4 m_colour; +uniform float m_sdrPeak; void main () { @@ -37,5 +38,9 @@ void main () rgb.rgb += 16.0 / 255.0; #endif +#if defined(KODI_TRANSFER_PQ) + rgb.rgb *= m_sdrPeak; +#endif + gl_FragColor = rgb; } diff --git a/system/shaders/GLES/2.0/gles_shader_multi.frag b/system/shaders/GLES/2.0/gles_shader_multi.frag index 9f288982ec..f4c608d150 100644 --- a/system/shaders/GLES/2.0/gles_shader_multi.frag +++ b/system/shaders/GLES/2.0/gles_shader_multi.frag @@ -25,6 +25,7 @@ uniform sampler2D m_samp0; uniform sampler2D m_samp1; varying vec4 m_cord0; varying vec4 m_cord1; +uniform float m_sdrPeak; void main () { @@ -37,5 +38,9 @@ void main () rgb.rgb += 16.0 / 255.0; #endif +#if defined(KODI_TRANSFER_PQ) + rgb.rgb *= m_sdrPeak; +#endif + gl_FragColor = rgb; } diff --git a/system/shaders/GLES/2.0/gles_shader_multi_blendcolor.frag b/system/shaders/GLES/2.0/gles_shader_multi_blendcolor.frag index 35153da34c..98e5f7e7df 100644 --- a/system/shaders/GLES/2.0/gles_shader_multi_blendcolor.frag +++ b/system/shaders/GLES/2.0/gles_shader_multi_blendcolor.frag @@ -26,6 +26,7 @@ uniform sampler2D m_samp1; varying vec4 m_cord0; varying vec4 m_cord1; uniform lowp vec4 m_unicol; +uniform float m_sdrPeak; void main () { @@ -38,5 +39,9 @@ void main () rgb.rgb += 16.0 / 255.0; #endif +#if defined(KODI_TRANSFER_PQ) + rgb.rgb *= m_sdrPeak; +#endif + gl_FragColor = rgb; } diff --git a/system/shaders/GLES/2.0/gles_shader_texture.frag b/system/shaders/GLES/2.0/gles_shader_texture.frag index a2ac2de79b..ef1609c7f1 100644 --- a/system/shaders/GLES/2.0/gles_shader_texture.frag +++ b/system/shaders/GLES/2.0/gles_shader_texture.frag @@ -24,6 +24,7 @@ precision mediump float; uniform sampler2D m_samp0; uniform lowp vec4 m_unicol; varying vec4 m_cord0; +uniform float m_sdrPeak; void main () { @@ -36,5 +37,9 @@ void main () rgb.rgb += 16.0 / 255.0; #endif +#if defined(KODI_TRANSFER_PQ) + rgb.rgb *= m_sdrPeak; +#endif + gl_FragColor = rgb; } diff --git a/system/shaders/GLES/2.0/gles_shader_texture_noalpha.frag b/system/shaders/GLES/2.0/gles_shader_texture_noalpha.frag index 9f478ed3da..7db591c84e 100644 --- a/system/shaders/GLES/2.0/gles_shader_texture_noalpha.frag +++ b/system/shaders/GLES/2.0/gles_shader_texture_noalpha.frag @@ -11,6 +11,7 @@ precision mediump float; uniform sampler2D m_samp0; varying vec4 m_cord0; +uniform float m_sdrPeak; void main () { @@ -21,5 +22,9 @@ void main () rgb += 16.0 / 255.0; #endif +#if defined(KODI_TRANSFER_PQ) + rgb.rgb *= m_sdrPeak; +#endif + gl_FragColor = vec4(rgb, 1.0); } diff --git a/system/shaders/GLES/2.0/gles_shader_texture_noblend.frag b/system/shaders/GLES/2.0/gles_shader_texture_noblend.frag index 8cc66c94c9..44d797b539 100644 --- a/system/shaders/GLES/2.0/gles_shader_texture_noblend.frag +++ b/system/shaders/GLES/2.0/gles_shader_texture_noblend.frag @@ -23,6 +23,7 @@ precision mediump float; uniform sampler2D m_samp0; varying vec4 m_cord0; +uniform float m_sdrPeak; void main () { @@ -35,5 +36,9 @@ void main () rgb.rgb += 16.0 / 255.0; #endif +#if defined(KODI_TRANSFER_PQ) + rgb.rgb *= m_sdrPeak; +#endif + gl_FragColor = rgb; } |