@ -69,7 +69,30 @@ static const struct wlr_gles2_pixel_format formats[] = {
. gl_type = GL_UNSIGNED_SHORT_5_6_5 ,
. gl_type = GL_UNSIGNED_SHORT_5_6_5 ,
. has_alpha = false ,
. has_alpha = false ,
} ,
} ,
// TODO: EXT_texture_type_2_10_10_10_REV support
{
. drm_format = DRM_FORMAT_XBGR2101010 ,
. gl_format = GL_RGBA ,
. gl_type = GL_UNSIGNED_INT_2_10_10_10_REV_EXT ,
. has_alpha = false ,
} ,
{
. drm_format = DRM_FORMAT_ABGR2101010 ,
. gl_format = GL_RGBA ,
. gl_type = GL_UNSIGNED_INT_2_10_10_10_REV_EXT ,
. has_alpha = true ,
} ,
{
. drm_format = DRM_FORMAT_XBGR16161616F ,
. gl_format = GL_RGBA ,
. gl_type = GL_HALF_FLOAT_OES ,
. has_alpha = false ,
} ,
{
. drm_format = DRM_FORMAT_ABGR16161616F ,
. gl_format = GL_RGBA ,
. gl_type = GL_HALF_FLOAT_OES ,
. has_alpha = true ,
} ,
# endif
# endif
} ;
} ;
@ -77,6 +100,14 @@ static const struct wlr_gles2_pixel_format formats[] = {
bool is_gles2_pixel_format_supported ( const struct wlr_gles2_renderer * renderer ,
bool is_gles2_pixel_format_supported ( const struct wlr_gles2_renderer * renderer ,
const struct wlr_gles2_pixel_format * format ) {
const struct wlr_gles2_pixel_format * format ) {
if ( format - > gl_type = = GL_UNSIGNED_INT_2_10_10_10_REV_EXT
& & ! renderer - > exts . EXT_texture_type_2_10_10_10_REV ) {
return false ;
}
if ( format - > gl_type = = GL_HALF_FLOAT_OES
& & ! renderer - > exts . OES_texture_half_float_linear ) {
return false ;
}
if ( format - > gl_format = = GL_BGRA_EXT
if ( format - > gl_format = = GL_BGRA_EXT
& & ! renderer - > exts . EXT_read_format_bgra ) {
& & ! renderer - > exts . EXT_read_format_bgra ) {
return false ;
return false ;