summaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2022-06-14 02:28:36 -0700
committerVito Caputo <vcaputo@pengaru.com>2022-08-07 06:51:36 -0700
commit5a0776f1fdc6b7780cd21d568150e804347a6f8a (patch)
tree646f1c6e73cd9d7cb63306a840879a0a64aebbed /src/main.c
parent4eb5f55bb0087769e47d0dc745a831440c5041fe (diff)
til: til_fb_fragment_t **fragment_ptr all the things
Preparatory commit for enabling cloneable/swappable fragments There's an outstanding issue with the til_fb_page_t submission, see comments. Doesn't matter for now since cloning doesn't happen yet, but will need to be addressed before they do.
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 7f6557b..8648b8e 100644
--- a/src/main.c
+++ b/src/main.c
@@ -319,15 +319,28 @@ static void * rototiller_thread(void *_rt)
struct timeval now;
for (;;) {
- til_fb_page_t *page;
- unsigned ticks;
+ til_fb_page_t *page;
+ til_fb_fragment_t *fragment;
+ unsigned ticks;
page = til_fb_page_get(rt->fb);
+ fragment = &page->fragment;
gettimeofday(&now, NULL);
ticks = get_ticks(&rt->start_tv, &now, rt->ticks_offset);
- til_module_render(rt->module_context, ticks, &page->fragment);
+ /* XXX FIXME this needs refactoring, maybe til_fb_fragment_ops_t needs
+ * to implement the page_put, then til_fb_page_get() just returns a
+ * fragment with a put method.
+ *
+ * I've hacked it for now, but it's broken once cloning becomes a thing
+ * because we assume that page contains fragment @ put time. When a
+ * clone could have replaced the fragment, and it's the replacement page
+ * that must be submitted. what makes a page? being submittable, so
+ * maybe just make submit another op on the fragment and get rid of the
+ * til_fb_page_t type altogether... hacked to build for now.
+ */
+ til_module_render(rt->module_context, ticks, &fragment);
til_fb_page_put(rt->fb, page);
}
© All Rights Reserved