From 89d0d90306f9323cbfa904a7e0e777b701ed16ff Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 27 Apr 2022 23:37:48 +0100 Subject: [PATCH] pixel-formats: Add GL types for 16bpc formats Carried over from gl-renderer's equivalent code. Signed-off-by: Daniel Stone --- libweston/pixel-formats.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c index 5e4cb1ae..2373add6 100644 --- a/libweston/pixel-formats.c +++ b/libweston/pixel-formats.c @@ -48,6 +48,7 @@ #include #include #include +#include #define GL_FORMAT(fmt) .gl_format = (fmt) #define GL_TYPE(type) .gl_type = (type) #define SAMPLER_TYPE(type) .sampler_type = (type) @@ -341,20 +342,36 @@ static const struct pixel_format_info pixel_format_table[] = { { DRM_FORMAT(XBGR16161616), BITS_RGBA_FIXED(16, 16, 16, 0), +#if __BYTE_ORDER__ == __LITTLE_ENDIAN + GL_FORMAT(GL_RGBA16_EXT), + GL_TYPE(GL_UNSIGNED_SHORT), +#endif }, { DRM_FORMAT(ABGR16161616), BITS_RGBA_FIXED(16, 16, 16, 16), .opaque_substitute = DRM_FORMAT_XBGR16161616, +#if __BYTE_ORDER__ == __LITTLE_ENDIAN + GL_FORMAT(GL_RGBA16_EXT), + GL_TYPE(GL_UNSIGNED_SHORT), +#endif }, { DRM_FORMAT(XBGR16161616F), BITS_RGBA_FLOAT(16, 16, 16, 0), +#if __BYTE_ORDER__ == __LITTLE_ENDIAN + GL_FORMAT(GL_RGBA16F), + GL_TYPE(GL_HALF_FLOAT), +#endif }, { DRM_FORMAT(ABGR16161616F), BITS_RGBA_FLOAT(16, 16, 16, 16), .opaque_substitute = DRM_FORMAT_XBGR16161616F, +#if __BYTE_ORDER__ == __LITTLE_ENDIAN + GL_FORMAT(GL_RGBA16F), + GL_TYPE(GL_HALF_FLOAT), +#endif }, { DRM_FORMAT(XRGB16161616F),