summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-08-29 11:53:44 -0700
committerVito Caputo <vcaputo@pengaru.com>2023-08-29 11:53:44 -0700
commit25ae095b243cd2fc221200944c0fbcf9cc9429b4 (patch)
tree0546fb73f5811dacd918de57486631403d608715 /src
parent5ba2147e2db913fa0ba79daf49d58d2f4d35a9a7 (diff)
main: apply submit-to-present delay to ticks
This should push the ticks value ahead by 1-2 frames worth of time, when rendering is meeting/exceeding the frame rate. Which is the appropriate thing to do, since rendering is effectively slightly ahead of the clock, producing visuals for now+N-frames into the future. When rendering lags behind, there's basically no delay, and rendering is just operating on the "now" ticks which will be flipped to ASAP once submitted. This will probably be revisited once audio is rolled in, since that too will need to be kept in sync with the visuals' perspective of time.
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index e8a166a..b555bbf 100644
--- a/src/main.c
+++ b/src/main.c
@@ -336,7 +336,7 @@ static void * rototiller_thread(void *_rt)
til_stream_start_frame(rt->stream);
ticks = til_ticks_now();
- til_module_render(rt->module_context, rt->stream, ticks, &rt->fragment);
+ til_module_render(rt->module_context, rt->stream, ticks + delay, &rt->fragment);
til_fb_fragment_submit(rt->fragment);
if (rt->args.print_module_contexts || rt->args.print_pipes) {
© All Rights Reserved