From 7ad67e0f1db486bf0994128f9750115722eef6d5 Mon Sep 17 00:00:00 2001 From: Manuel Stoeckl Date: Sat, 30 Apr 2022 22:43:49 -0400 Subject: render/gles: add support for some 16-bpc unsigned shm formats These formats require EXT_texture_norm16, which in turn needs OpenGL ES 3.1. The EXT_texture_norm16 extension does not support passing gl_internalformat = GL_RGBA to glTexImage2D, as can be done for formats available in OpenGL ES 2.0, so this commit adds a field to wlr_gles2_pixel_format to provide a more specific internalformat parameter to glTexImage2D. --- include/render/gles2.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/render') diff --git a/include/render/gles2.h b/include/render/gles2.h index 245b2804..714bacf5 100644 --- a/include/render/gles2.h +++ b/include/render/gles2.h @@ -17,6 +17,8 @@ struct wlr_gles2_pixel_format { uint32_t drm_format; + // optional field, if empty then internalformat = format + GLint gl_internalformat; GLint gl_format, gl_type; bool has_alpha; }; @@ -45,6 +47,7 @@ struct wlr_gles2_renderer { bool OES_egl_image; bool EXT_texture_type_2_10_10_10_REV; bool OES_texture_half_float_linear; + bool EXT_texture_norm16; } exts; struct { -- cgit v1.2.3