From f36d77a199a6398444f7ae6d1002dad2f65ca679 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Thu, 28 Apr 2022 02:49:33 +0100 Subject: [PATCH] gl-renderer: Don't use TEXTURE_EXTERNAL for multi-planar formats There's just no good reason to do this. The query entrypoints already tell us if we need to use GL_TEXTURE_EXTERNAL_OES for a particular format/modifier. We also have RGB -> YUV fallbacks which should be able to work well with TEXTURE_2D. TEXTURE_EXTERNAL pessimises quite hard, forcing GPU-side reloads as well as bad filtering. Allowing multi-planar formats to use TEXTURE_2D should thus result in performance and quality improvements. Signed-off-by: Daniel Stone --- libweston/renderer-gl/gl-renderer.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/libweston/renderer-gl/gl-renderer.c b/libweston/renderer-gl/gl-renderer.c index 53072216..e0047882 100644 --- a/libweston/renderer-gl/gl-renderer.c +++ b/libweston/renderer-gl/gl-renderer.c @@ -2522,7 +2522,7 @@ choose_texture_target(struct gl_renderer *gr, for (i = 0; i < format->num_modifiers; ++i) { if (format->modifiers[i] == attributes->modifier[0]) { - if(format->external_only[i]) + if (format->external_only[i]) return GL_TEXTURE_EXTERNAL_OES; else return GL_TEXTURE_2D; @@ -2530,9 +2530,6 @@ choose_texture_target(struct gl_renderer *gr, } } - if (attributes->n_planes > 1) - return GL_TEXTURE_EXTERNAL_OES; - switch (attributes->format & ~DRM_FORMAT_BIG_ENDIAN) { case DRM_FORMAT_YUYV: case DRM_FORMAT_YVYU: