From 5a0776f1fdc6b7780cd21d568150e804347a6f8a Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Tue, 14 Jun 2022 02:28:36 -0700 Subject: 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. --- src/modules/ray/ray.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/modules/ray') diff --git a/src/modules/ray/ray.c b/src/modules/ray/ray.c index ead6636..9814dcc 100644 --- a/src/modules/ray/ray.c +++ b/src/modules/ray/ray.c @@ -145,9 +145,10 @@ static til_module_context_t * ray_create_context(unsigned seed, unsigned ticks, /* prepare a frame for concurrent rendering */ -static void ray_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t *fragment, til_frame_plan_t *res_frame_plan) +static void ray_prepare_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr, til_frame_plan_t *res_frame_plan) { - ray_context_t *ctxt = (ray_context_t *)context; + ray_context_t *ctxt = (ray_context_t *)context; + til_fb_fragment_t *fragment = *fragment_ptr; *res_frame_plan = (til_frame_plan_t){ .fragmenter = til_fragmenter_tile64 }; #if 1 @@ -177,15 +178,16 @@ static void ray_prepare_frame(til_module_context_t *context, unsigned ticks, til /* ray trace a simple scene into the fragment */ -static void ray_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t *fragment) +static void ray_render_fragment(til_module_context_t *context, unsigned ticks, unsigned cpu, til_fb_fragment_t **fragment_ptr) { - ray_context_t *ctxt = (ray_context_t *)context; + ray_context_t *ctxt = (ray_context_t *)context; + til_fb_fragment_t *fragment = *fragment_ptr; ray_render_trace_fragment(ctxt->render, fragment); } -static void ray_finish_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t *fragment) +static void ray_finish_frame(til_module_context_t *context, unsigned ticks, til_fb_fragment_t **fragment_ptr) { ray_context_t *ctxt = (ray_context_t *)context; -- cgit v1.2.3