From 9e8947e4d51ddafb40887b8a8ebfb1873615f9b6 Mon Sep 17 00:00:00 2001 From: Rose Hudson Date: Fri, 2 Jun 2023 10:25:07 +0100 Subject: 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. --- examples/output-layers.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'examples/output-layers.c') diff --git a/examples/output-layers.c b/examples/output-layers.c index 0c53a18e..d4a45d5b 100644 --- a/examples/output-layers.c +++ b/examples/output-layers.c @@ -94,7 +94,8 @@ static void output_handle_frame(struct wl_listener *listener, void *data) { wlr_output_effective_resolution(output->wlr_output, &width, &height); struct wlr_output_state output_state = {0}; - struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &output_state, NULL); + struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &output_state, + NULL, NULL); wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){ .box = { .width = width, .height = height }, -- cgit v1.2.3