render/vulkan: add more packed formats

This commit is contained in:
Simon Ser 2022-11-29 09:48:01 +01:00
parent 171c9081d1
commit 9f938f7f2a

View file

@ -54,10 +54,70 @@ static const struct wlr_vk_format formats[] = {
// Vulkan packed formats have the same channel order as DRM formats on
// little endian systems.
#if WLR_LITTLE_ENDIAN
{
.drm = DRM_FORMAT_RGBA4444,
.vk = VK_FORMAT_R4G4B4A4_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_RGBX4444,
.vk = VK_FORMAT_R4G4B4A4_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_BGRA4444,
.vk = VK_FORMAT_B4G4R4A4_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_BGRX4444,
.vk = VK_FORMAT_B4G4R4A4_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_RGB565,
.vk = VK_FORMAT_R5G6B5_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_BGR565,
.vk = VK_FORMAT_B5G6R5_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_RGBA5551,
.vk = VK_FORMAT_R5G5B5A1_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_RGBX5551,
.vk = VK_FORMAT_R5G5B5A1_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_BGRA5551,
.vk = VK_FORMAT_B5G5R5A1_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_BGRX5551,
.vk = VK_FORMAT_B5G5R5A1_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_ARGB1555,
.vk = VK_FORMAT_A1R5G5B5_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_XRGB1555,
.vk = VK_FORMAT_A1R5G5B5_UNORM_PACK16,
},
{
.drm = DRM_FORMAT_ARGB2101010,
.vk = VK_FORMAT_A2R10G10B10_UNORM_PACK32,
},
{
.drm = DRM_FORMAT_XRGB2101010,
.vk = VK_FORMAT_A2R10G10B10_UNORM_PACK32,
},
{
.drm = DRM_FORMAT_ABGR2101010,
.vk = VK_FORMAT_A2B10G10R10_UNORM_PACK32,
},
{
.drm = DRM_FORMAT_XBGR2101010,
.vk = VK_FORMAT_A2B10G10R10_UNORM_PACK32,
},
#endif
};