diff --git a/src/backends/drm/icc.frag b/src/backends/drm/icc.frag index 3b5361d254..be55244447 100644 --- a/src/backends/drm/icc.frag +++ b/src/backends/drm/icc.frag @@ -37,6 +37,7 @@ vec3 sample1DLut(vec3 input, sampler2D lut, int lutSize) { void main() { vec4 tex = texture2D(src, texcoord0); + tex.rgb /= max(tex.a, 0.001); tex.rgb /= sdrBrightness; tex.rgb = matrix1 * tex.rgb; if (Bsize > 0) { @@ -54,5 +55,6 @@ void main() if (Asize > 0) { tex.rgb = sample1DLut(tex.rgb, Asampler, Asize); } + tex.rgb *= tex.a; gl_FragColor = tex; } diff --git a/src/backends/drm/icc_core.frag b/src/backends/drm/icc_core.frag index 630da5e7c7..872869bfe6 100644 --- a/src/backends/drm/icc_core.frag +++ b/src/backends/drm/icc_core.frag @@ -40,6 +40,7 @@ vec3 sample1DLut(in vec3 srcColor, in sampler2D lut, in int lutSize) { void main() { vec4 tex = texture(src, texcoord0); + tex.rgb /= max(tex.a, 0.001); tex.rgb /= sdrBrightness; tex.rgb = matrix1 * tex.rgb; if (Bsize > 0) { @@ -57,5 +58,6 @@ void main() if (Asize > 0) { tex.rgb = sample1DLut(tex.rgb, Asampler, Asize); } + tex.rgb *= tex.a; fragColor = tex; }