mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -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
|
|
@ -90,7 +90,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 state = {0};
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &state, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(output->wlr_output, &state, NULL,
|
||||
NULL);
|
||||
if (pass == NULL) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 },
|
||||
|
|
|
|||
|
|
@ -115,7 +115,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
struct wlr_output *wlr_output = output->output;
|
||||
|
||||
struct wlr_output_state output_state = {0};
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
assert(renderer);
|
||||
|
||||
struct wlr_output_state output_state = {0};
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
.color = {
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
wlr_output_effective_resolution(wlr_output, &width, &height);
|
||||
|
||||
struct wlr_output_state output_state = {0};
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
}
|
||||
|
||||
struct wlr_output_state state = {0};
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &state, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &state, NULL, NULL);
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
.color = {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
wlr_output_effective_resolution(wlr_output, &width, &height);
|
||||
|
||||
struct wlr_output_state output_state = {0};
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = wlr_output->width, .height = wlr_output->height },
|
||||
|
|
|
|||
|
|
@ -77,7 +77,7 @@ static void output_frame_notify(struct wl_listener *listener, void *data) {
|
|||
wlr_output_effective_resolution(wlr_output, &width, &height);
|
||||
|
||||
struct wlr_output_state output_state = {0};
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL);
|
||||
struct wlr_render_pass *pass = wlr_output_begin_render_pass(wlr_output, &output_state, NULL, NULL);
|
||||
wlr_render_pass_add_rect(pass, &(struct wlr_render_rect_options){
|
||||
.box = { .width = width, .height = height },
|
||||
.color = { 0.25, 0.25, 0.25, 1 },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue