summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-08-29 11:47:45 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-08-29 11:47:45 -0700
commit5ba2147e2db913fa0ba79daf49d58d2f4d35a9a7 (patch)
tree1b6f5c60fb2b0e095e66093c6a0c526f82227b71 /src/main.c
parenteba46d3c401a57c7ca2f95baa0312bfb09543ed0 (diff)
til_fb: return queue delay from til_fb_page_get()
til_fb is triple buffered, but when rendering lags behind the queue is empty making present-to-delay intervals smaller than when rendering is keeping up and the queue is kept full. This returns the duration of the returned pages last submit-to-present delay, effectively measuring how long a page can expect to wait to be flipped to/presented currently. A subsequent commit will apply this delay value to the ticks supplied to rendering.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.c b/src/main.c
index e51ad5e..e8a166a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -326,9 +326,9 @@ static void * rototiller_thread(void *_rt)
rototiller_t *rt = _rt;
while (til_stream_active(rt->stream)) {
- unsigned ticks;
+ unsigned ticks, delay = 0;
- rt->fragment = til_fb_page_get(rt->fb);
+ rt->fragment = til_fb_page_get(rt->fb, &delay);
if (!rt->fragment) {
til_stream_end(rt->stream);
continue;
© All Rights Reserved