From b51a73cb7725ba3ae3e072dadc6b083ddc873758 Mon Sep 17 00:00:00 2001 From: DerVerruckteFuchs Date: Mon, 6 Jul 2020 02:01:27 -0400 Subject: [PATCH] add 10 bit pixel formats --- render/gles2/pixel_format.c | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/render/gles2/pixel_format.c b/render/gles2/pixel_format.c index 1258d8bcf..05a2861f4 100644 --- a/render/gles2/pixel_format.c +++ b/render/gles2/pixel_format.c @@ -39,10 +39,41 @@ static const struct wlr_gles2_pixel_format formats[] = { .gl_type = GL_UNSIGNED_BYTE, .has_alpha = true, }, + // 10 bit formats + { + .wl_format = WL_SHM_FORMAT_ARGB2101010, + .depth = 32, + .bpp = 32, + .gl_format = GL_BGRA_EXT, + .gl_type = GL_UNSIGNED_BYTE, + .has_alpha = true, + }, + { + .wl_format = WL_SHM_FORMAT_XRGB2101010, + .depth = 24, + .bpp = 32, + .gl_format = GL_BGRA_EXT, + .gl_type = GL_UNSIGNED_BYTE, + .has_alpha = false, + }, + { + .wl_format = WL_SHM_FORMAT_XBGR2101010, + .depth = 24, + .bpp = 32, + .gl_format = GL_RGBA, + .gl_type = GL_UNSIGNED_BYTE, + .has_alpha = false, + }, + { + .wl_format = WL_SHM_FORMAT_ABGR2101010, + .depth = 32, + .bpp = 32, + .gl_format = GL_RGBA, + .gl_type = GL_UNSIGNED_BYTE, + .has_alpha = true, + }, }; -// TODO: more pixel formats - const struct wlr_gles2_pixel_format *get_gles2_format_from_wl( enum wl_shm_format fmt) { for (size_t i = 0; i < sizeof(formats) / sizeof(*formats); ++i) {