diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2023-09-04 15:06:44 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2023-09-04 20:53:41 -0700 |
commit | bab16b070f95687ec11d43e55f3dd6e69f96a576 (patch) | |
tree | 324246c6582cd74a7240b72f2f3b11a6618b9d40 /src/modules/strobe | |
parent | 9170d08854796f8595c9f6cebe85827a71e86e19 (diff) |
til: support multi-pass rendering
Modules can now use the til_module_t.finish_frame() return value
to trigger re-rendering by returning 1, returning 0 finishes the
frame.
A smattering of til_module_t.finish_frame() implementations were
largely mechanically updated to match this change by returning 0,
since nothing actually uses multi-pass rendering yet.
The impetus for this is experimenting with the flow module doing
two passes of threaded rendering per frame. A first pass to
sample the flow field and update the elements, per-cpu, but
drawing nothing. Then a second pass to render the elements in a
tiled manner.
Diffstat (limited to 'src/modules/strobe')
-rw-r--r-- | src/modules/strobe/strobe.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/modules/strobe/strobe.c b/src/modules/strobe/strobe.c index 9e7024c..3d354e8 100644 --- a/src/modules/strobe/strobe.c +++ b/src/modules/strobe/strobe.c @@ -129,15 +129,16 @@ static void strobe_render_fragment(til_module_context_t *context, til_stream_t * } -static void strobe_finish_frame(til_module_context_t *context, til_stream_t *stream, unsigned int ticks, til_fb_fragment_t **fragment_ptr) +static int strobe_finish_frame(til_module_context_t *context, til_stream_t *stream, unsigned int ticks, til_fb_fragment_t **fragment_ptr) { strobe_context_t *ctxt = (strobe_context_t *)context; - if (!ctxt->flash) - return; + if (ctxt->flash) { + ctxt->flash = 0; + ctxt->last_flash_ticks = ticks; + } - ctxt->flash = 0; - ctxt->last_flash_ticks = ticks; + return 0; } |