From 3db1bcbe641b407b9f5c9e5d0a012b45aa2c6cb7 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 18 Jan 2022 14:27:37 +0100 Subject: scene: try to import buffers as textures before rendering The wlroots APIs currently don't allow importing/uploading a buffer during rendering operations. Scene-graph buffer nodes need to turn their wlr_buffer into a wlr_texture at some point. It's not always possible to do so at wlr_scene_buffer creation time because the scene-graph may have zero outputs at this point, thus no way to grab a wlr_renderer. Instead, add scene-graph buffers to a pending list and try to import them in wlr_scene_output_commit. References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3354 --- include/wlr/types/wlr_scene.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 7dfccbf9..a77eb6c2 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -68,6 +68,9 @@ struct wlr_scene { // May be NULL struct wlr_presentation *presentation; struct wl_listener presentation_destroy; + + // List of buffers which need to be imported as textures + struct wl_list pending_buffers; // wlr_scene_buffer.pending_link }; /** A sub-tree in the scene-graph. */ @@ -114,6 +117,7 @@ struct wlr_scene_buffer { struct wlr_fbox src_box; int dst_width, dst_height; enum wl_output_transform transform; + struct wl_list pending_link; // wlr_scene.pending_buffers }; /** A viewport for an output in the scene-graph */ -- cgit v1.2.3