mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
c/render: Fix handling of alpha channel in compute layer renderer
This commit is contained in:
parent
e9e0cf9f2c
commit
80a8048c39
|
@ -249,9 +249,10 @@ vec4 do_layers(vec2 view_uv, uint view_index)
|
|||
// Unpremultipled blend factor of src.a.
|
||||
accum.rgb = mix(accum.rgb, rgba.rgb, rgba.a);
|
||||
} else {
|
||||
// Premultiplied bland foctor of 1.
|
||||
// Premultiplied blend factor of 1.
|
||||
accum.rgb = (accum.rgb * (1 - rgba.a)) + rgba.rgb;
|
||||
}
|
||||
accum.a = rgba.a + accum.a * (1.0 - rgba.a);
|
||||
}
|
||||
}
|
||||
return accum;
|
||||
|
@ -276,7 +277,7 @@ void main()
|
|||
|
||||
if (do_color_correction) {
|
||||
// Do colour correction here since there are no automatic conversion in hardware available.
|
||||
colour = vec4(from_linear_to_srgb(colour.rgb), 1);
|
||||
colour.rgb = from_linear_to_srgb(colour.rgb);
|
||||
}
|
||||
|
||||
imageStore(target, ivec2(offset.x + ix, offset.y + iy), colour);
|
||||
|
|
Loading…
Reference in a new issue