From a4d0a5bda507a2777fa27c0f38354bc648c8e3e8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Sun, 22 Oct 2023 17:43:58 -0400 Subject: [PATCH] dmabuf: We don't support external formats on GL Filter out external-only formats unless we are on GLES. --- gdk/gdkdmabufegl.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gdk/gdkdmabufegl.c b/gdk/gdkdmabufegl.c index 9be8668232..1f5a8213ce 100644 --- a/gdk/gdkdmabufegl.c +++ b/gdk/gdkdmabufegl.c @@ -106,8 +106,11 @@ gdk_dmabuf_egl_downloader_add_formats (const GdkDmabufDownloader *downloader, (char *) &fourccs[i], modifiers[j]); - /* All linear formats we support are already added my the mmap downloader */ - if (modifiers[j] != DRM_FORMAT_MOD_LINEAR) + /* All linear formats we support are already added my the mmap downloader. + * We don't add external formats, unless we can use them (via GLES) + */ + if (modifiers[j] != DRM_FORMAT_MOD_LINEAR && + (!external_only[j] || gdk_gl_context_get_use_es (context))) gdk_dmabuf_formats_builder_add_format (builder, fourccs[i], modifiers[j]); if (external_only[j]) gdk_dmabuf_formats_builder_add_format (external, fourccs[i], modifiers[j]);