diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2022-04-22 00:45:42 -0700 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2022-04-22 00:50:39 -0700 |
commit | 8e1330d60cb94629cbc09f65f558d47cdbfe633b (patch) | |
tree | 4dc127b02392efb7cc3b70684449f7476722f635 | |
parent | 98553eaa9b6d4d5bc03d59a6bec74f4877a620b5 (diff) |
modules/montage: stop assuming modules don't fragment
There's been a longstanding todo item in montage where it was
ignoring the fragmenter returned by a module's prepare_frame().
This commit continues with the single-threaded rendering of the
modules within their respective tiles, still ad-hoc open coded.
But now actually applies the fragmenter returned as if the
rendering were being threaded, since when a module returns a
fragmenter from its prepare_frame() it may strongly depend on
that fragmenting for its output.
-rw-r--r-- | src/modules/montage/montage.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/src/modules/montage/montage.c b/src/modules/montage/montage.c index a45a32c..521ccfd 100644 --- a/src/modules/montage/montage.c +++ b/src/modules/montage/montage.c @@ -198,27 +198,21 @@ static void montage_render_fragment(void *context, unsigned ticks, unsigned cpu, return; } - /* since we're *already* in a threaded render of tiles, no further * threading within the montage tiles is desirable, so the per-module * render is done explicitly serially here in an open-coded ad-hoc * fashion for now. FIXME TODO: move this into rototiller.c */ if (module->prepare_frame) { - til_fragmenter_t unused; - - /* XXX FIXME: ignoring the fragmenter here is a violation of the module API, - * rototiller.c should have a module render interface with explicit non-threading - * that still does all the necessary fragmenting as needed. - * - * Today, I can get away with this, because montage is the only module that's - * sensitive to this aspect of the API and it skips itself. - */ + til_fragmenter_t fragmenter; + unsigned fragnum = 0; + til_fb_fragment_t frag; - module->prepare_frame(ctxt->contexts[fragment->number], ticks, 1, fragment, &unused); - } + module->prepare_frame(ctxt->contexts[fragment->number], ticks, 1, fragment, &fragmenter); - if (module->render_fragment) - module->render_fragment(ctxt->contexts[fragment->number], ticks, 0, fragment); + while (fragmenter(ctxt->contexts[fragment->number], fragment, fragnum++, &frag)) + module->render_fragment(ctxt->contexts[fragment->number], ticks, fragnum, &frag); + } else if (module->render_fragment) + module->render_fragment(ctxt->contexts[fragment->number], ticks, 0, fragment); } |