diff options
author | Rose Hudson <rose@krx.sh> | 2023-06-08 10:42:25 +0100 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2023-07-10 09:57:02 +0000 |
commit | 214df8eda07d18b032abfcf525c8344e077c0c7e (patch) | |
tree | 29c2d58df0474fc47e5bf4d7eae0df0b1961d068 /include | |
parent | f4eaab12a056e339b1b7548f211bb463ad064392 (diff) |
scene_output: optionally record and report timings
Diffstat (limited to 'include')
-rw-r--r-- | include/wlr/types/wlr_scene.h | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/include/wlr/types/wlr_scene.h b/include/wlr/types/wlr_scene.h index 36ad2361..b5487528 100644 --- a/include/wlr/types/wlr_scene.h +++ b/include/wlr/types/wlr_scene.h @@ -209,6 +209,11 @@ struct wlr_scene_output { struct wl_array render_list; }; +struct wlr_scene_timer { + int64_t pre_render_duration; + struct wlr_render_timer *render_timer; +}; + /** A layer shell scene helper */ struct wlr_scene_layer_surface_v1 { struct wlr_scene_tree *tree; @@ -455,16 +460,30 @@ void wlr_scene_output_destroy(struct wlr_scene_output *scene_output); void wlr_scene_output_set_position(struct wlr_scene_output *scene_output, int lx, int ly); +struct wlr_scene_output_state_options { + struct wlr_scene_timer *timer; +}; + /** * Render and commit an output. */ -bool wlr_scene_output_commit(struct wlr_scene_output *scene_output); +bool wlr_scene_output_commit(struct wlr_scene_output *scene_output, + const struct wlr_scene_output_state_options *options); /** * Render and populate given output state. */ bool wlr_scene_output_build_state(struct wlr_scene_output *scene_output, - struct wlr_output_state *state); + struct wlr_output_state *state, const struct wlr_scene_output_state_options *options); + +/** + * Retrieve the duration in nanoseconds between the last wlr_scene_output_commit() call and the end + * of its operations, including those on the GPU that may have finished after the call returned. + * + * Returns -1 if the duration is unavailable. + */ +int64_t wlr_scene_timer_get_duration_ns(struct wlr_scene_timer *timer); +void wlr_scene_timer_finish(struct wlr_scene_timer *timer); /** * Call wlr_surface_send_frame_done() on all surfaces in the scene rendered by |