vulkan/wsi/wayland: implement the full format table
authorNiklas Haas <git@haasn.dev>
Mon, 26 Apr 2021 11:40:38 +0000 (13:40 +0200)
committerMarge Bot <eric+marge@anholt.net>
Thu, 24 Jun 2021 19:37:51 +0000 (19:37 +0000)
commit83f8b19f9b72eb618fe6f8504978f5d6133675ec
treefc9a4ebbc71ed2170c65bf1096160ca72671dca2
parent8d0d2e82e7506d15a98b7889dd1478d472fdef0b
vulkan/wsi/wayland: implement the full format table

This code was written but (rightfully) commented out, because it
referenced non-existing vulkan formats.

The correct vulkan analogs come in the form _PACK16 and _PACK32,
respectively, which have their component ordering in high->low bit
order. This is compatible with the DRM format ordering on little endian
systems, so we can just implement them all in the obvious way. On big
endian systems, the _PACKN formats have no analogs, because the
corresponding DRM formats are specified as always being little endian.

I implemented all of the formats I could, while excluding those that
don't map to vulkan at all (e.g. BGRA1010102), and commenting out the
ones that require an extra extension (e.g. ARGB4444) because they
probably need to be checked for extension presence first.

List slightly re-ordered to make it more neatly organized. Tested
working with the 2101010 and 565 variants. Was not able to test the 4444
or 1555 formats, but I verified the channel order was correct so they
should be working in theory.

Signed-off-by: Niklas Haas <git@haasn.xyz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9737>
src/vulkan/wsi/wsi_common_wayland.c