From 1bf9676e8781c281265267d71ad7c911516be023 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Sat, 27 Nov 2021 18:33:04 +0100 Subject: render/egl: improve modifier support detection Support for EXT_image_dma_buf_import_modifiers doesn't necessarily indicate support for modifiers. For instance, Mesa will advertise EXT_image_dma_buf_import_modifiers for all drivers. This is a trick to allow EGL clients to enumerate supported formats (something EXT_image_dma_buf_import is missing). For more information, see [1]. Add a new wlr_egl.has_modifiers flag which indicates whether modifiers are supported. It's set to true if any eglQueryDmaBufModifiersEXT query returned a non-empty list. Use that flag to figure out whether the buffer modifier should be passed to the EGL implementation on import. [1]: https://github.com/KhronosGroup/EGL-Registry/issues/142 --- include/wlr/render/egl.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/wlr') diff --git a/include/wlr/render/egl.h b/include/wlr/render/egl.h index 2af073ca..0d84958b 100644 --- a/include/wlr/render/egl.h +++ b/include/wlr/render/egl.h @@ -65,6 +65,7 @@ struct wlr_egl { PFNEGLQUERYDEVICESEXTPROC eglQueryDevicesEXT; } procs; + bool has_modifiers; struct wlr_drm_format_set dmabuf_texture_formats; struct wlr_drm_format_set dmabuf_render_formats; }; -- cgit v1.2.3