add 10 bit pixel formats

This commit is contained in:
DerVerruckteFuchs 2020-07-06 02:01:27 -04:00
parent a801e1cccb
commit b51a73cb77

View file

@ -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) {