aboutsummaryrefslogtreecommitdiff
path: root/render/vulkan/pixel_format.c
diff options
context:
space:
mode:
authorSimon Ser <contact@emersion.fr>2022-11-29 10:02:10 +0100
committerSimon Ser <contact@emersion.fr>2022-12-02 10:36:36 +0100
commit21c45168383d1e6dc408d3492d9dae80f52cf2dd (patch)
treecd40b97a6a1f086add7bbe44da072a9c1e65ae48 /render/vulkan/pixel_format.c
parent9f938f7f2a2a54443471d5c67dfcacb56569e4dd (diff)
render/vulkan: add 64-bit UNORM and SFLOAT formats
Diffstat (limited to 'render/vulkan/pixel_format.c')
-rw-r--r--render/vulkan/pixel_format.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/render/vulkan/pixel_format.c b/render/vulkan/pixel_format.c
index 4d49f32f..9df08041 100644
--- a/render/vulkan/pixel_format.c
+++ b/render/vulkan/pixel_format.c
@@ -119,6 +119,29 @@ static const struct wlr_vk_format formats[] = {
.vk = VK_FORMAT_A2B10G10R10_UNORM_PACK32,
},
#endif
+
+ // Vulkan 16-bits-per-channel formats have an inverted channel order
+ // compared to DRM formats, just like the 8-bits-per-channel ones.
+ // On little endian systems the memory representation of each channel
+ // matches the DRM formats'.
+#if WLR_LITTLE_ENDIAN
+ {
+ .drm = DRM_FORMAT_ABGR16161616,
+ .vk = VK_FORMAT_R16G16B16A16_UNORM,
+ },
+ {
+ .drm = DRM_FORMAT_XBGR16161616,
+ .vk = VK_FORMAT_R16G16B16A16_UNORM,
+ },
+ {
+ .drm = DRM_FORMAT_ABGR16161616F,
+ .vk = VK_FORMAT_R16G16B16A16_SFLOAT,
+ },
+ {
+ .drm = DRM_FORMAT_XBGR16161616F,
+ .vk = VK_FORMAT_R16G16B16A16_SFLOAT,
+ },
+#endif
};
const struct wlr_vk_format *vulkan_get_format_list(size_t *len) {