render: introduce wlr_render_texture_pass

Split texture rendering out of wlr_render_pass and introduce a
dedicated wlr_render_texture_pass interface.

Remove the add_texture hook from wlr_render_pass_impl and route
texture rendering through renderer->texture_pass instead.
This commit is contained in:
YaoBing Xiao 2026-03-13 12:36:51 +08:00
parent 33a27b055c
commit fee962af36
11 changed files with 222 additions and 8 deletions

View file

@ -58,8 +58,6 @@ void wlr_render_pass_init(struct wlr_render_pass *pass,
struct wlr_render_pass_impl {
bool (*submit)(struct wlr_render_pass *pass);
void (*add_texture)(struct wlr_render_pass *pass,
const struct wlr_render_texture_options *options);
};
struct wlr_render_timer {
@ -110,4 +108,29 @@ struct wlr_render_rect_pass *wlr_pixman_render_rect_pass_create(void);
struct wlr_render_rect_pass *wlr_gles2_render_rect_pass_create(void);
struct wlr_render_rect_pass *wlr_vk_render_rect_pass_create(void);
struct wlr_render_texture_pass;
struct wlr_render_texture_pass_impl {
void (*destroy)(struct wlr_render_texture_pass *pass);
void (*render)(struct wlr_render_pass *pass,
const struct wlr_render_texture_options *options);
};
struct wlr_render_texture_pass {
const struct wlr_render_texture_pass_impl *impl;
struct {
struct wl_signal destroy;
} events;
};
void wlr_render_texture_pass_init(struct wlr_render_texture_pass *pass,
const struct wlr_render_texture_pass_impl *impl);
void wlr_render_texture_pass_destroy(struct wlr_render_texture_pass *pass);
struct wlr_render_texture_pass *get_or_create_render_texture_pass(
struct wlr_renderer *renderer);
struct wlr_render_texture_pass *wlr_pixman_render_texture_pass_create(void);
struct wlr_render_texture_pass *wlr_gles2_render_texture_pass_create(void);
struct wlr_render_texture_pass *wlr_vk_render_texture_pass_create(void);
#endif

View file

@ -27,7 +27,7 @@ struct wlr_fbox;
*/
struct wlr_renderer {
struct wlr_render_rect_pass *rect_pass;
struct wlr_render_texture_pass *texture_pass;
void *data;
// Capabilities required for the buffer used as a render target (bitmask of