Skip to content

render/vulkan: undo alpha premult for 8-bpc ARGB/ABGR

M. Stoeckl requested to merge mstoeckl/wlroots:vk-fix-8bit-tex-alpha into master

This should make 8-bpc formats with alpha render the same as 16-bpc formats with alpha.

See !4399 (merged) and !4395 (merged) for more context.

Note: a side effect of this commit is that bilinear texture filtering will behave slightly differently for ARGB8888 and XRGB8888 formats. (Ironically, the XRGB8888 texture filtering is "correct", as it is performed on optical values (post sRGB->linear conversion); while the ARGB8888 texture filtering is now performed on the raw/electrical values, before the shader conversion is applied. The old ARGB8888 filtering was incorrect in a different way, because it handled color channels independently instead of weighting colors by the associated alpha values. I think it's possible to "fix" the ARGB8888 filtering by explicitly doing bilinear interpolation inside the fragment shader; but ultimately bilinear texture filtering will never produce "perfect" results.)

Merge request reports