mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-31 22:25:21 -04:00
add render timer API
Based on five calls: wlr_render_timer_create - creates a timer which can be reused across frames on the same renderer wlr_renderer_begin_buffer_pass - now takes a timer so that backends can record when the rendering starts and finishes wlr_render_timer_get_time - should be called as late as possible so that queries can make their way back from the GPU wlr_render_timer_destroy - self-explanatory The timer is exposed as an opaque `struct wlr_render_timer` so that backends can store whatever they want in there.
This commit is contained in:
parent
bd834fe8d1
commit
9e8947e4d5
19 changed files with 87 additions and 23 deletions
|
|
@ -49,7 +49,8 @@ struct wlr_renderer_impl {
|
|||
struct wlr_texture *(*texture_from_buffer)(struct wlr_renderer *renderer,
|
||||
struct wlr_buffer *buffer);
|
||||
struct wlr_render_pass *(*begin_buffer_pass)(struct wlr_renderer *renderer,
|
||||
struct wlr_buffer *buffer);
|
||||
struct wlr_buffer *buffer, struct wlr_buffer_pass_options *options);
|
||||
struct wlr_render_timer *(*render_timer_create)(struct wlr_renderer *renderer);
|
||||
};
|
||||
|
||||
void wlr_renderer_init(struct wlr_renderer *renderer,
|
||||
|
|
@ -79,6 +80,15 @@ struct wlr_render_pass_impl {
|
|||
const struct wlr_render_rect_options *options);
|
||||
};
|
||||
|
||||
struct wlr_render_timer {
|
||||
const struct wlr_render_timer_impl *impl;
|
||||
};
|
||||
|
||||
struct wlr_render_timer_impl {
|
||||
int (*get_duration_ns)(struct wlr_render_timer *timer);
|
||||
void (*destroy)(struct wlr_render_timer *timer);
|
||||
};
|
||||
|
||||
void wlr_render_texture_options_get_src_box(const struct wlr_render_texture_options *options,
|
||||
struct wlr_fbox *box);
|
||||
void wlr_render_texture_options_get_dst_box(const struct wlr_render_texture_options *options,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue